diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/digest/old_crc/gencrc | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/digest/old_crc/gencrc')
-rw-r--r-- | library/cpp/digest/old_crc/gencrc/main.cpp | 46 | ||||
-rw-r--r-- | library/cpp/digest/old_crc/gencrc/ya.make | 18 |
2 files changed, 32 insertions, 32 deletions
diff --git a/library/cpp/digest/old_crc/gencrc/main.cpp b/library/cpp/digest/old_crc/gencrc/main.cpp index e3fe9e04ce..d5821304ce 100644 --- a/library/cpp/digest/old_crc/gencrc/main.cpp +++ b/library/cpp/digest/old_crc/gencrc/main.cpp @@ -4,29 +4,29 @@ #define POLY_32 0xEDB88320UL #define POLY_64 ULL(0xE543279765927881) -static void crc16init() { - ui32 CRCTAB16[256]; +static void crc16init() { + ui32 CRCTAB16[256]; ui32 crc; int i, j; - for (i = 0; i < 256; CRCTAB16[i++] = 0xFFFF & ((crc << 8) ^ (crc >> 8))) + 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 (size_t k = 0; k < 256; ++k) { Cout << " ULL(" << CRCTAB16[k] << ")"; - + if (k != 255) { - Cout << ",\n"; - } - } + Cout << ",\n"; + } + } } -static void crc32init() { - ui32 CRCTAB32[256]; +static void crc32init() { + ui32 CRCTAB32[256]; ui32 crc; int i, j; @@ -36,21 +36,21 @@ static void crc32init() { crc = (crc >> 1) ^ POLY_32; else crc >>= 1; - + for (size_t k = 0; k < 256; ++k) { Cout << " ULL(" << CRCTAB32[k] << ")"; - + if (k != 255) { - Cout << ",\n"; - } - } + Cout << ",\n"; + } + } } -int main() { - Cout << "static const ui32 CRCTAB16[] = {\n\n"; - crc16init(); - Cout << "\n};\n\n"; - Cout << "static const ui32 CRCTAB32[] = {\n\n"; - crc32init(); - Cout << "\n};\n\n"; -} +int main() { + Cout << "static const ui32 CRCTAB16[] = {\n\n"; + crc16init(); + Cout << "\n};\n\n"; + Cout << "static const ui32 CRCTAB32[] = {\n\n"; + crc32init(); + Cout << "\n};\n\n"; +} diff --git a/library/cpp/digest/old_crc/gencrc/ya.make b/library/cpp/digest/old_crc/gencrc/ya.make index 4d3a328780..df25863bee 100644 --- a/library/cpp/digest/old_crc/gencrc/ya.make +++ b/library/cpp/digest/old_crc/gencrc/ya.make @@ -1,9 +1,9 @@ -PROGRAM() - -OWNER(pg) - -SRCS( - main.cpp -) - -END() +PROGRAM() + +OWNER(pg) + +SRCS( + main.cpp +) + +END() |