Browse Source

Restoring authorship annotation for <sergey@yandex-team.ru>. Commit 2 of 2.

sergey 3 years ago
parent
commit
05f59b2581

+ 1 - 1
contrib/libs/crcutil/ya.make

@@ -51,7 +51,7 @@ IF (ARCH_I386 OR ARCH_X86_64)
         SRCS(
             multiword_128_64_gcc_amd64_sse2.cc
             multiword_64_64_gcc_amd64_asm.cc
-        ) 
+        )
     ENDIF()
     IF (OS_WINDOWS)
         SRCS(

+ 1 - 1
library/cpp/cgiparam/cgiparam.h

@@ -56,7 +56,7 @@ public:
 
     Y_PURE_FUNCTION
     size_t PrintSize() const noexcept;
- 
+
     /** The same as Print* except that RFC-3986 reserved characters are escaped.
      * @param safe - set of characters to be skipped in escaping
      */

+ 9 - 9
library/cpp/containers/atomizer/atomizer.h

@@ -25,14 +25,14 @@ public:
     using value_type = typename string_hash<ui32, HashFcn, EqualTo>::value_type;
     using size_type = typename string_hash<ui32, HashFcn, EqualTo>::size_type;
     using pool_size_type = typename string_hash<ui32, HashFcn, EqualTo>::pool_size_type;
- 
-    using string_hash<ui32, HashFcn, EqualTo>::pool; 
-    using string_hash<ui32, HashFcn, EqualTo>::size; 
-    using string_hash<ui32, HashFcn, EqualTo>::find; 
-    using string_hash<ui32, HashFcn, EqualTo>::end; 
-    using string_hash<ui32, HashFcn, EqualTo>::insert_copy; 
-    using string_hash<ui32, HashFcn, EqualTo>::clear_hash; 
- 
+
+    using string_hash<ui32, HashFcn, EqualTo>::pool;
+    using string_hash<ui32, HashFcn, EqualTo>::size;
+    using string_hash<ui32, HashFcn, EqualTo>::find;
+    using string_hash<ui32, HashFcn, EqualTo>::end;
+    using string_hash<ui32, HashFcn, EqualTo>::insert_copy;
+    using string_hash<ui32, HashFcn, EqualTo>::clear_hash;
+
     atomizer() {
         order.reserve(HASH_SIZE_DEFAULT);
     }
@@ -104,7 +104,7 @@ public:
             order[(*I).second - 1] = (*I).first;
     }
 };
- 
+
 template <class T, class HashFcn, class EqualTo>
 class super_atomizer: public string_hash<ui32, HashFcn, EqualTo> {
 private:

+ 4 - 4
library/cpp/digest/old_crc/crc.cpp

@@ -1,10 +1,10 @@
 #include "crc.h"
- 
+
 #include <library/cpp/digest/old_crc/crc.inc>
 
 #include <util/system/defaults.h>
 
-static const ui64 CRCTAB64[256] = { 
+static const ui64 CRCTAB64[256] = {
     ULL(0x0000000000000000),
     ULL(0xE543279765927881),
     ULL(0x2FC568B9AEB68983),
@@ -261,8 +261,8 @@ static const ui64 CRCTAB64[256] = {
     ULL(0x8B8AF709E5AF8488),
     ULL(0x410CB8272E8B758A),
     ULL(0xA44F9FB04B190D0B),
-}; 
- 
+};
+
 const ui32* crctab16 = CRCTAB16;
 const ui32* crctab32 = CRCTAB32;
 const ui64* crctab64 = CRCTAB64;

+ 29 - 29
library/cpp/digest/old_crc/crc.h

@@ -1,45 +1,45 @@
 #pragma once
- 
+
 #include <util/system/defaults.h>
- 
-#define CRC16INIT 0 
-#define CRC32INIT 0 
-#define CRC64INIT ULL(0xFFFFFFFFFFFFFFFF) 
- 
-// CCITT CRC-16 
+
+#define CRC16INIT 0
+#define CRC32INIT 0
+#define CRC64INIT ULL(0xFFFFFFFFFFFFFFFF)
+
+// CCITT CRC-16
 inline ui16 crc16(const char* buf, size_t buflen, ui32 crcinit = CRC16INIT) {
-    ui32 crc = 0xFFFF & ((crcinit >> 8) ^ (crcinit << 8)); 
+    ui32 crc = 0xFFFF & ((crcinit >> 8) ^ (crcinit << 8));
     const char* end = buf + buflen;
     extern const ui32* crctab16;
- 
-    while (buf < end) { 
-        crc = (crc >> 8) ^ crctab16[(crc ^ *buf) & 0xFF]; 
-        ++buf; 
-    } 
+
+    while (buf < end) {
+        crc = (crc >> 8) ^ crctab16[(crc ^ *buf) & 0xFF];
+        ++buf;
+    }
     return (ui16)(0xFFFF & ((crc >> 8) ^ (crc << 8)));
-} 
- 
+}
+
 struct IdTR {
     Y_FORCE_INLINE static ui8 T(ui8 a) {
         return a;
     }
 };
 
-// CCITT CRC-32 
+// CCITT CRC-32
 template <class TR>
 inline ui32 crc32(const char* buf, size_t buflen, ui32 crcinit = CRC32INIT) {
-    ui32 crc = crcinit ^ 0xFFFFFFFF; 
+    ui32 crc = crcinit ^ 0xFFFFFFFF;
     const char* end = buf + buflen;
     extern const ui32* crctab32;
- 
+
     while (buf < end) {
         crc = (crc >> 8) ^ crctab32[(crc ^ TR::T((ui8)*buf)) & 0xFF];
-        ++buf; 
-    } 
+        ++buf;
+    }
+
+    return crc ^ 0xFFFFFFFF;
+}
 
-    return crc ^ 0xFFFFFFFF; 
-} 
- 
 inline ui32 crc32(const char* buf, size_t buflen, ui32 crcinit = CRC32INIT) {
     return crc32<IdTR>(buf, buflen, crcinit);
 }
@@ -48,17 +48,17 @@ inline ui32 crc32(const void* buf, size_t buflen, ui32 crcinit = CRC32INIT) {
     return crc32((const char*)buf, buflen, crcinit);
 }
 
-// Copyright (C) Sewell Development Corporation, 1994 - 1998. 
+// Copyright (C) Sewell Development Corporation, 1994 - 1998.
 inline ui64 crc64(const void* buf, size_t buflen, ui64 crcinit = CRC64INIT) {
     const unsigned char* ptr = (const unsigned char*)buf;
     extern const ui64* crctab64;
- 
+
     while (buflen--) {
-        crcinit = crctab64[((crcinit >> 56) ^ *ptr++)] ^ (crcinit << 8); 
+        crcinit = crctab64[((crcinit >> 56) ^ *ptr++)] ^ (crcinit << 8);
     }
-    return crcinit; 
-} 
- 
+    return crcinit;
+}
+
 namespace NCrcPrivate {
     template <unsigned N>
     struct TCrcHelper;

+ 25 - 25
library/cpp/digest/old_crc/gencrc/main.cpp

@@ -1,20 +1,20 @@
 #include <util/stream/output.h>
- 
-#define POLY_16 0x1021 
-#define POLY_32 0xEDB88320UL 
+
+#define POLY_16 0x1021
+#define POLY_32 0xEDB88320UL
 #define POLY_64 ULL(0xE543279765927881)
- 
+
 static void crc16init() {
     ui32 CRCTAB16[256];
-    ui32 crc; 
-    int i, j; 
- 
+    ui32 crc;
+    int i, j;
+
     for (i = 0; i < 256; CRCTAB16[i++] = 0xFFFF & ((crc << 8) ^ (crc >> 8)))
-        for (crc = i, j = 8; j > 0; j--) 
-            if (crc & 1) 
-                crc = (crc >> 1) ^ POLY_16; 
-            else 
-                crc >>= 1; 
+        for (crc = i, j = 8; j > 0; j--)
+            if (crc & 1)
+                crc = (crc >> 1) ^ POLY_16;
+            else
+                crc >>= 1;
 
     for (size_t k = 0; k < 256; ++k) {
         Cout << "    ULL(" << CRCTAB16[k] << ")";
@@ -23,19 +23,19 @@ static void crc16init() {
             Cout << ",\n";
         }
     }
-} 
- 
+}
+
 static void crc32init() {
     ui32 CRCTAB32[256];
-    ui32 crc; 
-    int i, j; 
- 
-    for (i = 0; i < 256; CRCTAB32[i++] = crc) 
-        for (crc = i, j = 8; j > 0; j--) 
-            if (crc & 1) 
-                crc = (crc >> 1) ^ POLY_32; 
-            else 
-                crc >>= 1; 
+    ui32 crc;
+    int i, j;
+
+    for (i = 0; i < 256; CRCTAB32[i++] = crc)
+        for (crc = i, j = 8; j > 0; j--)
+            if (crc & 1)
+                crc = (crc >> 1) ^ POLY_32;
+            else
+                crc >>= 1;
 
     for (size_t k = 0; k < 256; ++k) {
         Cout << "    ULL(" << CRCTAB32[k] << ")";
@@ -44,8 +44,8 @@ static void crc32init() {
             Cout << ",\n";
         }
     }
-} 
- 
+}
+
 int main() {
     Cout << "static const ui32 CRCTAB16[] = {\n\n";
     crc16init();

+ 2 - 2
library/cpp/http/misc/httpcodes.cpp

@@ -1,5 +1,5 @@
-#include "httpcodes.h" 
- 
+#include "httpcodes.h"
+
 TStringBuf HttpCodeStrEx(int code) noexcept {
     switch (code) {
         case HTTP_CONTINUE:

+ 9 - 9
library/cpp/http/misc/httpcodes.h

@@ -1,12 +1,12 @@
 #pragma once
- 
+
 #include <util/generic/strbuf.h>
 
-enum HttpCodes { 
+enum HttpCodes {
     HTTP_CONTINUE = 100,
     HTTP_SWITCHING_PROTOCOLS = 101,
     HTTP_PROCESSING = 102,
- 
+
     HTTP_OK = 200,
     HTTP_CREATED = 201,
     HTTP_ACCEPTED = 202,
@@ -17,7 +17,7 @@ enum HttpCodes {
     HTTP_MULTI_STATUS = 207,
     HTTP_ALREADY_REPORTED = 208,
     HTTP_IM_USED = 226,
- 
+
     HTTP_MULTIPLE_CHOICES = 300,
     HTTP_MOVED_PERMANENTLY = 301,
     HTTP_FOUND = 302,
@@ -26,7 +26,7 @@ enum HttpCodes {
     HTTP_USE_PROXY = 305,
     HTTP_TEMPORARY_REDIRECT = 307,
     HTTP_PERMANENT_REDIRECT = 308,
- 
+
     HTTP_BAD_REQUEST = 400,
     HTTP_UNAUTHORIZED = 401,
     HTTP_PAYMENT_REQUIRED = 402,
@@ -57,7 +57,7 @@ enum HttpCodes {
     HTTP_TOO_MANY_REQUESTS = 429,
     HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
     HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451,
- 
+
     HTTP_INTERNAL_SERVER_ERROR = 500,
     HTTP_NOT_IMPLEMENTED = 501,
     HTTP_BAD_GATEWAY = 502,
@@ -71,10 +71,10 @@ enum HttpCodes {
     HTTP_NOT_EXTENDED = 510,
     HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511,
     HTTP_UNASSIGNED_512 = 512,
- 
+
     HTTP_CODE_MAX
-}; 
- 
+};
+
 TStringBuf HttpCodeStrEx(int code) noexcept;
 
 inline TStringBuf HttpCodeStr(int code) noexcept {

+ 45 - 45
library/cpp/http/misc/httpdate.cpp

@@ -1,69 +1,69 @@
-/*- 
-* Copyright 1997 Massachusetts Institute of Technology 
-* 
-* Permission to use, copy, modify, and distribute this software and 
-* its documentation for any purpose and without fee is hereby 
-* granted, provided that both the above copyright notice and this 
-* permission notice appear in all copies, that both the above 
-* copyright notice and this permission notice appear in all 
-* supporting documentation, and that the name of M.I.T. not be used 
-* in advertising or publicity pertaining to distribution of the 
-* software without specific, written prior permission.  M.I.T. makes 
-* no representations about the suitability of this software for any 
-* purpose.  It is provided "as is" without express or implied 
-* warranty. 
+/*-
+* Copyright 1997 Massachusetts Institute of Technology
 *
-* THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS 
-* ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, 
-* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
-* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT 
-* SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
-* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
-* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
-* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
-* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
-* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
-* SUCH DAMAGE. 
-*/ 
+* Permission to use, copy, modify, and distribute this software and
+* its documentation for any purpose and without fee is hereby
+* granted, provided that both the above copyright notice and this
+* permission notice appear in all copies, that both the above
+* copyright notice and this permission notice appear in all
+* supporting documentation, and that the name of M.I.T. not be used
+* in advertising or publicity pertaining to distribution of the
+* software without specific, written prior permission.  M.I.T. makes
+* no representations about the suitability of this software for any
+* purpose.  It is provided "as is" without express or implied
+* warranty.
+*
+* THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS
+* ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+* SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+* SUCH DAMAGE.
+*/
 #include <util/system/defaults.h>
- 
-#include <sys/types.h> 
+
+#include <sys/types.h>
 #include <cctype>
 #include <cstdio>
 #include <cstdlib>
 #include <cstring>
 #include <ctime>
- 
+
 #include <util/system/compat.h>   /* stricmp */
 #include <util/system/yassert.h>
 #include "httpdate.h"
 #include <util/datetime/base.h>
- 
+
 static const char *wkdays[] = {
-    "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" 
-}; 
+    "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+};
+
+static const char *months[] = {
+    "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct",
+    "Nov", "Dec"
+};
 
-static const char *months[] = { 
-    "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", 
-    "Nov", "Dec" 
-}; 
- 
 int format_http_date(char buf[], size_t size, time_t when) {
-    struct tm tms; 
+    struct tm tms;
     GmTimeR(&when, &tms);
- 
-#ifndef HTTP_DATE_ISO_8601 
+
+#ifndef HTTP_DATE_ISO_8601
     return snprintf(buf, size, "%s, %02d %s %04d %02d:%02d:%02d GMT",
         wkdays[tms.tm_wday], tms.tm_mday, months[tms.tm_mon],
         tms.tm_year + 1900, tms.tm_hour, tms.tm_min, tms.tm_sec);
-#else /* ISO 8601 */ 
+#else /* ISO 8601 */
     return snprintf(buf, size, "%04d%02d%02dT%02d%02d%02d+0000",
         tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday,
         tms.tm_hour, tms.tm_min, tms.tm_sec);
-#endif 
-} 
- 
+#endif
+}
+
 char* format_http_date(time_t when, char* buf, size_t buflen) {
     const int len = format_http_date(buf, buflen, when);
 

+ 1 - 1
library/cpp/http/misc/httpdate.h

@@ -1,5 +1,5 @@
 #pragma once
- 
+
 #include <util/datetime/base.h>
 #include <util/generic/string.h>
 

Some files were not shown because too many files changed in this diff