From 121826d6a448732f92683c9896a348c56a2210d4 Mon Sep 17 00:00:00 2001 From: Justin Shrake Date: Tue, 30 Dec 2025 14:33:15 -0800 Subject: [PATCH] Add .clang-format and format codebase .clang-format config constructed with the help of Claude Code (Opus 4.5) to minimize the amount of diffs introduced when formatting. --- .clang-format | 133 +++ .gitignore | 3 - bld/delta/main.c | 4 +- libLoam/c++/ArgParse.cpp | 15 +- libLoam/c++/Line.cpp | 4 +- libLoam/c++/Mutex.cpp | 5 +- libLoam/c++/ObPseudopod.cpp | 8 +- libLoam/c++/ObRetortPod.cpp | 12 +- libLoam/c++/Plane.cpp | 4 +- libLoam/c++/Rectangle.cpp | 4 +- libLoam/c++/Str.cpp | 17 +- libLoam/c++/tests/AxisAlignedBoxTests.cpp | 4 +- libLoam/c++/tests/BasicStrTest.cpp | 11 +- libLoam/c++/tests/FatherTimeTest.cpp | 2 +- libLoam/c++/tests/GeomSlabTest.cpp | 61 +- libLoam/c++/tests/MinimalLoamTest.cpp | 12 +- libLoam/c++/tests/ObAcaciaTest.cpp | 20 +- libLoam/c++/tests/ObMapTest.cpp | 26 +- libLoam/c++/tests/ObRefTest.cpp | 14 +- libLoam/c++/tests/ObRetortTest.cpp | 17 +- libLoam/c++/tests/RegexpStrTest.cpp | 6 +- ...e-object-interface-specialization-test.cpp | 5 +- libLoam/c++/tests/aptest1.cpp | 5 +- libLoam/c++/tests/aptest3.cpp | 15 +- libLoam/c++/tests/benchmark-retorts.cpp | 3 +- libLoam/c++/win32/Mutex_win32.cpp | 16 +- libLoam/c/ob-dirs.c | 17 +- libLoam/c/ob-file.c | 16 +- libLoam/c/ob-hash-city.c | 224 ++-- libLoam/c/ob-hash-win32.c | 5 +- libLoam/c/ob-hash.c | 903 +++++++++------ libLoam/c/ob-log.c | 189 +-- libLoam/c/ob-rand.c | 20 +- libLoam/c/ob-retorts.c | 10 +- libLoam/c/ob-time.c | 10 +- libLoam/c/ob-truly-rand.c | 3 +- libLoam/c/ob-util.c | 20 +- libLoam/c/ob-vers.c | 23 +- libLoam/c/tests/LoamGTest.cpp | 8 +- libLoam/c/tests/test-endian.c | 5 +- libLoam/c/tests/test-hash.c | 943 ++++++++++----- libLoam/c/tests/test-logging.c | 154 +-- libLoam/c/tests/test-time.c | 62 +- libLoam/c/tests/test-vasprintf.c | 23 +- libLoam/c/win32/ob-sys-win32-cpp.cpp | 9 +- libLoam/c/win32/ob-sys-win32.c | 29 +- libPlasma/bench/LoneWorker.cpp | 4 +- libPlasma/bench/PingPonger.cpp | 4 +- libPlasma/bench/SerialWorker.cpp | 4 +- libPlasma/c++/AtomicComposite.cpp | 4 +- libPlasma/c++/CompositeSlaw.cpp | 4 +- libPlasma/c++/Protein.cpp | 4 +- libPlasma/c++/ProteinComposite.cpp | 3 +- libPlasma/c++/Slaw.cpp | 20 +- libPlasma/c++/SlawCons.cpp | 4 +- libPlasma/c++/SlawIterator.cpp | 10 +- libPlasma/c++/SlawList.cpp | 12 +- libPlasma/c++/SlawRef.cpp | 8 +- libPlasma/c++/tests/ArraySlawTest.cpp | 16 +- libPlasma/c++/tests/PoolTest.cpp | 3 +- libPlasma/c++/tests/SlawListTest.cpp | 15 +- libPlasma/c++/tests/SlawMapDuplicateTest.cpp | 12 +- libPlasma/c++/tests/SlawMapTest.cpp | 19 +- libPlasma/c++/tests/SlawSerializationTest.cpp | 14 +- libPlasma/c++/tests/SlawTest.cpp | 4 +- libPlasma/c++/tests/SlawTypesTest.cpp | 9 +- libPlasma/c/await_test.c | 27 +- libPlasma/c/bin2yaml.c | 8 +- libPlasma/c/fifo_ops.c | 12 +- libPlasma/c/fill_pool.c | 7 +- libPlasma/c/fire-and-forget.c | 2 +- libPlasma/c/matrix_test.c | 15 +- libPlasma/c/multi_test.c | 2 +- libPlasma/c/ossl/ossl-client.c | 18 +- libPlasma/c/ossl/ossl-common.c | 59 +- libPlasma/c/ossl/ossl-io.c | 16 +- libPlasma/c/ossl/ossl-server.c | 12 +- libPlasma/c/ossl/ossl-validation.c | 14 +- libPlasma/c/p-await.c | 2 +- libPlasma/c/p-create.c | 8 +- libPlasma/c/p-deposit.c | 2 +- libPlasma/c/p-info.c | 11 +- libPlasma/c/p-list.c | 13 +- libPlasma/c/p-newest-idx.c | 2 +- libPlasma/c/p-nth.c | 2 +- libPlasma/c/p-oldest-idx.c | 2 +- libPlasma/c/p-sleep.c | 2 +- libPlasma/c/plasma-util.c | 33 +- libPlasma/c/pool-context.c | 14 +- libPlasma/c/pool-log.c | 25 +- libPlasma/c/pool-mmap-header.c | 29 +- libPlasma/c/pool-portable.c | 29 +- libPlasma/c/pool-toc.c | 15 +- libPlasma/c/pool.c | 79 +- libPlasma/c/pool_cmd.c | 5 +- libPlasma/c/pool_mmap.c | 295 ++--- libPlasma/c/pool_multi.c | 57 +- libPlasma/c/pool_net.c | 59 +- libPlasma/c/pool_options.c | 5 +- libPlasma/c/pool_tcp.c | 204 ++-- libPlasma/c/pool_tcp_server.c | 128 +- libPlasma/c/protein.c | 13 +- libPlasma/c/sem_ops.c | 42 +- libPlasma/c/simple_read.c | 4 +- libPlasma/c/slaw-coerce.c | 33 +- libPlasma/c/slaw-io.c | 42 +- libPlasma/c/slaw-v1.c | 83 +- libPlasma/c/slaw-walk.c | 91 +- libPlasma/c/slaw-yaml-stub.c | 4 +- libPlasma/c/slaw-yaml.c | 228 ++-- libPlasma/c/slaw.c | 32 +- libPlasma/c/t/MiscSlawTest.cpp | 51 +- libPlasma/c/t/endian_test.c | 1028 +++++++++-------- libPlasma/c/t/ilk-begotten-helper.c | 502 ++++---- libPlasma/c/t/list-search.c | 10 +- libPlasma/c/t/listcat_test.c | 5 +- libPlasma/c/t/nonconformist.c | 17 +- libPlasma/c/t/protein-saratoga.c | 14 +- libPlasma/c/t/simple-numerics.c | 6 +- libPlasma/c/t/slabu-list.c | 12 +- libPlasma/c/t/slabu-map.c | 5 +- libPlasma/c/t/slaw-preakness.c | 14 +- libPlasma/c/t/slumcat.c | 6 +- libPlasma/c/t/slypes.c | 15 +- libPlasma/c/t/spew-test.c | 19 +- libPlasma/c/t/test-interop.c | 19 +- libPlasma/c/t/test-path.c | 5 +- libPlasma/c/t/test-slaw-io.c | 13 +- libPlasma/c/t/test-string.c | 33 +- libPlasma/c/t/test-yaml.c | 6 +- libPlasma/c/t/testcoerce.c | 30 +- libPlasma/c/t/various-types.c | 24 +- libPlasma/c/t/yaml-options.c | 24 +- libPlasma/c/tests/MiscPoolTest.cpp | 51 +- libPlasma/c/tests/RecentServerOnly.cpp | 138 ++- libPlasma/c/tests/TocUnitTest.cpp | 30 +- libPlasma/c/tests/check-stepsize-behavior.c | 26 +- libPlasma/c/tests/deposit-timestamp.c | 17 +- libPlasma/c/tests/doppelganger.c | 9 +- libPlasma/c/tests/empty-gang.c | 14 +- libPlasma/c/tests/many_creates.c | 27 +- libPlasma/c/tests/null_test.c | 32 +- libPlasma/c/tests/participate_create.c | 2 +- libPlasma/c/tests/pingpong_test.c | 11 +- libPlasma/c/tests/pool-log-test.c | 66 +- libPlasma/c/tests/random-access-test.c | 18 +- libPlasma/c/tests/rewind_test.c | 7 +- libPlasma/c/tests/seek_test.c | 34 +- libPlasma/c/tests/test-await-index.c | 23 +- libPlasma/c/tests/test-bigger.c | 33 +- libPlasma/c/tests/test-info.c | 27 +- libPlasma/c/tests/test-multi-await.c | 27 +- libPlasma/c/tests/wrap_test.c | 9 +- libPlasma/c/tests/zombie.c | 8 +- libPlasma/c/win32/fifo_ops_win32.c | 19 +- libPlasma/c/win32/sem_ops_win32.c | 10 +- libPlasma/ruby/rubyPlasma.c | 30 +- .../zeroconf/pool-server-zeroconf-adapter.cpp | 5 +- libPlasma/zeroconf/tests/PoolServerTest.cpp | 3 +- libPlasma/zeroconf/tests/ZeroconfTest.cpp | 9 +- libPlasma/zeroconf/zeroconf-client-avahi.c | 13 +- libPlasma/zeroconf/zeroconf-server-avahi.c | 14 +- 162 files changed, 4155 insertions(+), 3472 deletions(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..4ad8bd03 --- /dev/null +++ b/.clang-format @@ -0,0 +1,133 @@ +--- +# Reverse-engineered clang-format configuration for plasma +# Based on analysis of existing code style + +Language: Cpp +BasedOnStyle: GNU + +# Core indentation +IndentWidth: 2 +UseTab: Never +TabWidth: 2 +ContinuationIndentWidth: 2 + +# Custom brace wrapping based on observed style +# GNU-like for control statements (braces indented), but K&R for namespaces +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: Always + AfterEnum: true + AfterFunction: true + AfterNamespace: false + AfterStruct: true + AfterUnion: true + AfterExternBlock: false + BeforeCatch: true + BeforeElse: true + BeforeLambdaBody: false + BeforeWhile: true + IndentBraces: true + SplitEmptyFunction: true + SplitEmptyRecord: false + SplitEmptyNamespace: false + +# Column limit - appears to be around 80 +ColumnLimit: 80 + +# DISTINCTIVE: Space before ALL parentheses including function calls +# e.g., malloc (sizeof (slabu)), fprintf (stderr, ...) +SpaceBeforeParens: Always + +# Pointer/reference alignment - space before pointer, attached to variable name +# e.g., char *buf, not char* buf +PointerAlignment: Right +ReferenceAlignment: Right + +# Access modifiers (public:, private:) indented 1 space from class +AccessModifierOffset: -1 + +# Namespace handling - no indentation inside namespaces +NamespaceIndentation: None + +# Switch/case - case labels indented inside switch braces +IndentCaseLabels: true +IndentCaseBlocks: false + +# Constructor initializer lists +ConstructorInitializerIndentWidth: 4 +BreakConstructorInitializers: BeforeColon +PackConstructorInitializers: NextLine + +# Allow short forms +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortLambdasOnASingleLine: Inline + +# Breaking and wrapping - keep return type on same line as function name +AlwaysBreakAfterReturnType: None +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: true +BinPackParameters: true +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeTernaryOperators: true + +# Alignment +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignConsecutiveMacros: false +AlignEscapedNewlines: Right +AlignOperands: Align +AlignTrailingComments: true + +# Spacing +SpaceAfterCStyleCast: true +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: false +SpacesInParentheses: false +SpacesInSquareBrackets: false + +# Include sorting +SortIncludes: false +IncludeBlocks: Preserve + +# Macros +# OB_PRIVATE is an alias for private/public access specifiers +StatementMacros: + - OB_PRIVATE + - OB_PROTECTED + +# Other +Cpp11BracedListStyle: true +DeriveLineEnding: true +DerivePointerAlignment: false +FixNamespaceComments: false +IndentGotoLabels: false +IndentPPDirectives: None +IndentWrappedFunctionNames: false +KeepEmptyLinesAtTheStartOfBlocks: false +MaxEmptyLinesToKeep: 3 +ReflowComments: false +SortUsingDeclarations: false +UseCRLF: false +--- diff --git a/.gitignore b/.gitignore index 72d019c0..ae6bb2f9 100644 --- a/.gitignore +++ b/.gitignore @@ -104,9 +104,6 @@ obj-*-linux-*/ #ccls .ccls-cache/ -#clang-format -.clang-format - # Common cmake dirs build diff --git a/bld/delta/main.c b/bld/delta/main.c index ee565916..f70a010b 100644 --- a/bld/delta/main.c +++ b/bld/delta/main.c @@ -3,13 +3,13 @@ static int reap_children (void) int i; int status; for (i = 0; i < total_children; i++) - wait (&status); + wait (&status); } int main (int argc, char *argv[]) { get_args (argc, argv); - gettimeofday (&start_time, ((void *)0)); + gettimeofday (&start_time, ((void *) 0)); goal_end_time = start_time; goal_end_time.tv_sec += test_secs; diff --git a/libLoam/c++/ArgParse.cpp b/libLoam/c++/ArgParse.cpp index fed82ac2..2c1d7025 100644 --- a/libLoam/c++/ArgParse.cpp +++ b/libLoam/c++/ArgParse.cpp @@ -381,9 +381,10 @@ ArgParse::ArgInfo ArgParse::Query (apstring name) const OptionHandler *oh = d->findOption (name, &no); if (isAlias && !oh) - OB_FATAL_BUG_CODE (0x12000006, "Invariant violated (alias '%s' without a " - "real option '%s' " - "behind it)\n", + OB_FATAL_BUG_CODE (0x12000006, + "Invariant violated (alias '%s' without a " + "real option '%s' " + "behind it)\n", name.utf8 (), ai.aliasFor.utf8 ()); if (oh) @@ -712,9 +713,7 @@ OptionHandler::OptionHandler (ArgParse::apstring usage_in, int separator_in) { } -OptionHandler::~OptionHandler () -{ -} +OptionHandler::~OptionHandler () {} bool OptionHandler::takesarg () const { @@ -726,9 +725,7 @@ bool OptionHandler::allownegation () const return false; } -void OptionHandler::reset () -{ -} +void OptionHandler::reset () {} ArgParse::apstring OptionHandler::handleargsplit (ArgParse::apstring arg, ArgParse::apstring prefix) diff --git a/libLoam/c++/Line.cpp b/libLoam/c++/Line.cpp index da5aae9a..d103ee80 100644 --- a/libLoam/c++/Line.cpp +++ b/libLoam/c++/Line.cpp @@ -10,9 +10,7 @@ using namespace oblong::loam; static const Vect zaxis (0.0, 0.0, 1.0); -Line::Line () : dir (zaxis) -{ -} +Line::Line () : dir (zaxis) {} Line::Line (const Vect &pointOnLine, const Vect &direction) : point (pointOnLine), dir (direction) diff --git a/libLoam/c++/Mutex.cpp b/libLoam/c++/Mutex.cpp index 1c9e6a7b..78b26fe9 100644 --- a/libLoam/c++/Mutex.cpp +++ b/libLoam/c++/Mutex.cpp @@ -14,9 +14,8 @@ Mutex::Mutex (bool recursive) pthread_mutexattr_t attr; OB_CHECK_PTHREAD_CODE (0x110b0000, pthread_mutexattr_init (&attr)); if (recursive) - OB_CHECK_PTHREAD_CODE (0x110b0001, - pthread_mutexattr_settype (&attr, - PTHREAD_MUTEX_RECURSIVE)); + OB_CHECK_PTHREAD_CODE ( + 0x110b0001, pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE)); OB_CHECK_PTHREAD_CODE (0x110b0002, pthread_mutex_init (&mutex_, &attr)); OB_CHECK_PTHREAD_CODE (0x110b0003, pthread_mutexattr_destroy (&attr)); } diff --git a/libLoam/c++/ObPseudopod.cpp b/libLoam/c++/ObPseudopod.cpp index cab768bf..32bae197 100644 --- a/libLoam/c++/ObPseudopod.cpp +++ b/libLoam/c++/ObPseudopod.cpp @@ -7,11 +7,7 @@ using namespace oblong::loam; -ObPseudopod::ObPseudopod () : AnkleObject () -{ -} +ObPseudopod::ObPseudopod () : AnkleObject () {} -ObPseudopod::~ObPseudopod () -{ -} +ObPseudopod::~ObPseudopod () {} diff --git a/libLoam/c++/ObRetortPod.cpp b/libLoam/c++/ObRetortPod.cpp index 6cb47ba7..f91d1db1 100644 --- a/libLoam/c++/ObRetortPod.cpp +++ b/libLoam/c++/ObRetortPod.cpp @@ -7,13 +7,9 @@ using namespace oblong::loam; -ObRetortPod::ObRetortPod () : ObPseudopod (), c_ret (0) -{ -} +ObRetortPod::ObRetortPod () : ObPseudopod (), c_ret (0) {} -ObRetortPod::ObRetortPod (ob_retort obr) : ObPseudopod (), c_ret (obr) -{ -} +ObRetortPod::ObRetortPod (ob_retort obr) : ObPseudopod (), c_ret (obr) {} ObRetortPod::ObRetortPod (ob_retort obr, ObRetortPod *ant) : ObPseudopod (), c_ret (obr), antecedent (ant) @@ -21,9 +17,7 @@ ObRetortPod::ObRetortPod (ob_retort obr, ObRetortPod *ant) } -ObRetortPod::~ObRetortPod () -{ -} +ObRetortPod::~ObRetortPod () {} ob_retort ObRetortPod::NumericRetort () const diff --git a/libLoam/c++/Plane.cpp b/libLoam/c++/Plane.cpp index d177410d..97458dbc 100644 --- a/libLoam/c++/Plane.cpp +++ b/libLoam/c++/Plane.cpp @@ -11,9 +11,7 @@ using namespace oblong::loam; static const Vect zaxs (0.0, 0.0, 1.0); -Plane::Plane () : norm (zaxs) -{ -} +Plane::Plane () : norm (zaxs) {} Plane::Plane (const Vect &p, const Vect &normal) : point (p), norm (normal) { diff --git a/libLoam/c++/Rectangle.cpp b/libLoam/c++/Rectangle.cpp index eb48f027..77fb1847 100644 --- a/libLoam/c++/Rectangle.cpp +++ b/libLoam/c++/Rectangle.cpp @@ -11,8 +11,8 @@ Rectangle::Rectangle (Vect corner_, Vect leg1_, Vect leg2_) Str Rectangle::AsStr () const { - return "Rectangle[c=" + corner.AsStr () + ", l1=" + leg1.AsStr () + ", l2=" - + leg2.AsStr () + "]"; + return "Rectangle[c=" + corner.AsStr () + ", l1=" + leg1.AsStr () + + ", l2=" + leg2.AsStr () + "]"; } bool Rectangle::IsValid () const diff --git a/libLoam/c++/Str.cpp b/libLoam/c++/Str.cpp index 6882126d..b5c498cf 100644 --- a/libLoam/c++/Str.cpp +++ b/libLoam/c++/Str.cpp @@ -106,9 +106,7 @@ Str::Str () noexcept _Init (); } -Str::Str (std::nullptr_t) noexcept : Str () -{ -} +Str::Str (std::nullptr_t) noexcept : Str () {} Str::Str (const char *text) { @@ -813,7 +811,7 @@ bool Str::Matches (const Str &pattern) const pattern.utf8 (), mattie.ErrorStr ().utf8 ()); else mattie.Match (); - return bool(mattie); + return bool (mattie); } bool Str::Match (const Str &pattern) @@ -827,7 +825,7 @@ bool Str::Match (const Str &pattern) pattern.utf8 (), match->ErrorStr ().utf8 ()); else match->Match (); - return bool(*match); + return bool (*match); } bool Str::Match () @@ -841,13 +839,13 @@ bool Str::MatchAgain () if (!match) return false; match->Match (); - return bool(*match); + return bool (*match); } bool Str::MatchHasMatched () const { if (match) - return bool(*match); + return bool (*match); return false; } @@ -1282,8 +1280,9 @@ void Str::_EnsureU8Capacity (int64 capacity) void Str::_SetU8Length (int64 length) { if (!u8 || u8ByteCapacity < length) - OB_FATAL_BUG_CODE (0x11000003, "u8 = %p, u8ByteCapacity = %" OB_FMT_64 "d, " - "length = %" OB_FMT_64 "d\n", + OB_FATAL_BUG_CODE (0x11000003, + "u8 = %p, u8ByteCapacity = %" OB_FMT_64 "d, " + "length = %" OB_FMT_64 "d\n", u8, u8ByteCapacity, length); u8[length] = 0; u8ByteLength = length; diff --git a/libLoam/c++/tests/AxisAlignedBoxTests.cpp b/libLoam/c++/tests/AxisAlignedBoxTests.cpp index 6c7530eb..5d0aa660 100644 --- a/libLoam/c++/tests/AxisAlignedBoxTests.cpp +++ b/libLoam/c++/tests/AxisAlignedBoxTests.cpp @@ -31,7 +31,9 @@ TEST (AxisAlignedBoxTests, AABB_Constructors) const std::array op_corners = box.Corners (); // Test construction from an iterator pair. - auto bad_hash = [](const Vect &x) -> size_t { return 0; }; + auto bad_hash = [] (const Vect &x) -> size_t { + return 0; + }; std::unordered_set spoints (0, bad_hash); spoints.emplace (1, 2, 3); spoints.emplace (2, 3, 4); diff --git a/libLoam/c++/tests/BasicStrTest.cpp b/libLoam/c++/tests/BasicStrTest.cpp index 030b96c6..2fa37ff1 100644 --- a/libLoam/c++/tests/BasicStrTest.cpp +++ b/libLoam/c++/tests/BasicStrTest.cpp @@ -566,9 +566,9 @@ TEST_F (BasicStrTest, Format) * to keep C++11 from complaining? That blows! */ const char eins[] = {0x24, 0x00}; -const char zwei[] = {char(0xC2), char(0xA2), 0x00}; -const char drei[] = {char(0xE2), char(0x82), char(0xAC), 0x00}; -const char vier[] = {char(0xF0), char(0xA4), char(0xAD), char(0xA2), 0x00}; +const char zwei[] = {char (0xC2), char (0xA2), 0x00}; +const char drei[] = {char (0xE2), char (0x82), char (0xAC), 0x00}; +const char vier[] = {char (0xF0), char (0xA4), char (0xAD), char (0xA2), 0x00}; TEST_F (BasicStrTest, FromUTF8) { @@ -960,8 +960,8 @@ TEST_F (BasicStrTest, InvalidUTF8) // bug 2865 { ob_suppress_message (OBLV_WARN, 0x11000004); - static const char notutf8[] = {82, 101, 121, 107, 106, - 97, 118, char(237), 107, 0}; + static const char notutf8[] = {82, 101, 121, 107, 106, + 97, 118, char (237), 107, 0}; Str unfortunate (notutf8); EXPECT_EQ (9, unfortunate.Length ()); EXPECT_EQ ('j', unfortunate.At (4)); @@ -1082,7 +1082,6 @@ TEST_F (BasicStrTest, Char16) TEST_F (BasicStrTest, DubyaChar) { - const wchar_t *text = L"beeeep"; const size_t text_length = wcslen (text); diff --git a/libLoam/c++/tests/FatherTimeTest.cpp b/libLoam/c++/tests/FatherTimeTest.cpp index c1833937..0d4cc422 100644 --- a/libLoam/c++/tests/FatherTimeTest.cpp +++ b/libLoam/c++/tests/FatherTimeTest.cpp @@ -55,7 +55,7 @@ static void waste_time () vals[i] = i; #ifdef HAVE_STD_SHUFFLE - std::shuffle(vals + 0, vals + enuf, std::mt19937{std::random_device{}()}); + std::shuffle (vals + 0, vals + enuf, std::mt19937{std::random_device{}()}); #else std::random_shuffle (vals + 0, vals + enuf); #endif diff --git a/libLoam/c++/tests/GeomSlabTest.cpp b/libLoam/c++/tests/GeomSlabTest.cpp index 411b0fbd..9fd9a884 100644 --- a/libLoam/c++/tests/GeomSlabTest.cpp +++ b/libLoam/c++/tests/GeomSlabTest.cpp @@ -161,8 +161,9 @@ TEST (GeomSlabTest, TimeOneMillionRayRectIntersections) Vect hitPt; for (int i = 0; i < 1000000; ++i) { - didHit = didHit && GeomSlab::RayRectIntersection (rayStart, rayTo, corner, - over, up, &hitPt); + didHit = didHit + && GeomSlab::RayRectIntersection (rayStart, rayTo, corner, over, + up, &hitPt); didHit = didHit && GeomSlab::RayRectIntersection (ray, rect, &hitPt); } EXPECT_TRUE (didHit); @@ -183,8 +184,9 @@ TEST (GeomSlabTest, TimeOneMillionRayQuadIntersections) Vect hitPt; for (int i = 0; i < 1000000; ++i) { - didHit = didHit && GeomSlab::RayQuadIntersection (rayStart, rayTo, corner, - over, up, &hitPt); + didHit = didHit + && GeomSlab::RayQuadIntersection (rayStart, rayTo, corner, over, + up, &hitPt); } EXPECT_TRUE (didHit); } @@ -204,14 +206,14 @@ TEST (GeomSlabTest, TimeOneMillionRaySphereIntersections) Vect hitPt; for (int i = 0; i < 500000; ++i) { - didHit = - didHit && GeomSlab::RaySphereForwardIntersection (rayStart, rayTo, + didHit = didHit + && GeomSlab::RaySphereForwardIntersection (rayStart, rayTo, corner, 8.0, &hitPt); } for (int i = 0; i < 500000; ++i) { - didHit = - didHit && GeomSlab::RaySphereForwardIntersection (rayStart, rayTo, + didHit = didHit + && GeomSlab::RaySphereForwardIntersection (rayStart, rayTo, corner, 12.0, &hitPt); } EXPECT_TRUE (didHit); @@ -252,9 +254,8 @@ TEST (GeomSlabTest, RayRectIntersection) const Vect rayOrigin = hitPt - distAlong * rayDir; Vect shouldMatchHitPt; - const bool didHit = - GeomSlab::RayRectIntersection (rayOrigin, hitPt, corner, over, up, - &shouldMatchHitPt); + const bool didHit = GeomSlab::RayRectIntersection ( + rayOrigin, hitPt, corner, over, up, &shouldMatchHitPt); bool shouldBeInside = (a > eps) && (a < 1.0 - eps) && (b > eps) && (b < 1.0 - eps); @@ -601,9 +602,8 @@ TEST (GeomSlabTest, RayTriangleIntersection) const Vect rayOrigin = hitPt - distAlong * rayDir; Vect shouldMatchHitPt; - const bool didHit = - GeomSlab::RayTriangleIntersection (rayOrigin, hitPt, corner, over, - up, &shouldMatchHitPt); + const bool didHit = GeomSlab::RayTriangleIntersection ( + rayOrigin, hitPt, corner, over, up, &shouldMatchHitPt); // Be extra-forgiving for sliver polygons const bool sliver = sqrt (over.Dot (up) * over.Dot (up) @@ -715,9 +715,8 @@ TEST (GeomSlabTest, RayEllipseIntersection) const Vect rayOrigin = hitPt - distAlong * rayDir; Vect shouldMatchHitPt; - const bool didHit = - GeomSlab::RayEllipseIntersection (rayOrigin, hitPt, center, over, - up, &shouldMatchHitPt); + const bool didHit = GeomSlab::RayEllipseIntersection ( + rayOrigin, hitPt, center, over, up, &shouldMatchHitPt); const bool shouldBeInside = (sqrt (a * a + b * b) < (1.0 - eps)); const bool shouldBeOutside = (sqrt (a * a + b * b) > (1.0 + eps)); @@ -803,12 +802,9 @@ TEST (GeomSlabTest, TestLineSphereBothIntersections) Vect isectMidpoint; float64 halfDist, alongDist; - const bool didHit = - GeomSlab::LineSphereBothIntersections (rayOrigin, rayDir, - center, radius, - &isectMidpoint, - &halfDist, - &alongDist); + const bool didHit = GeomSlab::LineSphereBothIntersections ( + rayOrigin, rayDir, center, radius, &isectMidpoint, + &halfDist, &alongDist); if (didHit) { @@ -904,16 +900,12 @@ TEST (GeomSlabTest, TestRaySphereForwardBackwardIsect) const Vect backwardsTo = rayOrigin - 5.0 * rayDir; Vect hitPt; - const bool didHit = - GeomSlab::RaySphereForwardIntersection (rayOrigin, rayTo, - center, radius, - &hitPt); + const bool didHit = GeomSlab::RaySphereForwardIntersection ( + rayOrigin, rayTo, center, radius, &hitPt); Vect backHitPt; const bool backwardsHit = - GeomSlab::RaySphereBackwardIntersection (rayOrigin, - backwardsTo, - center, radius, - &backHitPt); + GeomSlab::RaySphereBackwardIntersection ( + rayOrigin, backwardsTo, center, radius, &backHitPt); const bool lineShouldHit = sqrt (a * a + b * b) < (1.0 - eps); @@ -938,9 +930,10 @@ TEST (GeomSlabTest, TestRaySphereForwardBackwardIsect) } const bool resultsMeanSomething = rayShouldNotHit || rayShouldHit; - if (resultsMeanSomething && ((didHit && rayShouldNotHit) - || (!didHit && rayShouldHit) - || (backwardsHit != didHit))) + if (resultsMeanSomething + && ((didHit && rayShouldNotHit) + || (!didHit && rayShouldHit) + || (backwardsHit != didHit))) { OB_LOG_ERROR ("rayOrigin %s\n" "rayDir %s\n" diff --git a/libLoam/c++/tests/MinimalLoamTest.cpp b/libLoam/c++/tests/MinimalLoamTest.cpp index c988cfb7..448e8017 100644 --- a/libLoam/c++/tests/MinimalLoamTest.cpp +++ b/libLoam/c++/tests/MinimalLoamTest.cpp @@ -551,10 +551,9 @@ TEST_F (QuatTest, QuatFromRandomRot) OB_LOG_ERROR ("(%d) failure in %s approx= %s", i, rot_rand.AsStr ().utf8 (), should_be_same.AsStr ().utf8 ()); - OB_LOG_ERROR ("over, up, norm \n[%s,\n %s,\n %s]", - over.AsStr ().utf8 (), - norm.Cross (over).AsStr ().utf8 (), - norm.AsStr ().utf8 ()); + OB_LOG_ERROR ( + "over, up, norm \n[%s,\n %s,\n %s]", over.AsStr ().utf8 (), + norm.Cross (over).AsStr ().utf8 (), norm.AsStr ().utf8 ()); } EXPECT_TRUE (rot_rand.RotApproxEquals (should_be_same, eps)); // test is a bit *strict* -- but it'll be interesting to see when @@ -644,9 +643,8 @@ TEST_F (QuatTest, QuatToFromRotationMatrix_Bug_2367) EXPECT_TRUE ( q_mine.QuatRotVect (XZ).ApproxEquals (m_mine.TransformVect (XZ), eps)); - EXPECT_TRUE (q_mine.Conj () - .QuatRotVect (XZ) - .ApproxEquals (m_mine.Transpose ().TransformVect (XZ), eps)); + EXPECT_TRUE (q_mine.Conj ().QuatRotVect (XZ).ApproxEquals ( + m_mine.Transpose ().TransformVect (XZ), eps)); EXPECT_TRUE ( q2.QuatRotVect (XZ).ApproxEquals (m_mine.TransformVect (XZ), eps)); EXPECT_TRUE ( diff --git a/libLoam/c++/tests/ObAcaciaTest.cpp b/libLoam/c++/tests/ObAcaciaTest.cpp index d6f40bfa..c9763e2c 100644 --- a/libLoam/c++/tests/ObAcaciaTest.cpp +++ b/libLoam/c++/tests/ObAcaciaTest.cpp @@ -565,8 +565,9 @@ TEST (ObAcacia, DISABLED_Speed) if (OB_ALREADY_PRESENT == ac1.Append (*rr)) dups++; - fprintf (stderr, "out of one million entries, <%d> duplicates " - "dared show their ugly faces.\n", + fprintf (stderr, + "out of one million entries, <%d> duplicates " + "dared show their ugly faces.\n", dups); FatherTime uhr, nuke_uhr; @@ -586,8 +587,9 @@ TEST (ObAcacia, DISABLED_Speed) } nuk += nuke_uhr.CurTime (); } - fprintf (stderr, "ACAC: [%d] iterations of [%d] " - "insertions: %f seconds; tear-down in %f secs\n", + fprintf (stderr, + "ACAC: [%d] iterations of [%d] " + "insertions: %f seconds; tear-down in %f secs\n", w, chunk, uhr.CurTime () - nuk, nuk); } @@ -606,8 +608,9 @@ TEST (ObAcacia, DISABLED_Speed) } nuk += nuke_uhr.CurTime (); } - fprintf (stderr, "UQTR: [%d] iterations of [%d] trove " - "insertions: %f seconds; tear-down in %f secs\n", + fprintf (stderr, + "UQTR: [%d] iterations of [%d] trove " + "insertions: %f seconds; tear-down in %f secs\n", w, chunk, uhr.CurTime () - nuk, nuk); } @@ -627,8 +630,9 @@ TEST (ObAcacia, DISABLED_Speed) ac.Remove (*rr); nuk += nuke_uhr.CurTime (); } - fprintf (stderr, "ACAC-rem: [%d] iterations of [%d] " - "removals: %f seconds\n", + fprintf (stderr, + "ACAC-rem: [%d] iterations of [%d] " + "removals: %f seconds\n", w, chunk, nuk); } diff --git a/libLoam/c++/tests/ObMapTest.cpp b/libLoam/c++/tests/ObMapTest.cpp index 02bc3e6c..6e2eac4c 100644 --- a/libLoam/c++/tests/ObMapTest.cpp +++ b/libLoam/c++/tests/ObMapTest.cpp @@ -31,12 +31,12 @@ TEST (ObMapTest, RangedForLoopInts) int sum = 0; for (auto i : inttrove) { - static_assert (std::is_same *>::value, - "std::begin(ObMap) should return an " - "iterator with elements of type ObCons"); + static_assert ( + std::is_same *>::value, + "std::begin(ObMap) should return an " + "iterator with elements of type ObCons"); sum += i->Car (); } EXPECT_EQ (5, inttrove.Count ()); @@ -56,13 +56,13 @@ TEST (ObMapTest, RangedForLoopObRefs) for (auto dorf : dorves) { - static_assert (std::is_same *>::value, - "std::begin(ObMap) should " - "return an iterator with elements of type " - "ObCons"); + static_assert ( + std::is_same *>::value, + "std::begin(ObMap) should " + "return an iterator with elements of type " + "ObCons"); strings.Put (dorf->Car ()->s, dorf->Cdr ()->s); } EXPECT_EQ (strings.NthKey (0), "avert"); diff --git a/libLoam/c++/tests/ObRefTest.cpp b/libLoam/c++/tests/ObRefTest.cpp index 7002a110..9b66dc49 100644 --- a/libLoam/c++/tests/ObRefTest.cpp +++ b/libLoam/c++/tests/ObRefTest.cpp @@ -331,8 +331,7 @@ TEST (PointerToNonAnkleAssignTest, ObRef) } struct CountVonCountVonCount : public CountVonCount -{ -}; +{}; TEST (PointerToNonAnkleAssignSubTest, ObRef) { @@ -368,8 +367,7 @@ TEST (PointerToNonAnkleMoveAssignTest, ObRef) struct Subtalar : public AnkleObject -{ -}; +{}; TEST (EmptyObRefSubTypeAssignmentTest, ObRef) { @@ -580,13 +578,9 @@ TEST (ObRefForwardTestTwo, ObRef) EXPECT_EQ (obj.obj->grip_mnd, obj_minder); } -AnkleForwardedTestTwo::AnkleForwardedTestTwo () -{ -} +AnkleForwardedTestTwo::AnkleForwardedTestTwo () {} -AnkleForwardedTestTwo::~AnkleForwardedTestTwo () -{ -} +AnkleForwardedTestTwo::~AnkleForwardedTestTwo () {} //struct AnkleSubclass : public virtual AnkleObject diff --git a/libLoam/c++/tests/ObRetortTest.cpp b/libLoam/c++/tests/ObRetortTest.cpp index 0cbc4c88..fa2c586f 100644 --- a/libLoam/c++/tests/ObRetortTest.cpp +++ b/libLoam/c++/tests/ObRetortTest.cpp @@ -216,20 +216,15 @@ TEST (ObRetortTest, Comparison2) class TylopodaPod : public ObRetortPod -{ -}; +{}; class VicunaPod : public TylopodaPod -{ -}; +{}; class AlpacaPod : public TylopodaPod -{ -}; +{}; class LlamaPod : public TylopodaPod -{ -}; +{}; class GuanacoPod : public TylopodaPod -{ -}; +{}; TEST (ObRetortTest, RetortPods) @@ -339,7 +334,7 @@ TEST (ObRetortTest, RetortsInASet) vec.resize (st.size ()); std::copy (st.begin (), st.end (), vec.begin ()); #ifdef HAVE_STD_SHUFFLE - std::shuffle(vec.begin(), vec.end(), std::mt19937{std::random_device{}()}); + std::shuffle (vec.begin (), vec.end (), std::mt19937{std::random_device{}()}); #else std::random_shuffle (vec.begin (), vec.end ()); #endif diff --git a/libLoam/c++/tests/RegexpStrTest.cpp b/libLoam/c++/tests/RegexpStrTest.cpp index bbaf4fac..1624ab1f 100644 --- a/libLoam/c++/tests/RegexpStrTest.cpp +++ b/libLoam/c++/tests/RegexpStrTest.cpp @@ -377,9 +377,9 @@ static void random_str_ops (const char *initial, int32 seed) for (j = 1; j < n; j++) if (probably (r)) { - EXPECT_EQ (c, strs[j]->At (k)) << "j = " << j << ", k = " << k - << ", str = '" - << strs[j]->utf8 () << "'"; + EXPECT_EQ (c, strs[j]->At (k)) + << "j = " << j << ", k = " << k << ", str = '" + << strs[j]->utf8 () << "'"; } break; case 3: diff --git a/libLoam/c++/tests/ankle-object-interface-specialization-test.cpp b/libLoam/c++/tests/ankle-object-interface-specialization-test.cpp index acc8b4e7..7c4b9e20 100644 --- a/libLoam/c++/tests/ankle-object-interface-specialization-test.cpp +++ b/libLoam/c++/tests/ankle-object-interface-specialization-test.cpp @@ -32,8 +32,9 @@ void update_scratch (const char *note) { if (global_scratch.size () == expected_entries) { - fprintf (stderr, "calling our scratchpad function unexpectedly. " - "(%s)\n", + fprintf (stderr, + "calling our scratchpad function unexpectedly. " + "(%s)\n", note); abort (); } diff --git a/libLoam/c++/tests/aptest1.cpp b/libLoam/c++/tests/aptest1.cpp index a1718f8c..de7baf9c 100644 --- a/libLoam/c++/tests/aptest1.cpp +++ b/libLoam/c++/tests/aptest1.cpp @@ -199,8 +199,9 @@ TEST (aptest1, UsageMessage) t2.Alias ("G", "incremental"); t2.Alias ("g", "listed-incremental"); t2.UsageHeader ("\nArchive format selection:", 37); - t2.ArgFlag ("V", "=NAME\acreate archive with volume name NAME\n " - " PATTERN\aat list/extract time, a globbing PATTERN", + t2.ArgFlag ("V", + "=NAME\acreate archive with volume name NAME\n " + " PATTERN\aat list/extract time, a globbing PATTERN", &junkf); t2.Alias ("V", "label"); t2.AllowOneCharOptionsToBeCombined (); diff --git a/libLoam/c++/tests/aptest3.cpp b/libLoam/c++/tests/aptest3.cpp index 8c4227d4..d0eb5ed7 100644 --- a/libLoam/c++/tests/aptest3.cpp +++ b/libLoam/c++/tests/aptest3.cpp @@ -67,16 +67,19 @@ int main (int argc, char **argv) "\anames, one per wjc card, to be used for slot 1 output", &slot1poolsTrove, ','); ap.ArgFloat ("compression", "\acompression fraction ", &compression, true); - ap.ArgInt ("rate-num", "\anumerator of framerate fraction (rate_num/" - "rate_denom)\n\a", + ap.ArgInt ("rate-num", + "\anumerator of framerate fraction (rate_num/" + "rate_denom)\n\a", &frame_rate_num, true); - ap.ArgInt ("rate-denom", "\adenominator of framerate fraction (rate_num/" - "rate_denom)\n\a", + ap.ArgInt ("rate-denom", + "\adenominator of framerate fraction (rate_num/" + "rate_denom)\n\a", &frame_rate_denom, true); ap.ArgInt ("tiles", "\anumber of tiles to process in parallel ", ¶llel_tiles, true); - ap.ArgInt ("kernel", "\awavelet kernel to use\n\a(0 = IRR_9x7, 1 = REV_5x3" - ", 2 = IRR_5x3, 3 = KERNEL_DEFAULT)\n\a", + ap.ArgInt ("kernel", + "\awavelet kernel to use\n\a(0 = IRR_9x7, 1 = REV_5x3" + ", 2 = IRR_5x3, 3 = KERNEL_DEFAULT)\n\a", &kernel, true); ap.Alias ("pool", "p"); diff --git a/libLoam/c++/tests/benchmark-retorts.cpp b/libLoam/c++/tests/benchmark-retorts.cpp index 55014687..50f45522 100644 --- a/libLoam/c++/tests/benchmark-retorts.cpp +++ b/libLoam/c++/tests/benchmark-retorts.cpp @@ -32,11 +32,10 @@ ObRetort nesty_ObRetort (void *, int64); start = FatherTime::AbsoluteTime (); \ for (unt64 i = 0; i < (iterations); i++) \ { - #define BENCH_END(iterations) \ } \ end = FatherTime::AbsoluteTime (); \ - cout << (end - start) << "s, " << (end - start) / (iterations) *1e9 \ + cout << (end - start) << "s, " << (end - start) / (iterations) * 1e9 \ << "ns per iteration." << endl int main (int argc, char **argv) diff --git a/libLoam/c++/win32/Mutex_win32.cpp b/libLoam/c++/win32/Mutex_win32.cpp index 71237d77..b684826d 100644 --- a/libLoam/c++/win32/Mutex_win32.cpp +++ b/libLoam/c++/win32/Mutex_win32.cpp @@ -53,20 +53,20 @@ void Mutex::Lock () case WAIT_FAILED: lasterr = GetLastError (); tort = ob_win32err_to_retort (lasterr); - OB_FATAL_BUG_CODE (0x11010003, "WaitForSingleObject failed with:\n" - "GetLastError = 0x%08x\n" - "tort = 0x%016" OB_FMT_64 "x\n" - "semaphore = %d\n" - "%s\n", + OB_FATAL_BUG_CODE (0x11010003, + "WaitForSingleObject failed with:\n" + "GetLastError = 0x%08x\n" + "tort = 0x%016" OB_FMT_64 "x\n" + "semaphore = %d\n" + "%s\n", lasterr, tort, semaphore, ob_error_string (tort)); return; default: //we weren't able to get the lock - OB_FATAL_BUG_CODE (0x11010001, - "WaitForSingleObject returned unexpected %d", - result); + OB_FATAL_BUG_CODE ( + 0x11010001, "WaitForSingleObject returned unexpected %d", result); return; } } diff --git a/libLoam/c/ob-dirs.c b/libLoam/c/ob-dirs.c index 6a8b5099..e874667a 100644 --- a/libLoam/c/ob-dirs.c +++ b/libLoam/c/ob-dirs.c @@ -127,7 +127,7 @@ static char *generate_tmp (OB_UNUSED va_list unused) #ifdef _MSC_VER || tmp[last] == '\\' #endif - ) + ) tmp[last] = 0; /* nuke that trailing slash! */ return tmp; } @@ -137,8 +137,9 @@ static char *generate_user_gspeak_dir (OB_UNUSED va_list unused) { char *buf = (char *) malloc (MAX_PATH); if (buf - && S_OK == SHGetFolderPath (NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, - SHGFP_TYPE_CURRENT, buf)) + && S_OK + == SHGetFolderPath (NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, + SHGFP_TYPE_CURRENT, buf)) { ob_safe_append_string (buf, MAX_PATH, "\\oblong"); return (buf); @@ -274,7 +275,7 @@ static void measure_or_populate_path (va_list ap, char *dst, size_t *pos) } } first = false; - tinue: +tinue: ob_nop (); // label has to be followed by a statement; so there! } // NUL-terminate the string @@ -832,9 +833,9 @@ ob_retort ob_rmdir_p (const char *dir) #define ALLOCA_STRDUP(x) \ (tmp_size = 1 + strlen ((x)), \ - (char *) memcpy (8 + (char *) ob_make_undefined (alloca (tmp_size + 16), \ - tmp_size + 16), \ - (x), tmp_size)) + (char *) memcpy ( \ + 8 + (char *) ob_make_undefined (alloca (tmp_size + 16), tmp_size + 16), \ + (x), tmp_size)) ob_retort ob_rmdir_p_ex (const char *dir, const char *stop) { @@ -855,7 +856,7 @@ ob_retort ob_rmdir_p_ex (const char *dir, const char *stop) || errno == EACCES || errno == EPERM || errno == EROFS || errno == ENOTDIR // e. g. a symlink: bug 1144 || errno == EINVAL // tried to delete current dir: bug 1340 - ) + ) // Don't complain about "expected" errors; just stop recursing return OB_OK; else diff --git a/libLoam/c/ob-file.c b/libLoam/c/ob-file.c index ba30de09..f6b8207b 100644 --- a/libLoam/c/ob-file.c +++ b/libLoam/c/ob-file.c @@ -130,8 +130,9 @@ char *ob_read_file (const char *filename) OB_LOG_ERROR_CODE (0x10020005, "%s while reading %s\n", strerror (erryes), filename); else - OB_LOG_ERROR_CODE (0x10020006, "shouldn't have happened: neither feof nor " - "ferror on %s\n", + OB_LOG_ERROR_CODE (0x10020006, + "shouldn't have happened: neither feof nor " + "ferror on %s\n", filename); free (s); @@ -277,7 +278,12 @@ ob_retort ob_pipe (int fildes[2]) // see PP_MAYBE and both go off and compute the result, that's // okay, because they'll both eventually set it to the same thing. // (So the second thread to finish is harmlessly redundant.) -typedef enum { PP_NO, PP_YES, PP_MAYBE } possibly; +typedef enum +{ + PP_NO, + PP_YES, + PP_MAYBE +} possibly; // Parse a dotted version string into up to three components. // Returns the number of components parsed. @@ -962,9 +968,9 @@ static ob_retort ob_evutil_ersatz_socketpair_ (int family, int type, int protocol, evutil_socket_t fd[2]) { -/* This code is originally from Tor. Used with permission. */ + /* This code is originally from Tor. Used with permission. */ -/* This socketpair does not work when localhost is down. So + /* This socketpair does not work when localhost is down. So * it's really not the same thing at all. But it's close enough * for now, and really, when localhost is down sometimes, we * have other problems too. diff --git a/libLoam/c/ob-hash-city.c b/libLoam/c/ob-hash-city.c index c16a39f1..c315b967 100644 --- a/libLoam/c/ob-hash-city.c +++ b/libLoam/c/ob-hash-city.c @@ -41,22 +41,25 @@ // possible hash functions, by using SIMD instructions, or by // compromising on hash quality. -#define STATIC_CAST(type, castee) ((type)(castee)) +#define STATIC_CAST(type, castee) ((type) (castee)) typedef struct -{ unt64 first; +{ + unt64 first; unt64 second; } unt128; -INLINIEST unt64 UNALIGNED_LOAD64(const char *p) { +INLINIEST unt64 UNALIGNED_LOAD64 (const char *p) +{ unt64 result; - memcpy(&result, p, sizeof(result)); + memcpy (&result, p, sizeof (result)); return result; } -INLINIEST unt32 UNALIGNED_LOAD32(const char *p) { +INLINIEST unt32 UNALIGNED_LOAD32 (const char *p) +{ unt32 result; - memcpy(&result, p, sizeof(result)); + memcpy (&result, p, sizeof (result)); return result; } @@ -76,12 +79,14 @@ INLINIEST unt32 UNALIGNED_LOAD32(const char *p) { #endif // HASH_LITTLE_ENDIAN -INLINIEST unt64 Fetch64(const char *p) { - return uint64_in_expected_order(UNALIGNED_LOAD64(p)); +INLINIEST unt64 Fetch64 (const char *p) +{ + return uint64_in_expected_order (UNALIGNED_LOAD64 (p)); } -INLINIEST unt32 Fetch32(const char *p) { - return uint32_in_expected_order(UNALIGNED_LOAD32(p)); +INLINIEST unt32 Fetch32 (const char *p) +{ + return uint32_in_expected_order (UNALIGNED_LOAD32 (p)); } // Some primes between 2^63 and 2^64 for various uses. @@ -92,7 +97,8 @@ static const unt64 k3 = 0xc949d7c7509e6557ULL; // Bitwise right rotate. Normally this will compile to a single // instruction, especially if the shift is a manifest constant. -INLINIEST unt64 Rotate(unt64 val, int shift) { +INLINIEST unt64 Rotate (unt64 val, int shift) +{ // Avoid shifting by 64: doing so yields an undefined result. return shift == 0 ? val : ((val >> shift) | (val << (64 - shift))); } @@ -100,56 +106,64 @@ INLINIEST unt64 Rotate(unt64 val, int shift) { // Equivalent to Rotate(), but requires the second arg to be non-zero. // On x86-64, and probably others, it's possible for this to compile // to a single instruction if both args are already in registers. -INLINIEST unt64 RotateByAtLeast1(unt64 val, int shift) { +INLINIEST unt64 RotateByAtLeast1 (unt64 val, int shift) +{ return (val >> shift) | (val << (64 - shift)); } -INLINIEST unt64 ShiftMix(unt64 val) { +INLINIEST unt64 ShiftMix (unt64 val) +{ return val ^ (val >> 47); } -INLINIEST unt64 HashLen0to16(const char *s, size_t len) { - if (len > 8) { - unt64 a = Fetch64(s); - unt64 b = Fetch64(s + len - 8); - return HashLen16(a, RotateByAtLeast1(b + len, len)) ^ b; - } - if (len >= 4) { - unt64 a = Fetch32(s); - return HashLen16(len + (a << 3), Fetch32(s + len - 4)); - } - if (len > 0) { - unt8 a = s[0]; - unt8 b = s[len >> 1]; - unt8 c = s[len - 1]; - unt32 y = STATIC_CAST (unt32, a) + (STATIC_CAST (unt32, b) << 8); - unt32 z = len + (STATIC_CAST (unt32, c) << 2); - return ShiftMix(y * k2 ^ z * k3) * k2; - } +INLINIEST unt64 HashLen0to16 (const char *s, size_t len) +{ + if (len > 8) + { + unt64 a = Fetch64 (s); + unt64 b = Fetch64 (s + len - 8); + return HashLen16 (a, RotateByAtLeast1 (b + len, len)) ^ b; + } + if (len >= 4) + { + unt64 a = Fetch32 (s); + return HashLen16 (len + (a << 3), Fetch32 (s + len - 4)); + } + if (len > 0) + { + unt8 a = s[0]; + unt8 b = s[len >> 1]; + unt8 c = s[len - 1]; + unt32 y = STATIC_CAST (unt32, a) + (STATIC_CAST (unt32, b) << 8); + unt32 z = len + (STATIC_CAST (unt32, c) << 2); + return ShiftMix (y * k2 ^ z * k3) * k2; + } return k2; } // This probably works well for 16-byte strings as well, but it may be overkill // in that case. -INLINIEST unt64 HashLen17to32(const char *s, size_t len) { - unt64 a = Fetch64(s) * k1; - unt64 b = Fetch64(s + 8); - unt64 c = Fetch64(s + len - 8) * k2; - unt64 d = Fetch64(s + len - 16) * k0; - return HashLen16(Rotate(a - b, 43) + Rotate(c, 30) + d, - a + Rotate(b ^ k3, 20) - c + len); +INLINIEST unt64 HashLen17to32 (const char *s, size_t len) +{ + unt64 a = Fetch64 (s) * k1; + unt64 b = Fetch64 (s + 8); + unt64 c = Fetch64 (s + len - 8) * k2; + unt64 d = Fetch64 (s + len - 16) * k0; + return HashLen16 (Rotate (a - b, 43) + Rotate (c, 30) + d, + a + Rotate (b ^ k3, 20) - c + len); } // Return a 16-byte hash for 48 bytes. Quick and dirty. // Callers do best to use "random-looking" values for a and b. -INLINIEST unt128 HashFor48Bytes( - unt64 w, unt64 x, unt64 y, unt64 z, unt64 a, unt64 b) { +INLINIEST unt128 HashFor48Bytes (unt64 w, unt64 x, unt64 y, unt64 z, unt64 a, + unt64 b) +{ a += w; - b = Rotate(b + a + z, 21); + b = Rotate (b + a + z, 21); unt64 c = a; a += x; a += y; - b += Rotate(a, 44); + b += Rotate (a, 44); unt128 result; result.first = a + z; result.second = b + c; @@ -157,80 +171,86 @@ INLINIEST unt128 HashFor48Bytes( } // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty. -INLINIEST unt128 WeakHashLen32WithSeeds( - const char* s, unt64 a, unt64 b) { - return HashFor48Bytes(Fetch64(s), - Fetch64(s + 8), - Fetch64(s + 16), - Fetch64(s + 24), - a, - b); +INLINIEST unt128 WeakHashLen32WithSeeds (const char *s, unt64 a, unt64 b) +{ + return HashFor48Bytes (Fetch64 (s), Fetch64 (s + 8), Fetch64 (s + 16), + Fetch64 (s + 24), a, b); } // Return an 8-byte hash for 33 to 64 bytes. -INLINIEST unt64 HashLen33to64(const char *s, size_t len) { - unt64 z = Fetch64(s + 24); - unt64 a = Fetch64(s) + (len + Fetch64(s + len - 16)) * k0; - unt64 b = Rotate(a + z, 52); - unt64 c = Rotate(a, 37); - a += Fetch64(s + 8); - c += Rotate(a, 7); - a += Fetch64(s + 16); +INLINIEST unt64 HashLen33to64 (const char *s, size_t len) +{ + unt64 z = Fetch64 (s + 24); + unt64 a = Fetch64 (s) + (len + Fetch64 (s + len - 16)) * k0; + unt64 b = Rotate (a + z, 52); + unt64 c = Rotate (a, 37); + a += Fetch64 (s + 8); + c += Rotate (a, 7); + a += Fetch64 (s + 16); unt64 vf = a + z; - unt64 vs = b + Rotate(a, 31) + c; - a = Fetch64(s + 16) + Fetch64(s + len - 32); - z = Fetch64(s + len - 8); - b = Rotate(a + z, 52); - c = Rotate(a, 37); - a += Fetch64(s + len - 24); - c += Rotate(a, 7); - a += Fetch64(s + len - 16); + unt64 vs = b + Rotate (a, 31) + c; + a = Fetch64 (s + 16) + Fetch64 (s + len - 32); + z = Fetch64 (s + len - 8); + b = Rotate (a + z, 52); + c = Rotate (a, 37); + a += Fetch64 (s + len - 24); + c += Rotate (a, 7); + a += Fetch64 (s + len - 16); unt64 wf = a + z; - unt64 ws = b + Rotate(a, 31) + c; - unt64 r = ShiftMix((vf + ws) * k2 + (wf + vs) * k0); - return ShiftMix(r * k0 + vs) * k2; + unt64 ws = b + Rotate (a, 31) + c; + unt64 r = ShiftMix ((vf + ws) * k2 + (wf + vs) * k0); + return ShiftMix (r * k0 + vs) * k2; } -unt64 ob_city_hash64(const void *key, size_t len) { +unt64 ob_city_hash64 (const void *key, size_t len) +{ const char *s = (const char *) key; - if (len <= 32) { - if (len <= 16) { - return HashLen0to16(s, len); - } else { - return HashLen17to32(s, len); + if (len <= 32) + { + if (len <= 16) + { + return HashLen0to16 (s, len); + } + else + { + return HashLen17to32 (s, len); + } + } + else if (len <= 64) + { + return HashLen33to64 (s, len); } - } else if (len <= 64) { - return HashLen33to64(s, len); - } // For strings over 64 bytes we hash the end first, and then as we // loop we keep 56 bytes of state: v, w, x, y, and z. - unt64 x = Fetch64(s); - unt64 y = Fetch64(s + len - 16) ^ k1; - unt64 z = Fetch64(s + len - 56) ^ k0; - unt128 v = WeakHashLen32WithSeeds(s + len - 64, len, y); - unt128 w = WeakHashLen32WithSeeds(s + len - 32, len * k1, k0); - z += ShiftMix(v.second) * k1; - x = Rotate(z + x, 39) * k1; - y = Rotate(y, 33) * k1; + unt64 x = Fetch64 (s); + unt64 y = Fetch64 (s + len - 16) ^ k1; + unt64 z = Fetch64 (s + len - 56) ^ k0; + unt128 v = WeakHashLen32WithSeeds (s + len - 64, len, y); + unt128 w = WeakHashLen32WithSeeds (s + len - 32, len * k1, k0); + z += ShiftMix (v.second) * k1; + x = Rotate (z + x, 39) * k1; + y = Rotate (y, 33) * k1; // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks. len = (len - 1) & ~STATIC_CAST (size_t, 63); - do { - x = Rotate(x + y + v.first + Fetch64(s + 16), 37) * k1; - y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1; - x ^= w.second; - y ^= v.first; - z = Rotate(z ^ w.first, 33); - v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first); - w = WeakHashLen32WithSeeds(s + 32, z + w.second, y); - const unt64 tmp = z; - z = x; - x = tmp; - s += 64; - len -= 64; - } while (len != 0); - return HashLen16(HashLen16(v.first, w.first) + ShiftMix(y) * k1 + z, - HashLen16(v.second, w.second) + x); + do + { + x = Rotate (x + y + v.first + Fetch64 (s + 16), 37) * k1; + y = Rotate (y + v.second + Fetch64 (s + 48), 42) * k1; + x ^= w.second; + y ^= v.first; + z = Rotate (z ^ w.first, 33); + v = WeakHashLen32WithSeeds (s, v.second * k1, x + w.first); + w = WeakHashLen32WithSeeds (s + 32, z + w.second, y); + const unt64 tmp = z; + z = x; + x = tmp; + s += 64; + len -= 64; + } + while (len != 0); + return HashLen16 (HashLen16 (v.first, w.first) + ShiftMix (y) * k1 + z, + HashLen16 (v.second, w.second) + x); } diff --git a/libLoam/c/ob-hash-win32.c b/libLoam/c/ob-hash-win32.c index c4204075..fd409500 100644 --- a/libLoam/c/ob-hash-win32.c +++ b/libLoam/c/ob-hash-win32.c @@ -58,8 +58,9 @@ // possible hash functions, by using SIMD instructions, or by // compromising on hash quality. -unt64 __declspec(naked) ob_city_hash64 (const void *key, size_t len) -{ __asm { +unt64 __declspec (naked) ob_city_hash64 (const void *key, size_t len) +{ + __asm { push ebp push ebx push edi diff --git a/libLoam/c/ob-hash.c b/libLoam/c/ob-hash.c index 704dbd01..7d8c3172 100644 --- a/libLoam/c/ob-hash.c +++ b/libLoam/c/ob-hash.c @@ -72,9 +72,9 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy. ------------------------------------------------------------------------------- */ -#define hashsize(n) ((unt32)1<<(n)) -#define hashmask(n) (hashsize(n)-1) -#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) +#define hashsize(n) ((unt32) 1 << (n)) +#define hashmask(n) (hashsize (n) - 1) +#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k)))) /* ------------------------------------------------------------------------------- @@ -120,15 +120,27 @@ on, and rotates are much kinder to the top and bottom bits, so I used rotates. ------------------------------------------------------------------------------- */ -#define mix32(a,b,c) \ -{ \ - a -= c; a ^= rot(c, 4); c += b; \ - b -= a; b ^= rot(a, 6); a += c; \ - c -= b; c ^= rot(b, 8); b += a; \ - a -= c; a ^= rot(c,16); c += b; \ - b -= a; b ^= rot(a,19); a += c; \ - c -= b; c ^= rot(b, 4); b += a; \ -} +#define mix32(a, b, c) \ + { \ + a -= c; \ + a ^= rot (c, 4); \ + c += b; \ + b -= a; \ + b ^= rot (a, 6); \ + a += c; \ + c -= b; \ + c ^= rot (b, 8); \ + b += a; \ + a -= c; \ + a ^= rot (c, 16); \ + c += b; \ + b -= a; \ + b ^= rot (a, 19); \ + a += c; \ + c -= b; \ + c ^= rot (b, 4); \ + b += a; \ + } /* ------------------------------------------------------------------------------- @@ -155,16 +167,23 @@ and these came close: 11 8 15 26 3 22 24 ------------------------------------------------------------------------------- */ -#define final(a,b,c) \ -{ \ - c ^= b; c -= rot(b,14); \ - a ^= c; a -= rot(c,11); \ - b ^= a; b -= rot(a,25); \ - c ^= b; c -= rot(b,16); \ - a ^= c; a -= rot(c,4); \ - b ^= a; b -= rot(a,14); \ - c ^= b; c -= rot(b,24); \ -} +#define final(a, b, c) \ + { \ + c ^= b; \ + c -= rot (b, 14); \ + a ^= c; \ + a -= rot (c, 11); \ + b ^= a; \ + b -= rot (a, 25); \ + c ^= b; \ + c -= rot (b, 16); \ + a ^= c; \ + a -= rot (c, 4); \ + b ^= a; \ + b -= rot (a, 14); \ + c ^= b; \ + c -= rot (b, 24); \ + } /* ------------------------------------------------------------------------------- @@ -193,32 +212,37 @@ acceptable. Do NOT use for cryptographic purposes. ------------------------------------------------------------------------------- */ -unt32 ob_jenkins_hash( const void *key, size_t length, unt32 initval) +unt32 ob_jenkins_hash (const void *key, size_t length, unt32 initval) { - unt32 a,b,c; /* internal state */ - union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */ + unt32 a, b, c; /* internal state */ + union + { + const void *ptr; + size_t i; + } u; /* needed for Mac Powerbook G4 */ const bool vg = RUNNING_ON_VALGRIND; /* Set up the internal state */ - a = b = c = 0xdeadbeef + ((unt32)length) + initval; + a = b = c = 0xdeadbeef + ((unt32) length) + initval; u.ptr = key; - if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { - const unt32 *k = (const unt32 *)key; /* read 32-bit chunks */ - - /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ - while (length > 12) + if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { - a += k[0]; - b += k[1]; - c += k[2]; - mix32(a,b,c); - length -= 12; - k += 3; - } - - /*----------------------------- handle the last (probably partial) block */ - /* + const unt32 *k = (const unt32 *) key; /* read 32-bit chunks */ + + /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix32 (a, b, c); + length -= 12; + k += 3; + } + + /*----------------------------- handle the last (probably partial) block */ + /* * "k[2]&0xffffff" actually reads beyond the end of the string, but * then masks off the part it's not allowed to read. Because the * string is aligned, the masked-off tail is in the same word as the @@ -227,152 +251,234 @@ unt32 ob_jenkins_hash( const void *key, size_t length, unt32 initval) * still catch it and complain. The masking trick does make the hash * noticably faster for short strings (like English words). */ - if (! vg) - { - - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; - case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; - case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=k[1]&0xffffff; a+=k[0]; break; - case 6 : b+=k[1]&0xffff; a+=k[0]; break; - case 5 : b+=k[1]&0xff; a+=k[0]; break; - case 4 : a+=k[0]; break; - case 3 : a+=k[0]&0xffffff; break; - case 2 : a+=k[0]&0xffff; break; - case 1 : a+=k[0]&0xff; break; - case 0 : return c; /* zero length strings require no mixing */ - } - - } - else /* make valgrind happy */ - { - - const unt8 *k8 = (const unt8 *)k; - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((unt32)k8[10])<<16; /* fall through */ - case 10: c+=((unt32)k8[9])<<8; /* fall through */ - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((unt32)k8[6])<<16; /* fall through */ - case 6 : b+=((unt32)k8[5])<<8; /* fall through */ - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]; break; - case 3 : a+=((unt32)k8[2])<<16; /* fall through */ - case 2 : a+=((unt32)k8[1])<<8; /* fall through */ - case 1 : a+=k8[0]; break; - case 0 : return c; + if (!vg) + { + switch (length) + { + case 12: + c += k[2]; + b += k[1]; + a += k[0]; + break; + case 11: + c += k[2] & 0xffffff; + b += k[1]; + a += k[0]; + break; + case 10: + c += k[2] & 0xffff; + b += k[1]; + a += k[0]; + break; + case 9: + c += k[2] & 0xff; + b += k[1]; + a += k[0]; + break; + case 8: + b += k[1]; + a += k[0]; + break; + case 7: + b += k[1] & 0xffffff; + a += k[0]; + break; + case 6: + b += k[1] & 0xffff; + a += k[0]; + break; + case 5: + b += k[1] & 0xff; + a += k[0]; + break; + case 4: + a += k[0]; + break; + case 3: + a += k[0] & 0xffffff; + break; + case 2: + a += k[0] & 0xffff; + break; + case 1: + a += k[0] & 0xff; + break; + case 0: + return c; /* zero length strings require no mixing */ + } + } + else /* make valgrind happy */ + { + const unt8 *k8 = (const unt8 *) k; + switch (length) + { + case 12: + c += k[2]; + b += k[1]; + a += k[0]; + break; + case 11: + c += ((unt32) k8[10]) << 16; /* fall through */ + case 10: + c += ((unt32) k8[9]) << 8; /* fall through */ + case 9: + c += k8[8]; /* fall through */ + case 8: + b += k[1]; + a += k[0]; + break; + case 7: + b += ((unt32) k8[6]) << 16; /* fall through */ + case 6: + b += ((unt32) k8[5]) << 8; /* fall through */ + case 5: + b += k8[4]; /* fall through */ + case 4: + a += k[0]; + break; + case 3: + a += ((unt32) k8[2]) << 16; /* fall through */ + case 2: + a += ((unt32) k8[1]) << 8; /* fall through */ + case 1: + a += k8[0]; + break; + case 0: + return c; + } + + } /* !valgrind */ } - - } /* !valgrind */ - - } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - const unt16 *k = (const unt16 *)key; /* read 16-bit chunks */ - const unt8 *k8; - - /*--------------- all but last block: aligned reads and different mixing */ - while (length > 12) + else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - a += k[0] + (((unt32)k[1])<<16); - b += k[2] + (((unt32)k[3])<<16); - c += k[4] + (((unt32)k[5])<<16); - mix32(a,b,c); - length -= 12; - k += 6; + const unt16 *k = (const unt16 *) key; /* read 16-bit chunks */ + const unt8 *k8; + + /*--------------- all but last block: aligned reads and different mixing */ + while (length > 12) + { + a += k[0] + (((unt32) k[1]) << 16); + b += k[2] + (((unt32) k[3]) << 16); + c += k[4] + (((unt32) k[5]) << 16); + mix32 (a, b, c); + length -= 12; + k += 6; + } + + /*----------------------------- handle the last (probably partial) block */ + k8 = (const unt8 *) k; + switch (length) + { + case 12: + c += k[4] + (((unt32) k[5]) << 16); + b += k[2] + (((unt32) k[3]) << 16); + a += k[0] + (((unt32) k[1]) << 16); + break; + case 11: + c += ((unt32) k8[10]) << 16; /* fall through */ + case 10: + c += k[4]; + b += k[2] + (((unt32) k[3]) << 16); + a += k[0] + (((unt32) k[1]) << 16); + break; + case 9: + c += k8[8]; /* fall through */ + case 8: + b += k[2] + (((unt32) k[3]) << 16); + a += k[0] + (((unt32) k[1]) << 16); + break; + case 7: + b += ((unt32) k8[6]) << 16; /* fall through */ + case 6: + b += k[2]; + a += k[0] + (((unt32) k[1]) << 16); + break; + case 5: + b += k8[4]; /* fall through */ + case 4: + a += k[0] + (((unt32) k[1]) << 16); + break; + case 3: + a += ((unt32) k8[2]) << 16; /* fall through */ + case 2: + a += k[0]; + break; + case 1: + a += k8[0]; + break; + case 0: + return c; /* zero length requires no mixing */ + } } - - /*----------------------------- handle the last (probably partial) block */ - k8 = (const unt8 *)k; - switch(length) - { - case 12: c+=k[4]+(((unt32)k[5])<<16); - b+=k[2]+(((unt32)k[3])<<16); - a+=k[0]+(((unt32)k[1])<<16); - break; - case 11: c+=((unt32)k8[10])<<16; /* fall through */ - case 10: c+=k[4]; - b+=k[2]+(((unt32)k[3])<<16); - a+=k[0]+(((unt32)k[1])<<16); - break; - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[2]+(((unt32)k[3])<<16); - a+=k[0]+(((unt32)k[1])<<16); - break; - case 7 : b+=((unt32)k8[6])<<16; /* fall through */ - case 6 : b+=k[2]; - a+=k[0]+(((unt32)k[1])<<16); - break; - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]+(((unt32)k[1])<<16); - break; - case 3 : a+=((unt32)k8[2])<<16; /* fall through */ - case 2 : a+=k[0]; - break; - case 1 : a+=k8[0]; - break; - case 0 : return c; /* zero length requires no mixing */ + else + { /* need to read the key one byte at a time */ + const unt8 *k = (const unt8 *) key; + + /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + a += ((unt32) k[1]) << 8; + a += ((unt32) k[2]) << 16; + a += ((unt32) k[3]) << 24; + b += k[4]; + b += ((unt32) k[5]) << 8; + b += ((unt32) k[6]) << 16; + b += ((unt32) k[7]) << 24; + c += k[8]; + c += ((unt32) k[9]) << 8; + c += ((unt32) k[10]) << 16; + c += ((unt32) k[11]) << 24; + mix32 (a, b, c); + length -= 12; + k += 12; + } + + /*-------------------------------- last block: affect all 32 bits of (c) */ + switch (length) /* all the case statements fall through */ + { + case 12: + c += ((unt32) k[11]) << 24; + // fallthru (for Coverity; e. g. bug 1509) + case 11: + c += ((unt32) k[10]) << 16; + // fallthru (for Coverity; e. g. bug 1509) + case 10: + c += ((unt32) k[9]) << 8; + // fallthru (for Coverity; e. g. bug 1509) + case 9: + c += k[8]; + // fallthru (for Coverity; e. g. bug 1509) + case 8: + b += ((unt32) k[7]) << 24; + // fallthru (for Coverity; e. g. bug 1509) + case 7: + b += ((unt32) k[6]) << 16; + // fallthru (for Coverity; e. g. bug 1509) + case 6: + b += ((unt32) k[5]) << 8; + // fallthru (for Coverity; e. g. bug 1509) + case 5: + b += k[4]; + // fallthru (for Coverity; e. g. bug 1509) + case 4: + a += ((unt32) k[3]) << 24; + // fallthru (for Coverity; e. g. bug 1509) + case 3: + a += ((unt32) k[2]) << 16; + // fallthru (for Coverity; e. g. bug 1509) + case 2: + a += ((unt32) k[1]) << 8; + // fallthru (for Coverity; e. g. bug 1509) + case 1: + a += k[0]; + break; + case 0: + return c; + } } - } else { /* need to read the key one byte at a time */ - const unt8 *k = (const unt8 *)key; - - /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ - while (length > 12) - { - a += k[0]; - a += ((unt32)k[1])<<8; - a += ((unt32)k[2])<<16; - a += ((unt32)k[3])<<24; - b += k[4]; - b += ((unt32)k[5])<<8; - b += ((unt32)k[6])<<16; - b += ((unt32)k[7])<<24; - c += k[8]; - c += ((unt32)k[9])<<8; - c += ((unt32)k[10])<<16; - c += ((unt32)k[11])<<24; - mix32(a,b,c); - length -= 12; - k += 12; - } - - /*-------------------------------- last block: affect all 32 bits of (c) */ - switch(length) /* all the case statements fall through */ - { - case 12: c+=((unt32)k[11])<<24; - // fallthru (for Coverity; e. g. bug 1509) - case 11: c+=((unt32)k[10])<<16; - // fallthru (for Coverity; e. g. bug 1509) - case 10: c+=((unt32)k[9])<<8; - // fallthru (for Coverity; e. g. bug 1509) - case 9 : c+=k[8]; - // fallthru (for Coverity; e. g. bug 1509) - case 8 : b+=((unt32)k[7])<<24; - // fallthru (for Coverity; e. g. bug 1509) - case 7 : b+=((unt32)k[6])<<16; - // fallthru (for Coverity; e. g. bug 1509) - case 6 : b+=((unt32)k[5])<<8; - // fallthru (for Coverity; e. g. bug 1509) - case 5 : b+=k[4]; - // fallthru (for Coverity; e. g. bug 1509) - case 4 : a+=((unt32)k[3])<<24; - // fallthru (for Coverity; e. g. bug 1509) - case 3 : a+=((unt32)k[2])<<16; - // fallthru (for Coverity; e. g. bug 1509) - case 2 : a+=((unt32)k[1])<<8; - // fallthru (for Coverity; e. g. bug 1509) - case 1 : a+=k[0]; - break; - case 0 : return c; - } - } - - final(a,b,c); + final (a, b, c); return c; } @@ -387,37 +493,42 @@ unt32 ob_jenkins_hash( const void *key, size_t length, unt32 initval) * the key. *pc is better mixed than *pb, so use *pc first. If you want * a 64-bit value do something like "*pc + (((uint64_t)*pb)<<32)". */ -void ob_jenkins_hash2( - const void *key, /* the key to hash */ - size_t length, /* length of the key */ - unt32 *pc, /* IN: primary initval, OUT: primary hash */ - unt32 *pb) /* IN: secondary initval, OUT: secondary hash */ +void ob_jenkins_hash2 ( + const void *key, /* the key to hash */ + size_t length, /* length of the key */ + unt32 *pc, /* IN: primary initval, OUT: primary hash */ + unt32 *pb) /* IN: secondary initval, OUT: secondary hash */ { - unt32 a,b,c; /* internal state */ - union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */ + unt32 a, b, c; /* internal state */ + union + { + const void *ptr; + size_t i; + } u; /* needed for Mac Powerbook G4 */ const bool vg = RUNNING_ON_VALGRIND; /* Set up the internal state */ - a = b = c = 0xdeadbeef + ((unt32)length) + *pc; + a = b = c = 0xdeadbeef + ((unt32) length) + *pc; c += *pb; u.ptr = key; - if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { - const unt32 *k = (const unt32 *)key; /* read 32-bit chunks */ - - /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ - while (length > 12) + if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { - a += k[0]; - b += k[1]; - c += k[2]; - mix32(a,b,c); - length -= 12; - k += 3; - } - - /*----------------------------- handle the last (probably partial) block */ - /* + const unt32 *k = (const unt32 *) key; /* read 32-bit chunks */ + + /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix32 (a, b, c); + length -= 12; + k += 3; + } + + /*----------------------------- handle the last (probably partial) block */ + /* * "k[2]&0xffffff" actually reads beyond the end of the string, but * then masks off the part it's not allowed to read. Because the * string is aligned, the masked-off tail is in the same word as the @@ -426,153 +537,244 @@ void ob_jenkins_hash2( * still catch it and complain. The masking trick does make the hash * noticably faster for short strings (like English words). */ - if (! vg) - { - - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; - case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; - case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=k[1]&0xffffff; a+=k[0]; break; - case 6 : b+=k[1]&0xffff; a+=k[0]; break; - case 5 : b+=k[1]&0xff; a+=k[0]; break; - case 4 : a+=k[0]; break; - case 3 : a+=k[0]&0xffffff; break; - case 2 : a+=k[0]&0xffff; break; - case 1 : a+=k[0]&0xff; break; - case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ + if (!vg) + { + switch (length) + { + case 12: + c += k[2]; + b += k[1]; + a += k[0]; + break; + case 11: + c += k[2] & 0xffffff; + b += k[1]; + a += k[0]; + break; + case 10: + c += k[2] & 0xffff; + b += k[1]; + a += k[0]; + break; + case 9: + c += k[2] & 0xff; + b += k[1]; + a += k[0]; + break; + case 8: + b += k[1]; + a += k[0]; + break; + case 7: + b += k[1] & 0xffffff; + a += k[0]; + break; + case 6: + b += k[1] & 0xffff; + a += k[0]; + break; + case 5: + b += k[1] & 0xff; + a += k[0]; + break; + case 4: + a += k[0]; + break; + case 3: + a += k[0] & 0xffffff; + break; + case 2: + a += k[0] & 0xffff; + break; + case 1: + a += k[0] & 0xff; + break; + case 0: + *pc = c; + *pb = b; + return; /* zero length strings require no mixing */ + } + } + else /* make valgrind happy */ + { + const unt8 *k8 = (const unt8 *) k; + switch (length) + { + case 12: + c += k[2]; + b += k[1]; + a += k[0]; + break; + case 11: + c += ((unt32) k8[10]) << 16; /* fall through */ + case 10: + c += ((unt32) k8[9]) << 8; /* fall through */ + case 9: + c += k8[8]; /* fall through */ + case 8: + b += k[1]; + a += k[0]; + break; + case 7: + b += ((unt32) k8[6]) << 16; /* fall through */ + case 6: + b += ((unt32) k8[5]) << 8; /* fall through */ + case 5: + b += k8[4]; /* fall through */ + case 4: + a += k[0]; + break; + case 3: + a += ((unt32) k8[2]) << 16; /* fall through */ + case 2: + a += ((unt32) k8[1]) << 8; /* fall through */ + case 1: + a += k8[0]; + break; + case 0: + *pc = c; + *pb = b; + return; /* zero length strings require no mixing */ + } + + } /* !valgrind */ } - - } - else /* make valgrind happy */ - { - - const unt8 *k8 = (const unt8 *)k; - switch(length) + else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((unt32)k8[10])<<16; /* fall through */ - case 10: c+=((unt32)k8[9])<<8; /* fall through */ - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((unt32)k8[6])<<16; /* fall through */ - case 6 : b+=((unt32)k8[5])<<8; /* fall through */ - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]; break; - case 3 : a+=((unt32)k8[2])<<16; /* fall through */ - case 2 : a+=((unt32)k8[1])<<8; /* fall through */ - case 1 : a+=k8[0]; break; - case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ + const unt16 *k = (const unt16 *) key; /* read 16-bit chunks */ + const unt8 *k8; + + /*--------------- all but last block: aligned reads and different mixing */ + while (length > 12) + { + a += k[0] + (((unt32) k[1]) << 16); + b += k[2] + (((unt32) k[3]) << 16); + c += k[4] + (((unt32) k[5]) << 16); + mix32 (a, b, c); + length -= 12; + k += 6; + } + + /*----------------------------- handle the last (probably partial) block */ + k8 = (const unt8 *) k; + switch (length) + { + case 12: + c += k[4] + (((unt32) k[5]) << 16); + b += k[2] + (((unt32) k[3]) << 16); + a += k[0] + (((unt32) k[1]) << 16); + break; + case 11: + c += ((unt32) k8[10]) << 16; /* fall through */ + case 10: + c += k[4]; + b += k[2] + (((unt32) k[3]) << 16); + a += k[0] + (((unt32) k[1]) << 16); + break; + case 9: + c += k8[8]; /* fall through */ + case 8: + b += k[2] + (((unt32) k[3]) << 16); + a += k[0] + (((unt32) k[1]) << 16); + break; + case 7: + b += ((unt32) k8[6]) << 16; /* fall through */ + case 6: + b += k[2]; + a += k[0] + (((unt32) k[1]) << 16); + break; + case 5: + b += k8[4]; /* fall through */ + case 4: + a += k[0] + (((unt32) k[1]) << 16); + break; + case 3: + a += ((unt32) k8[2]) << 16; /* fall through */ + case 2: + a += k[0]; + break; + case 1: + a += k8[0]; + break; + case 0: + *pc = c; + *pb = b; + return; /* zero length strings require no mixing */ + } } - - } /* !valgrind */ - - } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - const unt16 *k = (const unt16 *)key; /* read 16-bit chunks */ - const unt8 *k8; - - /*--------------- all but last block: aligned reads and different mixing */ - while (length > 12) - { - a += k[0] + (((unt32)k[1])<<16); - b += k[2] + (((unt32)k[3])<<16); - c += k[4] + (((unt32)k[5])<<16); - mix32(a,b,c); - length -= 12; - k += 6; + else + { /* need to read the key one byte at a time */ + const unt8 *k = (const unt8 *) key; + + /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + a += ((unt32) k[1]) << 8; + a += ((unt32) k[2]) << 16; + a += ((unt32) k[3]) << 24; + b += k[4]; + b += ((unt32) k[5]) << 8; + b += ((unt32) k[6]) << 16; + b += ((unt32) k[7]) << 24; + c += k[8]; + c += ((unt32) k[9]) << 8; + c += ((unt32) k[10]) << 16; + c += ((unt32) k[11]) << 24; + mix32 (a, b, c); + length -= 12; + k += 12; + } + + /*-------------------------------- last block: affect all 32 bits of (c) */ + switch (length) /* all the case statements fall through */ + { + case 12: + c += ((unt32) k[11]) << 24; + // fallthru (for Coverity; e. g. bug 1509) + case 11: + c += ((unt32) k[10]) << 16; + // fallthru (for Coverity; e. g. bug 1509) + case 10: + c += ((unt32) k[9]) << 8; + // fallthru (for Coverity; e. g. bug 1509) + case 9: + c += k[8]; + // fallthru (for Coverity; e. g. bug 1509) + case 8: + b += ((unt32) k[7]) << 24; + // fallthru (for Coverity; e. g. bug 1509) + case 7: + b += ((unt32) k[6]) << 16; + // fallthru (for Coverity; e. g. bug 1509) + case 6: + b += ((unt32) k[5]) << 8; + // fallthru (for Coverity; e. g. bug 1509) + case 5: + b += k[4]; + // fallthru (for Coverity; e. g. bug 1509) + case 4: + a += ((unt32) k[3]) << 24; + // fallthru (for Coverity; e. g. bug 1509) + case 3: + a += ((unt32) k[2]) << 16; + // fallthru (for Coverity; e. g. bug 1509) + case 2: + a += ((unt32) k[1]) << 8; + // fallthru (for Coverity; e. g. bug 1509) + case 1: + a += k[0]; + break; + case 0: + *pc = c; + *pb = b; + return; /* zero length strings require no mixing */ + } } - /*----------------------------- handle the last (probably partial) block */ - k8 = (const unt8 *)k; - switch(length) - { - case 12: c+=k[4]+(((unt32)k[5])<<16); - b+=k[2]+(((unt32)k[3])<<16); - a+=k[0]+(((unt32)k[1])<<16); - break; - case 11: c+=((unt32)k8[10])<<16; /* fall through */ - case 10: c+=k[4]; - b+=k[2]+(((unt32)k[3])<<16); - a+=k[0]+(((unt32)k[1])<<16); - break; - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[2]+(((unt32)k[3])<<16); - a+=k[0]+(((unt32)k[1])<<16); - break; - case 7 : b+=((unt32)k8[6])<<16; /* fall through */ - case 6 : b+=k[2]; - a+=k[0]+(((unt32)k[1])<<16); - break; - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]+(((unt32)k[1])<<16); - break; - case 3 : a+=((unt32)k8[2])<<16; /* fall through */ - case 2 : a+=k[0]; - break; - case 1 : a+=k8[0]; - break; - case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ - } - - } else { /* need to read the key one byte at a time */ - const unt8 *k = (const unt8 *)key; - - /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ - while (length > 12) - { - a += k[0]; - a += ((unt32)k[1])<<8; - a += ((unt32)k[2])<<16; - a += ((unt32)k[3])<<24; - b += k[4]; - b += ((unt32)k[5])<<8; - b += ((unt32)k[6])<<16; - b += ((unt32)k[7])<<24; - c += k[8]; - c += ((unt32)k[9])<<8; - c += ((unt32)k[10])<<16; - c += ((unt32)k[11])<<24; - mix32(a,b,c); - length -= 12; - k += 12; - } - - /*-------------------------------- last block: affect all 32 bits of (c) */ - switch(length) /* all the case statements fall through */ - { - case 12: c+=((unt32)k[11])<<24; - // fallthru (for Coverity; e. g. bug 1509) - case 11: c+=((unt32)k[10])<<16; - // fallthru (for Coverity; e. g. bug 1509) - case 10: c+=((unt32)k[9])<<8; - // fallthru (for Coverity; e. g. bug 1509) - case 9 : c+=k[8]; - // fallthru (for Coverity; e. g. bug 1509) - case 8 : b+=((unt32)k[7])<<24; - // fallthru (for Coverity; e. g. bug 1509) - case 7 : b+=((unt32)k[6])<<16; - // fallthru (for Coverity; e. g. bug 1509) - case 6 : b+=((unt32)k[5])<<8; - // fallthru (for Coverity; e. g. bug 1509) - case 5 : b+=k[4]; - // fallthru (for Coverity; e. g. bug 1509) - case 4 : a+=((unt32)k[3])<<24; - // fallthru (for Coverity; e. g. bug 1509) - case 3 : a+=((unt32)k[2])<<16; - // fallthru (for Coverity; e. g. bug 1509) - case 2 : a+=((unt32)k[1])<<8; - // fallthru (for Coverity; e. g. bug 1509) - case 1 : a+=k[0]; - break; - case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ - } - } - - final(a,b,c); - *pc=c; *pb=b; + final (a, b, c); + *pc = c; + *pb = b; } /* HashLen16() is inlined and comes from ob-hash-common.h. @@ -581,7 +783,8 @@ void ob_jenkins_hash2( * separate file) */ -unt64 ob_city_hash64_with_seeds(const void *s, size_t len, - unt64 seed0, unt64 seed1) { - return HashLen16(ob_city_hash64(s, len) - seed0, seed1); +unt64 ob_city_hash64_with_seeds (const void *s, size_t len, unt64 seed0, + unt64 seed1) +{ + return HashLen16 (ob_city_hash64 (s, len) - seed0, seed1); } diff --git a/libLoam/c/ob-log.c b/libLoam/c/ob-log.c index bf36a4a1..ec0b2b7f 100644 --- a/libLoam/c/ob-log.c +++ b/libLoam/c/ob-log.c @@ -409,7 +409,7 @@ static void process_word (ob_log_level **levp, const char *word) maxcount = strtoll (p, &endp, 10); if (*endp) { - bad: +bad: OB_LOG_ERROR_CODE (0x10060002, "unrecognized '%s'; try OB_LOG=help\n", word); } @@ -565,7 +565,12 @@ static ob_log_rule *ob_log_find_rule (ob_log_level *lvl, unt64 code) return rul; } -typedef enum should_print_t { PRINT_NO, PRINT_YES, PRINT_FINAL } should_print_t; +typedef enum should_print_t +{ + PRINT_NO, + PRINT_YES, + PRINT_FINAL +} should_print_t; static void masked_format (char buf[17], unt64 code, unt8 matchbits) { @@ -966,64 +971,73 @@ static ob_log_rule deprecation_dont_limit_code_zero = { NULL // uniques }; -ob_log_level oblv_bug = {OB_DST_FD | OB_DST_VALGRIND | OB_FLG_STACK_TRACE - | OB_FLG_SHOW_CODE_OR_WHERE - | OB_FLG_SHOW_TID_NONMAIN, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED - | OB_FOREGROUND_BLUE, /* magenta */ - LOG_ERR, - 2, "programming error: ", NULL, NULL, NULL, NULL}; - -ob_log_level oblv_error = - {OB_DST_FD | OB_FLG_SHOW_CODE_OR_WHERE | OB_FLG_SHOW_TID_NONMAIN, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED, /* red */ - LOG_ERR, - 2, - "error: ", - NULL, - NULL, - NULL, - NULL}; - -ob_log_level oblv_deprecation = - {OB_DST_FD | OB_DST_VALGRIND | OB_FLG_STACK_TRACE | OB_FLG_SHOW_CODE_OR_WHERE - | OB_FLG_SHOW_TID_NONMAIN, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_GREEN | OB_FOREGROUND_BLUE, /* cyan */ - LOG_WARNING, 2, "deprecation: ", NULL, NULL, - &deprecation_dont_limit_code_zero, NULL}; - -ob_log_level oblv_wrnu = - {OB_DST_FD | OB_FLG_SHOW_CODE_OR_WHERE | OB_FLG_SHOW_TID_NONMAIN, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED | OB_FOREGROUND_GREEN, /* yellow */ - LOG_WARNING, - 2, - "warning: ", - NULL, - NULL, - NULL, - NULL}; - -ob_log_level oblv_info = - {OB_DST_FD | OB_FLG_SHOW_CODE_OR_WHERE | OB_FLG_SHOW_TID_NONMAIN, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_BLUE, /* blue */ - LOG_INFO, - 2, - "info: ", - NULL, - NULL, - NULL, - NULL}; - -ob_log_level oblv_dbug = - {OB_FLG_SHOW_CODE_OR_WHERE | OB_FLG_SHOW_TID_NONMAIN, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_GREEN, /* green */ - LOG_DEBUG, - 2, - "dbg: ", - NULL, - NULL, - NULL, - NULL}; +ob_log_level oblv_bug = { + OB_DST_FD | OB_DST_VALGRIND | OB_FLG_STACK_TRACE | OB_FLG_SHOW_CODE_OR_WHERE + | OB_FLG_SHOW_TID_NONMAIN, + OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED | OB_FOREGROUND_BLUE, /* magenta */ + LOG_ERR, + 2, + "programming error: ", + NULL, + NULL, + NULL, + NULL}; + +ob_log_level oblv_error = {OB_DST_FD | OB_FLG_SHOW_CODE_OR_WHERE + | OB_FLG_SHOW_TID_NONMAIN, + OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED, /* red */ + LOG_ERR, + 2, + "error: ", + NULL, + NULL, + NULL, + NULL}; + +ob_log_level oblv_deprecation = { + OB_DST_FD | OB_DST_VALGRIND | OB_FLG_STACK_TRACE | OB_FLG_SHOW_CODE_OR_WHERE + | OB_FLG_SHOW_TID_NONMAIN, + OB_FOREGROUND_ENABLE | OB_FOREGROUND_GREEN | OB_FOREGROUND_BLUE, /* cyan */ + LOG_WARNING, + 2, + "deprecation: ", + NULL, + NULL, + &deprecation_dont_limit_code_zero, + NULL}; + +ob_log_level oblv_wrnu = { + OB_DST_FD | OB_FLG_SHOW_CODE_OR_WHERE | OB_FLG_SHOW_TID_NONMAIN, + OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED | OB_FOREGROUND_GREEN, /* yellow */ + LOG_WARNING, + 2, + "warning: ", + NULL, + NULL, + NULL, + NULL}; + +ob_log_level oblv_info = {OB_DST_FD | OB_FLG_SHOW_CODE_OR_WHERE + | OB_FLG_SHOW_TID_NONMAIN, + OB_FOREGROUND_ENABLE | OB_FOREGROUND_BLUE, /* blue */ + LOG_INFO, + 2, + "info: ", + NULL, + NULL, + NULL, + NULL}; + +ob_log_level oblv_dbug = {OB_FLG_SHOW_CODE_OR_WHERE | OB_FLG_SHOW_TID_NONMAIN, + OB_FOREGROUND_ENABLE + | OB_FOREGROUND_GREEN, /* green */ + LOG_DEBUG, + 2, + "dbg: ", + NULL, + NULL, + NULL, + NULL}; typedef struct time_cache { @@ -1059,9 +1073,9 @@ void ob_log_loc_v (const char *file, int lineno, ob_log_level *lvl, unt64 code, if (PRINT_FINAL == sp) { - int vasret = asprintf (&msg, "rule %s reached maximum count %" OB_FMT_64 - "d; suppressing\n", - supcode, maxed_out); + int vasret = asprintf ( + &msg, "rule %s reached maximum count %" OB_FMT_64 "d; suppressing\n", + supcode, maxed_out); if (vasret >= 0) { ob_log_internal (flags, &now, 1, 1, file, lineno, lvl, code, msg); @@ -1250,7 +1264,7 @@ static void ob_log_internal (int32 flags, time_cache *now, int64 nline, if (docolor) cap += strlen (colorbuf) + 4; - const char * final = NULL; + const char *final = NULL; char *line = NULL; // need to overwrite newline if using syslog; must copy in that case if (0 == cap && 0 == (flags & OB_DST_SYSLOG)) @@ -1296,17 +1310,17 @@ static void ob_log_internal (int32 flags, time_cache *now, int64 nline, final = line; } -// On UNIX, we put everything (including the ANSI color codes) -// together in a single string, and output it with a single -// call to write(), so as long as it's shorter than PIPE_BUF, -// we're guaranteed by POSIX that it will be atomic. (Which means -// really long messages, like the "Ctenophore turd" message, -// might interleave, but most reasonable messages will not, -// since PIPE_BUF appears to be 512 on OS X and 4096 on Linux.) -// On Windows, we still put everything in one string, but the -// color changing has to be done with separate API calls, so there's -// a risk of interleaving between threads. To avoid that possibility, -// we use a critical section on Windows. + // On UNIX, we put everything (including the ANSI color codes) + // together in a single string, and output it with a single + // call to write(), so as long as it's shorter than PIPE_BUF, + // we're guaranteed by POSIX that it will be atomic. (Which means + // really long messages, like the "Ctenophore turd" message, + // might interleave, but most reasonable messages will not, + // since PIPE_BUF appears to be 512 on OS X and 4096 on Linux.) + // On Windows, we still put everything in one string, but the + // color changing has to be done with separate API calls, so there's + // a risk of interleaving between threads. To avoid that possibility, + // we use a critical section on Windows. #ifdef _MSC_VER if (needlocking) @@ -1505,8 +1519,9 @@ static void summarize_suppressions (const ob_log_rule *rul, ob_log_level *dst) char buf[17]; masked_format (buf, rul->code, rul->matchbits); - ob_log (dst, 0, "rule %s matched %" OB_FMT_64 - "d times; suppressed after %" OB_FMT_64 "d\n", + ob_log (dst, 0, + "rule %s matched %" OB_FMT_64 + "d times; suppressed after %" OB_FMT_64 "d\n", buf, count, maxcount); } const ob_log_rule *uni = ob_atomic_pointer_ref (&rul->uniques); @@ -1515,16 +1530,16 @@ static void summarize_suppressions (const ob_log_rule *rul, ob_log_level *dst) } } -static ob_log_level oblv_supp = - {OB_DST_FD | OB_FLG_SHOW_PROG | OB_FLG_SHOW_PID, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_GREEN, /* green */ - LOG_INFO, - 2, - "", - NULL, - NULL, - NULL, - NULL}; +static ob_log_level oblv_supp = {OB_DST_FD | OB_FLG_SHOW_PROG | OB_FLG_SHOW_PID, + OB_FOREGROUND_ENABLE + | OB_FOREGROUND_GREEN, /* green */ + LOG_INFO, + 2, + "", + NULL, + NULL, + NULL, + NULL}; /// This implements bug 767 static void ob_log_bye (void) diff --git a/libLoam/c/ob-rand.c b/libLoam/c/ob-rand.c index fdd3991c..46294c79 100644 --- a/libLoam/c/ob-rand.c +++ b/libLoam/c/ob-rand.c @@ -38,16 +38,16 @@ ob_rand_t *ob_rand_allocate_state (int32 seedval) ob_retort tort = OB_NO_MEM; ob_rand_t *ret = NULL; -// The posix_memalign call is not available on Mac. But, we can use -// the Mac's plain malloc instead, since it is guaranteed to be -// aligned for any type including SSE-related types. + // The posix_memalign call is not available on Mac. But, we can use + // the Mac's plain malloc instead, since it is guaranteed to be + // aligned for any type including SSE-related types. -/* And on Windows, we use VirtualAlloc(), which will give us + /* And on Windows, we use VirtualAlloc(), which will give us page-aligned memory, which will be more than enough alignment! (It's a bit wasteful, but since there will only be a few of these allocated in the whole program, it doesn't matter.) */ -/* It is unclear whether posix_memalign will zero its pseudo-return + /* It is unclear whether posix_memalign will zero its pseudo-return value (ob_global_rand_state) on error, so we do it below. Plus, this has the advantage of showing the compiler that we are at least paying some attention to the return value (err), which is @@ -129,8 +129,9 @@ static ob_seed_t completely_random_seed (void) seed.fallback.p = getpid (); seed.fallback.c = ob_atomic_int32_add (&counter, 1); if (seed.fallback.c == 1) - OB_LOG_WARNING_CODE (0x10050000, "Using suboptimal entropy source\n" - "because '%s'\n", + OB_LOG_WARNING_CODE (0x10050000, + "Using suboptimal entropy source\n" + "because '%s'\n", ob_error_string (tort)); } return seed; @@ -172,8 +173,9 @@ int32 ob_rand_state_int32 (int32 low, int32 high, ob_rand_t *rand_state) // TODO what should happen if high <= low? assert (high > low); - v = (float64) low + (((float64) ((int64) high - (int64) low)) - * dsfmt_genrand_close_open (rand_state)); + v = (float64) low + + (((float64) ((int64) high - (int64) low)) + * dsfmt_genrand_close_open (rand_state)); // TODO prefer a faster method for negative case; problem: the // contract is low <= x < high, but an int cast truncates (moves diff --git a/libLoam/c/ob-retorts.c b/libLoam/c/ob-retorts.c index 983f3483..d604ba5f 100644 --- a/libLoam/c/ob-retorts.c +++ b/libLoam/c/ob-retorts.c @@ -87,9 +87,9 @@ const char *ob_error_string_literal (ob_retort err) default: // See if this was an errno wrapped in a retort e = ob_retort_to_errno (err); - const char *s = strerror(e); - if (s) - return s; + const char *s = strerror (e); + if (s) + return s; // if (e > 0 && e < NERR) // { // const char *s = ERRLIST[e]; @@ -134,6 +134,4 @@ bool ob_retort_exists (ob_retort ret) return (NULL != ob_error_string_literal (ret)); } -void ob_ignore_retort (OB_UNUSED ob_retort ret) -{ -} +void ob_ignore_retort (OB_UNUSED ob_retort ret) {} diff --git a/libLoam/c/ob-time.c b/libLoam/c/ob-time.c index afeb37e0..7521aacd 100644 --- a/libLoam/c/ob-time.c +++ b/libLoam/c/ob-time.c @@ -177,8 +177,9 @@ static unt64 windows_nanos (void) if (!QueryPerformanceCounter (&large)) { ob_retort tort = ob_win32err_to_retort (GetLastError ()); - OB_FATAL_ERROR_CODE (0x10070003, "QueryPerformanceCounter failed:\n" - "%s\n", + OB_FATAL_ERROR_CODE (0x10070003, + "QueryPerformanceCounter failed:\n" + "%s\n", ob_error_string (tort)); } unt64 diff = large.QuadPart - qpc_previous.QuadPart; @@ -210,9 +211,8 @@ unt64 ob_monotonic_time (void) kern_return_t kr = mach_timebase_info (&mtidt); if (kr != KERN_SUCCESS) // Treating this error so harshly because it shouldn't ever happen. - OB_FATAL_ERROR_CODE (0x10070001, - "mach_timebase_info returned %" OB_FMT_64 "d\n", - (int64) kr); + OB_FATAL_ERROR_CODE ( + 0x10070001, "mach_timebase_info returned %" OB_FMT_64 "d\n", (int64) kr); nanos = (now * mtidt.numer) / mtidt.denom; #else struct timespec ts; diff --git a/libLoam/c/ob-truly-rand.c b/libLoam/c/ob-truly-rand.c index 736031c7..252000c7 100644 --- a/libLoam/c/ob-truly-rand.c +++ b/libLoam/c/ob-truly-rand.c @@ -61,7 +61,8 @@ static ob_retort update_reseed_time (void); -typedef enum { +typedef enum +{ RAND_NEED_INITIALIZATION = 0, RAND_NEED_RESEED, RAND_DOING_FINE diff --git a/libLoam/c/ob-util.c b/libLoam/c/ob-util.c index ae6b75ae..f10d1ae7 100644 --- a/libLoam/c/ob-util.c +++ b/libLoam/c/ob-util.c @@ -201,13 +201,9 @@ ob_retort ob_gid_from_name (const char *name, int *gid) #endif } -void ob_nop (void) -{ -} +void ob_nop (void) {} -void ob_ignore (OB_UNUSED int64 foo, ...) -{ -} +void ob_ignore (OB_UNUSED int64 foo, ...) {} #if defined(__gnu_linux__) #include @@ -414,9 +410,7 @@ void *ob_make_undefined (void *addr, size_t len) static const char hexdigs[16] = "0123456789abcdef"; -void ob_fmt_hex_line (char dst[OB_HEX_LINE_LEN], - const unt8 *src, - size_t srcLen) +void ob_fmt_hex_line (char dst[OB_HEX_LINE_LEN], const unt8 *src, size_t srcLen) { size_t hexIdx = 0; size_t ascIdx = 50; @@ -427,15 +421,15 @@ void ob_fmt_hex_line (char dst[OB_HEX_LINE_LEN], for (i = 0; i < 16 && i < srcLen; i++) { - const unt8 b = src[i]; + const unt8 b = src[i]; const unt8 lo = b & 0xf; const unt8 hi = b >> 4; - char c = '.'; + char c = '.'; if (i == 8) hexIdx++; - dst[hexIdx ] = hexdigs[hi]; + dst[hexIdx] = hexdigs[hi]; dst[hexIdx + 1] = hexdigs[lo]; hexIdx += 3; @@ -446,5 +440,5 @@ void ob_fmt_hex_line (char dst[OB_HEX_LINE_LEN], } dst[ascIdx++] = '|'; - dst[ascIdx ] = 0; + dst[ascIdx] = 0; } diff --git a/libLoam/c/ob-vers.c b/libLoam/c/ob-vers.c index 69fd1613..9d72b86b 100644 --- a/libLoam/c/ob-vers.c +++ b/libLoam/c/ob-vers.c @@ -35,13 +35,11 @@ static const char *parse_proc_file (const char *s, const char *label); #ifdef __x86_64__ // Adapted from gstreamer, // https://gitlab.freedesktop.org/gstreamer/orc/blob/bef97d21fd5328a30cda3f5270f004a6ff768ebf/orc/orccpu-x86.c#L182 -static void -ob_cpuid (unt32 op, unt32 *reg) +static void ob_cpuid (unt32 op, unt32 *reg) { - __asm__ ( - " cpuid\n" - : "=a" (reg[0]), "=b" (reg[1]), "=c" (reg[2]), "=d" (reg[3]) - : "a"(op)); + __asm__ (" cpuid\n" + : "=a"(reg[0]), "=b"(reg[1]), "=c"(reg[2]), "=d"(reg[3]) + : "a"(op)); } #else @@ -324,10 +322,9 @@ static char *machine_version (void) * P5N32-E SLI * So we try to make a heuristic decision about which to use. */ - const char *const dmifiles[2][2] = {{"/sys/class/dmi/id/sys_vendor", - "/sys/class/dmi/id/product_name"}, - {"/sys/class/dmi/id/board_vendor", - "/sys/class/dmi/id/board_name"}}; + const char *const dmifiles[2][2] = { + {"/sys/class/dmi/id/sys_vendor", "/sys/class/dmi/id/product_name"}, + {"/sys/class/dmi/id/board_vendor", "/sys/class/dmi/id/board_name"}}; int i, j; for (i = 0; i < 2; i++) { @@ -445,7 +442,7 @@ char *ob_get_version (ob_version_of_what what) ovx.dwMinorVersion); return s; } -#else /* some kind of UNIX */ +#else /* some kind of UNIX */ if (uname (&u) == 0) c = u.release; #endif /* _MSC_VER */ @@ -504,9 +501,9 @@ void ob_banner (FILE *where) fprintf (where, PRODNAME " (c) Oblong Industries and ANIMIST contributors - %s" #ifdef GREENHOUSE - "+gh" + "+gh" #endif - "\n", + "\n", yovo); free (yovo); #if defined(__GNUC__) && !defined(__OPTIMIZE__) diff --git a/libLoam/c/tests/LoamGTest.cpp b/libLoam/c/tests/LoamGTest.cpp index 48bc6af2..192d40e8 100644 --- a/libLoam/c/tests/LoamGTest.cpp +++ b/libLoam/c/tests/LoamGTest.cpp @@ -687,10 +687,10 @@ TEST (StaticMutex, StaticMutex) pthread_t t1, t2; cmp_func c1 = comp1; cmp_func c2 = comp2; - EXPECT_EQ (0, pthread_create (&t1, NULL, thread_main, - reinterpret_cast (c1))); - EXPECT_EQ (0, pthread_create (&t2, NULL, thread_main, - reinterpret_cast (c2))); + EXPECT_EQ ( + 0, pthread_create (&t1, NULL, thread_main, reinterpret_cast (c1))); + EXPECT_EQ ( + 0, pthread_create (&t2, NULL, thread_main, reinterpret_cast (c2))); EXPECT_EQ (0, pthread_join (t1, NULL)); EXPECT_EQ (0, pthread_join (t2, NULL)); int sum = 0; diff --git a/libLoam/c/tests/test-endian.c b/libLoam/c/tests/test-endian.c index 74d3b810..9cb4caa1 100644 --- a/libLoam/c/tests/test-endian.c +++ b/libLoam/c/tests/test-endian.c @@ -49,8 +49,9 @@ int main (int argc, char **argv) if (actual != expected) { - fprintf (stderr, "For 0x%" OB_FMT_64 "x, expected 0x%" OB_FMT_64 "x, " - "but got 0x%" OB_FMT_64 "x\n", + fprintf (stderr, + "For 0x%" OB_FMT_64 "x, expected 0x%" OB_FMT_64 "x, " + "but got 0x%" OB_FMT_64 "x\n", value, expected, actual); return EXIT_FAILURE; } diff --git a/libLoam/c/tests/test-hash.c b/libLoam/c/tests/test-hash.c index ed9c8ceb..6dfe3cdf 100644 --- a/libLoam/c/tests/test-hash.c +++ b/libLoam/c/tests/test-hash.c @@ -53,9 +53,10 @@ static const unt64 kSeed0 = 1234567; static const unt64 kSeed1 = OB_CONST_U64 (0xc3a5c85c97cb3127); enum - { kDataSize = 1 << 20, - kTestSize = 300 - }; +{ + kDataSize = 1 << 20, + kTestSize = 300 +}; static char data[kDataSize]; @@ -63,345 +64,651 @@ static int errors = 0; // global error count // Initialize data to pseudorandom values. static void setup (void) -{ unt64 a = 9; +{ + unt64 a = 9; unt64 b = 777; size_t i; - for (i = 0 ; i < kDataSize ; i++) - { a = (a ^ (a >> 41)) * kSeed1 + b; + for (i = 0; i < kDataSize; i++) + { + a = (a ^ (a >> 41)) * kSeed1 + b; b = (b ^ (b >> 41)) * kSeed1 + i; unt8 u = b >> 37; data[i] = u; } } -static const unt64 testdata[kTestSize][4] = -{ - {OB_CONST_U64 (0x9ae16a3b2f90404f), OB_CONST_U64 (0x3feac5f636039766), OB_CONST_U64 (0xdec09576), OB_CONST_U64 (0x7678f0163a1eb872)}, - {OB_CONST_U64 (0x75e9dee28ded761d), OB_CONST_U64 (0x245eeb25ba2c172e), OB_CONST_U64 (0x4e85c798), OB_CONST_U64 (0x2c8ed2401fa1a20b)}, - {OB_CONST_U64 (0x75de892fdc5ba914), OB_CONST_U64 (0x39a82df1f278a297), OB_CONST_U64 (0xbe5c9477), OB_CONST_U64 (0x7875934b73d6f859)}, - {OB_CONST_U64 (0x69cfe9fca1cc683a), OB_CONST_U64 (0x20575ea6370a9d14), OB_CONST_U64 (0xf2229b30), OB_CONST_U64 (0x120c187f6f60153a)}, - {OB_CONST_U64 (0x675b04c582a34966), OB_CONST_U64 (0xc412e0931ac8c9b1), OB_CONST_U64 (0xc892b7ed), OB_CONST_U64 (0x7aa69ab5e0487a86)}, - {OB_CONST_U64 (0x46fa817397ea8b68), OB_CONST_U64 (0xe5f9f947bafb9e79), OB_CONST_U64 (0xc72ff94c), OB_CONST_U64 (0x2b5768d240808cb1)}, - {OB_CONST_U64 (0x406e959cdffadec7), OB_CONST_U64 (0xe5beb146d4b79a21), OB_CONST_U64 (0x05d38695), OB_CONST_U64 (0xeb5dc781600cb103)}, - {OB_CONST_U64 (0x46663908b4169b95), OB_CONST_U64 (0xdc660b58daaf8b2c), OB_CONST_U64 (0x18bd8f1f), OB_CONST_U64 (0xd0c1330e4b75b0a4)}, - {OB_CONST_U64 (0xf214b86cffeab596), OB_CONST_U64 (0x86e7aa8b4154b883), OB_CONST_U64 (0xc5f386e1), OB_CONST_U64 (0xb56c72801e4f5bae)}, - {OB_CONST_U64 (0xeba670441d1a4f7d), OB_CONST_U64 (0x69f8d424d50c083e), OB_CONST_U64 (0x9b1488d7), OB_CONST_U64 (0x7c460a659073de89)}, - {OB_CONST_U64 (0x172c17ff21dbf88d), OB_CONST_U64 (0x1e34e9f1fa63bcef), OB_CONST_U64 (0xdd4ecaf6), OB_CONST_U64 (0xa27f68736ebe04e2)}, - {OB_CONST_U64 (0x5a0838df8a019b8c), OB_CONST_U64 (0x45e39daf153491bd), OB_CONST_U64 (0xdb57563d), OB_CONST_U64 (0x0600ff191c6ae4ba)}, - {OB_CONST_U64 (0x8f42b1fbb2fc0302), OB_CONST_U64 (0xb87f0cb67cb75d28), OB_CONST_U64 (0xc5ef9366), OB_CONST_U64 (0x4e7fb72b2c82a98c)}, - {OB_CONST_U64 (0x72085e82d70dcea9), OB_CONST_U64 (0x5ebc98c3645a018f), OB_CONST_U64 (0x944adf0d), OB_CONST_U64 (0x5737f49ec72d3e06)}, - {OB_CONST_U64 (0x32b75fc2223b5032), OB_CONST_U64 (0xa6fdbc82c9aeecc0), OB_CONST_U64 (0x4075beef), OB_CONST_U64 (0x61d804a5411e51f9)}, - {OB_CONST_U64 (0xe1dd010487d2d647), OB_CONST_U64 (0xacc5e9b6f6b02dbb), OB_CONST_U64 (0xc51b53a9), OB_CONST_U64 (0x534a066b75bee7d7)}, - {OB_CONST_U64 (0x2994f9245194a7e2), OB_CONST_U64 (0x2170a7d119c5c6c3), OB_CONST_U64 (0x5f16d489), OB_CONST_U64 (0x2273ac2a6887ef64)}, - {OB_CONST_U64 (0x32e2ed6fa03e5b22), OB_CONST_U64 (0xa9c599f3f8f50b5b), OB_CONST_U64 (0x84aad0b0), OB_CONST_U64 (0xfcd6f551816ef7e2)}, - {OB_CONST_U64 (0x37a72b6e89410c9f), OB_CONST_U64 (0x4fccd8f0da7575c3), OB_CONST_U64 (0x8075e268), OB_CONST_U64 (0x13a59610f8d3153c)}, - {OB_CONST_U64 (0x10836563cb8ff3a1), OB_CONST_U64 (0xedc1bb6a3dcba8df), OB_CONST_U64 (0xd3e41a32), OB_CONST_U64 (0x942e5fe5f2771c01)}, - {OB_CONST_U64 (0x4dabcb5c1d382e5c), OB_CONST_U64 (0x7b2b6c389b943be5), OB_CONST_U64 (0xa13710e2), OB_CONST_U64 (0xf4474261894299a1)}, - {OB_CONST_U64 (0x296afb509046d945), OB_CONST_U64 (0xd7b17535df110279), OB_CONST_U64 (0xda970937), OB_CONST_U64 (0xede3477705173116)}, - {OB_CONST_U64 (0xf7c0257efde772ea), OB_CONST_U64 (0x1cdff4bd07e8d973), OB_CONST_U64 (0x2bad6ecc), OB_CONST_U64 (0x1fb7eec00594c0c3)}, - {OB_CONST_U64 (0x61e021c8da344ba1), OB_CONST_U64 (0x354ffa8e9d3601f6), OB_CONST_U64 (0x48963682), OB_CONST_U64 (0x5627bcf480863f1d)}, - {OB_CONST_U64 (0xc0a86ed83908560b), OB_CONST_U64 (0xa99bf2891726ea93), OB_CONST_U64 (0x580c1239), OB_CONST_U64 (0x52c4f2dbcc0b79eb)}, - {OB_CONST_U64 (0x35c9cf87e4accbf3), OB_CONST_U64 (0x080217695666b2c9), OB_CONST_U64 (0x7bee29d1), OB_CONST_U64 (0xb254693967a7c94b)}, - {OB_CONST_U64 (0xe74c366b3091e275), OB_CONST_U64 (0xca9afa806f1a54ac), OB_CONST_U64 (0x61b76780), OB_CONST_U64 (0x8374accf4a2a529d)}, - {OB_CONST_U64 (0xa3f2ca45089ad1a6), OB_CONST_U64 (0x1f93a534bf03e705), OB_CONST_U64 (0x4a071941), OB_CONST_U64 (0x72a07f38de9eab62)}, - {OB_CONST_U64 (0xe5181466d8e60e26), OB_CONST_U64 (0xd9cee87cb71f75b2), OB_CONST_U64 (0x209f7c6a), OB_CONST_U64 (0x75180d35aa86468e)}, - {OB_CONST_U64 (0xfb528a8dd1e48ad7), OB_CONST_U64 (0x04abd8fc3377ae1f), OB_CONST_U64 (0xc697bead), OB_CONST_U64 (0x4c4655e1731ad9f2)}, - {OB_CONST_U64 (0xda6d2b7ea9d5f9b6), OB_CONST_U64 (0x7d3bd1256037142f), OB_CONST_U64 (0xaa5e47f0), OB_CONST_U64 (0xec564db430a27b6e)}, - {OB_CONST_U64 (0x061d95225bc2293e), OB_CONST_U64 (0x91a0667a7ed6a113), OB_CONST_U64 (0xd1fbb72a), OB_CONST_U64 (0xc0d8f471f2cac6da)}, - {OB_CONST_U64 (0x81247c01ab6a9cc1), OB_CONST_U64 (0xae18965000c31be0), OB_CONST_U64 (0x7c9ce289), OB_CONST_U64 (0x5c5ae4854c87eb5d)}, - {OB_CONST_U64 (0xc17f3ebd3257cb8b), OB_CONST_U64 (0x72a5572be35bfc1b), OB_CONST_U64 (0x48badc43), OB_CONST_U64 (0x1f4fdac9456eeb4f)}, - {OB_CONST_U64 (0x9802438969c3043b), OB_CONST_U64 (0x83e26b6830ea8640), OB_CONST_U64 (0x78f88ac5), OB_CONST_U64 (0x93e63e958d309218)}, - {OB_CONST_U64 (0x3dd8ed248a03d754), OB_CONST_U64 (0x87a822141ed64927), OB_CONST_U64 (0xfa19d2c4), OB_CONST_U64 (0x3b023d96d311209a)}, - {OB_CONST_U64 (0xc5bf48d7d3e9a5a3), OB_CONST_U64 (0xc6d2c8a606f45125), OB_CONST_U64 (0x93de51e2), OB_CONST_U64 (0xe63b550c2d4038bd)}, - {OB_CONST_U64 (0xbc4a21d00cf52288), OB_CONST_U64 (0x06081bbc2a18dd0d), OB_CONST_U64 (0xfd45b25f), OB_CONST_U64 (0x31ede87349024719)}, - {OB_CONST_U64 (0x172c8674913ff413), OB_CONST_U64 (0x7e011f9467a06650), OB_CONST_U64 (0x647998cb), OB_CONST_U64 (0x5367e33b7ad89fe5)}, - {OB_CONST_U64 (0x17a361dbdaaa7294), OB_CONST_U64 (0xf49cf8d51ab583d2), OB_CONST_U64 (0x9adba898), OB_CONST_U64 (0x2122670880fb2ca7)}, - {OB_CONST_U64 (0x05cc268bac4bd55f), OB_CONST_U64 (0x38da1393365c961d), OB_CONST_U64 (0x83c0baf1), OB_CONST_U64 (0x4a5b79f788781393)}, - {OB_CONST_U64 (0xdb04969cc06547f1), OB_CONST_U64 (0x967ccec4ed0c977e), OB_CONST_U64 (0xe605b134), OB_CONST_U64 (0xd75b0fde97f8857c)}, - {OB_CONST_U64 (0x25bd8d3ca1b375b2), OB_CONST_U64 (0x9be30ad32f8f28aa), OB_CONST_U64 (0x32a72bea), OB_CONST_U64 (0x711c1f637a1df80c)}, - {OB_CONST_U64 (0x166c11fbcbc89fd8), OB_CONST_U64 (0x78908959b8ede084), OB_CONST_U64 (0xbd025b4c), OB_CONST_U64 (0x6b2d95868a93add8)}, - {OB_CONST_U64 (0x3565bcc4ca4ce807), OB_CONST_U64 (0x6a1f690d886e0270), OB_CONST_U64 (0x0e425cbc), OB_CONST_U64 (0xf495df5ee784a8bb)}, - {OB_CONST_U64 (0xb7897fd2f274307d), OB_CONST_U64 (0x31a2218e64d8fce0), OB_CONST_U64 (0x2bb5f919), OB_CONST_U64 (0x7a320f115a6c14c6)}, - {OB_CONST_U64 (0xaba98113ab0e4a16), OB_CONST_U64 (0x3ecd2a607193ba3b), OB_CONST_U64 (0x7e2dc1f2), OB_CONST_U64 (0x5a42a92198c70c8a)}, - {OB_CONST_U64 (0x17f7796e0d4b636c), OB_CONST_U64 (0x65f9735375df1ada), OB_CONST_U64 (0x9718242b), OB_CONST_U64 (0x6c4fb6bfed558071)}, - {OB_CONST_U64 (0x33c0128e62122440), OB_CONST_U64 (0xf2608199ca14c26a), OB_CONST_U64 (0x5841ff43), OB_CONST_U64 (0x32f9e904ede0fd06)}, - {OB_CONST_U64 (0x988bc5d290b97aef), OB_CONST_U64 (0x44b5cf8b5b8106a8), OB_CONST_U64 (0x7d2d36d0), OB_CONST_U64 (0xd3b73e613025573b)}, - {OB_CONST_U64 (0x23c8c25c2ab72381), OB_CONST_U64 (0x6aef5e6eb4a4eb10), OB_CONST_U64 (0x26892a33), OB_CONST_U64 (0x38d5c43f03f76844)}, - {OB_CONST_U64 (0x450fe4acc4ad3749), OB_CONST_U64 (0xdb570fc2abaf13a9), OB_CONST_U64 (0x27132ca4), OB_CONST_U64 (0x7587e038073d8977)}, - {OB_CONST_U64 (0x48e1eff032d90c50), OB_CONST_U64 (0xc845776990c96775), OB_CONST_U64 (0x84c11bd5), OB_CONST_U64 (0x136e45b9b60410ac)}, - {OB_CONST_U64 (0xc048604ba8b6c753), OB_CONST_U64 (0x4e40a127ad2d6834), OB_CONST_U64 (0xd1307524), OB_CONST_U64 (0x0368f142c482b474)}, - {OB_CONST_U64 (0x67ff1cbe469ebf84), OB_CONST_U64 (0x85bf1ad6b363a14b), OB_CONST_U64 (0x4d666715), OB_CONST_U64 (0x2799641f84e9c19f)}, - {OB_CONST_U64 (0xb45c7536bd7a5416), OB_CONST_U64 (0xb70b641138765ff5), OB_CONST_U64 (0x95958f0d), OB_CONST_U64 (0x02b3f524041298cf)}, - {OB_CONST_U64 (0x215c2eaacdb48f6f), OB_CONST_U64 (0x078c4e94ba9f28bf), OB_CONST_U64 (0x260c2076), OB_CONST_U64 (0x9097aef0fd761c33)}, - {OB_CONST_U64 (0x241baf16d80e0fe8), OB_CONST_U64 (0x6ae6b36209eecd70), OB_CONST_U64 (0x77b0b654), OB_CONST_U64 (0x4b81699dd420b70f)}, - {OB_CONST_U64 (0xd10a9743b5b1c4d1), OB_CONST_U64 (0xfbd20a91b6085ed3), OB_CONST_U64 (0xdc2141d7), OB_CONST_U64 (0x6dcbd5a2ebcfd061)}, - {OB_CONST_U64 (0x919ef9e209f2edd1), OB_CONST_U64 (0x00540353f94e8033), OB_CONST_U64 (0x1adbf546), OB_CONST_U64 (0xf676660ca4d826fd)}, - {OB_CONST_U64 (0x0b5f9519b6c9280b), OB_CONST_U64 (0xd379a205a3bd4660), OB_CONST_U64 (0x20ab6975), OB_CONST_U64 (0x53ad41972a8138a0)}, - {OB_CONST_U64 (0x77a75e89679e6757), OB_CONST_U64 (0xd81f2dfd08890060), OB_CONST_U64 (0x5514da97), OB_CONST_U64 (0x223850d6e1b33c7e)}, - {OB_CONST_U64 (0x9d709e1b086aabe2), OB_CONST_U64 (0xdf73b01acd416e84), OB_CONST_U64 (0x0660852f), OB_CONST_U64 (0x43ddc71378ac41f9)}, - {OB_CONST_U64 (0x91c89971b3c20a8a), OB_CONST_U64 (0xbc47bb80dfdaefcd), OB_CONST_U64 (0x3b1f578e), OB_CONST_U64 (0x508284a7e7bb5928)}, - {OB_CONST_U64 (0x16468c55a1b3f2b4), OB_CONST_U64 (0x143adc6fee592576), OB_CONST_U64 (0xf410f8f0), OB_CONST_U64 (0x0ad5d860d1a556cc)}, - {OB_CONST_U64 (0x8015f298161f861e), OB_CONST_U64 (0x37b223562c48b473), OB_CONST_U64 (0xc6a7cd79), OB_CONST_U64 (0xa851af0175c557ae)}, - {OB_CONST_U64 (0x71e244d7e2843a41), OB_CONST_U64 (0x1791b7a5b93ad1f9), OB_CONST_U64 (0x0ed77012), OB_CONST_U64 (0x1e99355f076eb276)}, - {OB_CONST_U64 (0x5d3cb0d2c7ccf11f), OB_CONST_U64 (0xea833d94dca4809a), OB_CONST_U64 (0xe571b90a), OB_CONST_U64 (0x1e87ef9748f93ec9)}, - {OB_CONST_U64 (0xd6cffe6c223aba65), OB_CONST_U64 (0x67268f8829a9f99d), OB_CONST_U64 (0x2a32f349), OB_CONST_U64 (0x48a58f215c151b10)}, - {OB_CONST_U64 (0x8a17c5054e85e2be), OB_CONST_U64 (0x9b345fa359c4e8e3), OB_CONST_U64 (0x963330fd), OB_CONST_U64 (0x69649a9c54ab0d01)}, - {OB_CONST_U64 (0x77d112a0b7084c6a), OB_CONST_U64 (0xa3c8f877e8ebc840), OB_CONST_U64 (0x0bdcd0e0), OB_CONST_U64 (0xc1bb0c27946d773f)}, - {OB_CONST_U64 (0x708f2a6e8bd57583), OB_CONST_U64 (0xd28955c99ed63d38), OB_CONST_U64 (0xb87dc444), OB_CONST_U64 (0x73a5f5b744f57654)}, - {OB_CONST_U64 (0x50bc8f76b62c8de9), OB_CONST_U64 (0xda08ee1bf528e82e), OB_CONST_U64 (0x0e493311), OB_CONST_U64 (0x54eb66b6bed8cdff)}, - {OB_CONST_U64 (0x8b15a656b553641a), OB_CONST_U64 (0xa051cbbf796013c1), OB_CONST_U64 (0x86fc4e19), OB_CONST_U64 (0x65522cbed0be9571)}, - {OB_CONST_U64 (0x6ba74ccf722a52be), OB_CONST_U64 (0x32e95f14d29a1c01), OB_CONST_U64 (0x1494e01f), OB_CONST_U64 (0x39e39ac7b3d02e1d)}, - {OB_CONST_U64 (0xfb317bb7533454d0), OB_CONST_U64 (0x593d179631ddf22c), OB_CONST_U64 (0x95599cb1), OB_CONST_U64 (0x0bb6a2b8b7c8ea81)}, - {OB_CONST_U64 (0x8eec643f62c90fea), OB_CONST_U64 (0x62fa77ed321e937f), OB_CONST_U64 (0x84fc499e), OB_CONST_U64 (0xe64e02f824380f19)}, - {OB_CONST_U64 (0x81ce6becdf10dff2), OB_CONST_U64 (0xdb5cb16e44cb1e37), OB_CONST_U64 (0x4cc8cdb0), OB_CONST_U64 (0x7ddf32e47426424a)}, - {OB_CONST_U64 (0x549c669fb0049f69), OB_CONST_U64 (0x675a9a86499cd4e4), OB_CONST_U64 (0x145a7958), OB_CONST_U64 (0x5a1eef2ce790329d)}, - {OB_CONST_U64 (0x2b6a3433940bbf2d), OB_CONST_U64 (0x812bcb2a17f1f652), OB_CONST_U64 (0x1a2d0277), OB_CONST_U64 (0xe6eaa23c531ae775)}, - {OB_CONST_U64 (0xd80b7a3c691401b7), OB_CONST_U64 (0x8e44beb4b7cde31b), OB_CONST_U64 (0x253fd8c9), OB_CONST_U64 (0x5ea1e5a33a00bec5)}, - {OB_CONST_U64 (0xab3bf6b494f66ef3), OB_CONST_U64 (0x383cc50df33afc6f), OB_CONST_U64 (0xeb48ec69), OB_CONST_U64 (0x29eb16239c5037cc)}, - {OB_CONST_U64 (0x83f7b824a3911d44), OB_CONST_U64 (0x13c001ebba408aaa), OB_CONST_U64 (0x15501a6e), OB_CONST_U64 (0xd782115f871ba789)}, - {OB_CONST_U64 (0x3fb8d482d0d9d03f), OB_CONST_U64 (0x96ebbf1ceac7b4cb), OB_CONST_U64 (0x9cd3cf59), OB_CONST_U64 (0x5894ba9f6170fe16)}, - {OB_CONST_U64 (0xad346a1f100b3944), OB_CONST_U64 (0x77664abec282db4c), OB_CONST_U64 (0xee8c6c74), OB_CONST_U64 (0xf461a205ab40bfe8)}, - {OB_CONST_U64 (0xdb210eb547a3dbc5), OB_CONST_U64 (0x4ca87abbb73194d8), OB_CONST_U64 (0xed28ad5c), OB_CONST_U64 (0x2113a98d39f4d31c)}, - {OB_CONST_U64 (0xe55fab4f920abdc0), OB_CONST_U64 (0x6f67cf7344c18fce), OB_CONST_U64 (0xcc3cced7), OB_CONST_U64 (0x008d8386b0dd439d)}, - {OB_CONST_U64 (0x3b530fff7e848c5e), OB_CONST_U64 (0x4340e5798860241a), OB_CONST_U64 (0x26231582), OB_CONST_U64 (0xa4e9eb6db74b4534)}, - {OB_CONST_U64 (0xbde3379279d1cae1), OB_CONST_U64 (0x9f070e7509abc6bf), OB_CONST_U64 (0xcfe03f57), OB_CONST_U64 (0x189ee9bbe0732501)}, - {OB_CONST_U64 (0x4008062bc7755b37), OB_CONST_U64 (0x4502cd3133c94d7d), OB_CONST_U64 (0x1b98d193), OB_CONST_U64 (0xbd6c66f578831956)}, - {OB_CONST_U64 (0x76a66ce0ee8094d1), OB_CONST_U64 (0x83b12c2aff5dd46e), OB_CONST_U64 (0x3fa1e23f), OB_CONST_U64 (0xfd32c55a814c4579)}, - {OB_CONST_U64 (0x2bc3dfb3b1756918), OB_CONST_U64 (0x52c60b61184e08de), OB_CONST_U64 (0x09b3e288), OB_CONST_U64 (0x2264268c78fd42c8)}, - {OB_CONST_U64 (0xd060dc1e8ca204ee), OB_CONST_U64 (0x1f120ffb0524d537), OB_CONST_U64 (0xcb19d348), OB_CONST_U64 (0x9d4d58317482a536)}, - {OB_CONST_U64 (0xc8ec4fc839254a74), OB_CONST_U64 (0xd6a77d7a8c6d11f4), OB_CONST_U64 (0xc89d6d86), OB_CONST_U64 (0x7038877f940915f8)}, - {OB_CONST_U64 (0x7cdf98a07b1315b0), OB_CONST_U64 (0x0d2480e4e97602ad), OB_CONST_U64 (0x586cc72f), OB_CONST_U64 (0xb1a55580d0a1ea94)}, - {OB_CONST_U64 (0x78284cb5c0143ed8), OB_CONST_U64 (0x71d171a63a6187b5), OB_CONST_U64 (0x655cf59e), OB_CONST_U64 (0x270614d5542392f3)}, - {OB_CONST_U64 (0x5c2c485bdc8e3317), OB_CONST_U64 (0x6b433526b05fc4d8), OB_CONST_U64 (0x6b581138), OB_CONST_U64 (0x70433126e160b999)}, - {OB_CONST_U64 (0x6e38acb798627f75), OB_CONST_U64 (0x766ef46cf807f655), OB_CONST_U64 (0x26550b5a), OB_CONST_U64 (0xbe354ed28da71552)}, - {OB_CONST_U64 (0xc5fb48f0939b4878), OB_CONST_U64 (0x6d36a844bb3f3360), OB_CONST_U64 (0xc710cec5), OB_CONST_U64 (0x0c08698221559bc5)}, - {OB_CONST_U64 (0x0292da6390260110), OB_CONST_U64 (0xf843ecb8366f0809), OB_CONST_U64 (0x63a0800f), OB_CONST_U64 (0xc8dd9110875c2fa1)}, - {OB_CONST_U64 (0x1e0ee26b7044741b), OB_CONST_U64 (0xb24891afcb0faa49), OB_CONST_U64 (0xaff7df8c), OB_CONST_U64 (0x8040ddb247bf497f)}, - {OB_CONST_U64 (0x69b8f7e762db77ec), OB_CONST_U64 (0xb1e8e3f0f5c9037e), OB_CONST_U64 (0xf05014b1), OB_CONST_U64 (0xff09fea8a55c4662)}, - {OB_CONST_U64 (0x9b321366d6585031), OB_CONST_U64 (0x3b7321189816fdcc), OB_CONST_U64 (0x0b814a2e), OB_CONST_U64 (0x69e47772c90fe4c5)}, - {OB_CONST_U64 (0x9375c89169bf70cf), OB_CONST_U64 (0x3ab599efd811ae97), OB_CONST_U64 (0xdff4a026), OB_CONST_U64 (0xf81c2c819b274b2f)}, - {OB_CONST_U64 (0xa8db1643cc52d94d), OB_CONST_U64 (0x925b29c3dbfea463), OB_CONST_U64 (0xe51b5324), OB_CONST_U64 (0x0d19829a9daee02f)}, - {OB_CONST_U64 (0xcf7a9ea6a7a30dee), OB_CONST_U64 (0x6793c6e1fad303dd), OB_CONST_U64 (0xa54188c2), OB_CONST_U64 (0x565963a1a008b17e)}, - {OB_CONST_U64 (0x42c2e9f84dc7f129), OB_CONST_U64 (0x0216a0d505d49b80), OB_CONST_U64 (0xf656e374), OB_CONST_U64 (0xdcc457d95bb94b35)}, - {OB_CONST_U64 (0x394c2c1cca4e9271), OB_CONST_U64 (0x5113e80f2555b54c), OB_CONST_U64 (0x1577b7cf), OB_CONST_U64 (0xee977883cc2f003c)}, - {OB_CONST_U64 (0xd38df9e9740cb16c), OB_CONST_U64 (0xa15ead26a317837e), OB_CONST_U64 (0x19adf32e), OB_CONST_U64 (0xca8f4f5838e8cce9)}, - {OB_CONST_U64 (0xec12466d1379cfdf), OB_CONST_U64 (0x1407e7cad8d977df), OB_CONST_U64 (0xf16bddf9), OB_CONST_U64 (0x89e3b52c15a26c5b)}, - {OB_CONST_U64 (0x9050986d9ced6a2e), OB_CONST_U64 (0xb16a21f3ae8ddaf4), OB_CONST_U64 (0x96096a72), OB_CONST_U64 (0x9a12c3fa15055b73)}, - {OB_CONST_U64 (0xc7362967930e8a48), OB_CONST_U64 (0x96e9b973fe114561), OB_CONST_U64 (0x909af69c), OB_CONST_U64 (0xc46c02c67615746a)}, - {OB_CONST_U64 (0x47bd8137d464eab3), OB_CONST_U64 (0x499063daa6e4eae3), OB_CONST_U64 (0xa567056a), OB_CONST_U64 (0x8d354e14449fde3a)}, - {OB_CONST_U64 (0xcff30d9303db2dfe), OB_CONST_U64 (0xb2d9cc739ab9f148), OB_CONST_U64 (0x8b0eded5), OB_CONST_U64 (0xddc86739148bf938)}, - {OB_CONST_U64 (0x8d086fc30b6694b2), OB_CONST_U64 (0xf24a7ec2f48b6809), OB_CONST_U64 (0x099c0a25), OB_CONST_U64 (0x94d3b7741e488ac5)}, - {OB_CONST_U64 (0xb7d681356bdd9e4f), OB_CONST_U64 (0xe8f5fbafde7bea61), OB_CONST_U64 (0x1548b82f), OB_CONST_U64 (0x8e47a2340ebb3601)}, - {OB_CONST_U64 (0x5bb01fcb2e6ad355), OB_CONST_U64 (0x1f7a98978f1bf049), OB_CONST_U64 (0x38f69920), OB_CONST_U64 (0x9673eb5b2231f3ac)}, - {OB_CONST_U64 (0xcd2ff001a80d1b11), OB_CONST_U64 (0x5df56e499e9ca980), OB_CONST_U64 (0x3261c992), OB_CONST_U64 (0x40f4531ee98c27b6)}, - {OB_CONST_U64 (0x8bfbf611401100cd), OB_CONST_U64 (0x056b61ed81d29796), OB_CONST_U64 (0x64b52009), OB_CONST_U64 (0xe71f818de60cd8ca)}, - {OB_CONST_U64 (0xec9ae0cf9290d012), OB_CONST_U64 (0xde04cc7d2c562fcf), OB_CONST_U64 (0x2ff97516), OB_CONST_U64 (0x0c025a58cafb90ea)}, - {OB_CONST_U64 (0x4ac2a5e9dc03176d), OB_CONST_U64 (0xe5fcbc1dfe65f7db), OB_CONST_U64 (0xc74fba39), OB_CONST_U64 (0x8ec1168f7e078784)}, - {OB_CONST_U64 (0x5fd51f635bc557a8), OB_CONST_U64 (0x603d74dd65a3baf6), OB_CONST_U64 (0xe3e6d95e), OB_CONST_U64 (0xd5a676e984e3d2a6)}, - {OB_CONST_U64 (0xec3521e8efdb1779), OB_CONST_U64 (0xa372b6a2f501313c), OB_CONST_U64 (0xa1d0c39d), OB_CONST_U64 (0x8aa08a2843d48d67)}, - {OB_CONST_U64 (0xa9147f0fb2e38bb1), OB_CONST_U64 (0x7bfb951842162784), OB_CONST_U64 (0x83de5195), OB_CONST_U64 (0xe3abd60325e6e7d2)}, - {OB_CONST_U64 (0xa080e609751f2e81), OB_CONST_U64 (0xb9a0f8b45d79c318), OB_CONST_U64 (0x121c46a1), OB_CONST_U64 (0x5574538fc45a63ce)}, - {OB_CONST_U64 (0x3bc578f69905fa2d), OB_CONST_U64 (0x18646edbbf14b0ed), OB_CONST_U64 (0x4f0c262c), OB_CONST_U64 (0x56a730dd842bc51a)}, - {OB_CONST_U64 (0x9e6a5e0641d1c0d9), OB_CONST_U64 (0x73c0bcd5a7366e15), OB_CONST_U64 (0x5b117800), OB_CONST_U64 (0x6ed1c62dbebab3d9)}, - {OB_CONST_U64 (0x83b0cdb3c934c679), OB_CONST_U64 (0x25cbcd575a21c446), OB_CONST_U64 (0x520c98ab), OB_CONST_U64 (0x631930ea8e36cc88)}, - {OB_CONST_U64 (0xf174161497c5fa97), OB_CONST_U64 (0x5eb7a9d5a724daed), OB_CONST_U64 (0x906148ee), OB_CONST_U64 (0xc7c94b895e6b6258)}, - {OB_CONST_U64 (0xd7262cb2f2755e70), OB_CONST_U64 (0x76a474a551662078), OB_CONST_U64 (0x5a2ecb92), OB_CONST_U64 (0x6142c974ac71b347)}, - {OB_CONST_U64 (0x1444ce264e8784b7), OB_CONST_U64 (0x7e52afec3d9d166e), OB_CONST_U64 (0x3067423e), OB_CONST_U64 (0xef88ce34aebe6d9f)}, - {OB_CONST_U64 (0x532e6b5c95a2e229), OB_CONST_U64 (0x90febf2e15deaaa5), OB_CONST_U64 (0x8dbec7a8), OB_CONST_U64 (0x0011e7a3d2883a6b)}, - {OB_CONST_U64 (0x183d112159f539eb), OB_CONST_U64 (0x82051bab809a3bf3), OB_CONST_U64 (0x2e9b2d9e), OB_CONST_U64 (0xed785a34053a1cd5)}, - {OB_CONST_U64 (0x8f18272400b3ace9), OB_CONST_U64 (0xa395a3524727f255), OB_CONST_U64 (0xda8abd8f), OB_CONST_U64 (0x1869b9964373be96)}, - {OB_CONST_U64 (0x43761e6a5f6f2fd6), OB_CONST_U64 (0x9db86e928d9c50d8), OB_CONST_U64 (0x4235d6aa), OB_CONST_U64 (0x9db4d3a1996d848b)}, - {OB_CONST_U64 (0x44f615fcd096fbfe), OB_CONST_U64 (0xb0153a7a31076599), OB_CONST_U64 (0xb47bf565), OB_CONST_U64 (0x9cd91557a3c29906)}, - {OB_CONST_U64 (0x27613f9db818cf78), OB_CONST_U64 (0xbf8519db808bc3fa), OB_CONST_U64 (0x52a37beb), OB_CONST_U64 (0x1b504a79d45501df)}, - {OB_CONST_U64 (0x3f6984c7afaebd0b), OB_CONST_U64 (0x5b4fdfaf084a67cb), OB_CONST_U64 (0xa252b32c), OB_CONST_U64 (0x37e9335fa8f29171)}, - {OB_CONST_U64 (0x8fc511284f47c772), OB_CONST_U64 (0xd04d61891a700659), OB_CONST_U64 (0xbd4e635f), OB_CONST_U64 (0xdcaca9444a855911)}, - {OB_CONST_U64 (0x15ae5f12f88592e2), OB_CONST_U64 (0x5bd91d548ffefd6e), OB_CONST_U64 (0x15428f4c), OB_CONST_U64 (0x3bbe10daaa790a2b)}, - {OB_CONST_U64 (0x905f995bddf92cb7), OB_CONST_U64 (0x4dc5bb06cd995cee), OB_CONST_U64 (0xd5a63731), OB_CONST_U64 (0x8711063a55f2825e)}, - {OB_CONST_U64 (0xa23ac6bef8905fec), OB_CONST_U64 (0xb363b9add66e1684), OB_CONST_U64 (0x0b484491), OB_CONST_U64 (0xa4bd47c024836acc)}, - {OB_CONST_U64 (0x403b94a75160a06b), OB_CONST_U64 (0xaa0739cef99075f8), OB_CONST_U64 (0x3c641984), OB_CONST_U64 (0x899b3e365a68e975)}, - {OB_CONST_U64 (0x14d1ee05672fc19b), OB_CONST_U64 (0xd065eb50cfb5c451), OB_CONST_U64 (0x7de1a18a), OB_CONST_U64 (0xb3d32e5e51babb47)}, - {OB_CONST_U64 (0xf59376c617951a2a), OB_CONST_U64 (0x5d291a873d8d9f9a), OB_CONST_U64 (0x428e73df), OB_CONST_U64 (0xf98433bb496756b3)}, - {OB_CONST_U64 (0x063982fdc37a9dc5), OB_CONST_U64 (0xe7d5ccc2c570c989), OB_CONST_U64 (0xe46558a6), OB_CONST_U64 (0x1595ed9d69027073)}, - {OB_CONST_U64 (0xeb480334ed838b48), OB_CONST_U64 (0x39dfa7182359c93d), OB_CONST_U64 (0x960ae3c5), OB_CONST_U64 (0x971f3449913b016a)}, - {OB_CONST_U64 (0xd0b9004efa0a1164), OB_CONST_U64 (0x0b5d9a7ab23808f7), OB_CONST_U64 (0x7dc815f0), OB_CONST_U64 (0xc762dd40848a0028)}, - {OB_CONST_U64 (0xb31f2b6cc2a15506), OB_CONST_U64 (0x341f7d6f1212356b), OB_CONST_U64 (0x9f1aafa1), OB_CONST_U64 (0x4eeaf94e83181752)}, - {OB_CONST_U64 (0x4f9da8a709bec12f), OB_CONST_U64 (0xd82b32d7831a57aa), OB_CONST_U64 (0x1369efd1), OB_CONST_U64 (0x7bbd80eb7b64fd3a)}, - {OB_CONST_U64 (0x5504000602e6f8cf), OB_CONST_U64 (0xd83dda14a4423630), OB_CONST_U64 (0x810961e0), OB_CONST_U64 (0xc3e4450343620672)}, - {OB_CONST_U64 (0x2d022d82f513a883), OB_CONST_U64 (0xb339f8f80f556971), OB_CONST_U64 (0x94aa9431), OB_CONST_U64 (0xdb6e093cfac2ff78)}, - {OB_CONST_U64 (0xa87268205997eddb), OB_CONST_U64 (0xc69eac6e1256a4d9), OB_CONST_U64 (0x9d97da8b), OB_CONST_U64 (0xa2219ef4fad86b69)}, - {OB_CONST_U64 (0xfde5f0a803c3affc), OB_CONST_U64 (0x6a678f40a8058ab0), OB_CONST_U64 (0x4338229d), OB_CONST_U64 (0xff8a7d57a0507b44)}, - {OB_CONST_U64 (0xfa46e0e215c1aabd), OB_CONST_U64 (0x14571d59c36d29ea), OB_CONST_U64 (0x0adc4cfe), OB_CONST_U64 (0xc6a7802a40c3f34a)}, - {OB_CONST_U64 (0x7e1f98b2c16f8b2b), OB_CONST_U64 (0xd23b89c36294385a), OB_CONST_U64 (0x3a3a88b9), OB_CONST_U64 (0x831c8306200413ab)}, - {OB_CONST_U64 (0x65a58d22d8665e60), OB_CONST_U64 (0x14ce593a63d5a590), OB_CONST_U64 (0x7245b01b), OB_CONST_U64 (0xfb791a7acd48fa22)}, - {OB_CONST_U64 (0xb781b9a55e7d6ab9), OB_CONST_U64 (0xb2ae79ab4b601bec), OB_CONST_U64 (0x1f906322), OB_CONST_U64 (0x6fda72cfc1055b02)}, - {OB_CONST_U64 (0xa88c857b1aeb0835), OB_CONST_U64 (0xb03b42ed85390bea), OB_CONST_U64 (0xb095a5a2), OB_CONST_U64 (0x2731ac19776140af)}, - {OB_CONST_U64 (0x2a25994979124643), OB_CONST_U64 (0x08667e3420bb8d50), OB_CONST_U64 (0xe85e52bd), OB_CONST_U64 (0x99b6adf6324a63a3)}, - {OB_CONST_U64 (0x17236ed61e669c6f), OB_CONST_U64 (0x028fe56765c1b7ed), OB_CONST_U64 (0x7be7f30c), OB_CONST_U64 (0x07f8598ff5292a31)}, - {OB_CONST_U64 (0x304f56359ac375a8), OB_CONST_U64 (0xd52df3445a1a027c), OB_CONST_U64 (0x276bf62b), OB_CONST_U64 (0x68a05cdb805a7cba)}, - {OB_CONST_U64 (0x2e236ded6ce34194), OB_CONST_U64 (0xb0b18d56850de1a5), OB_CONST_U64 (0x384b054b), OB_CONST_U64 (0x5d6e36272139a968)}, - {OB_CONST_U64 (0x837ecb10d69f9bb9), OB_CONST_U64 (0x620aaae18ac52da4), OB_CONST_U64 (0x36ea0dbc), OB_CONST_U64 (0x0919d413bbed1f82)}, - {OB_CONST_U64 (0xc94bc80993d726f2), OB_CONST_U64 (0x4b2b9d78cda610a0), OB_CONST_U64 (0x4ba74b7e), OB_CONST_U64 (0x4d28e86fc2e28a98)}, - {OB_CONST_U64 (0x463b54729349357a), OB_CONST_U64 (0xab16e09e606fd74f), OB_CONST_U64 (0x118b9cf3), OB_CONST_U64 (0x97323f9b43e7f70f)}, - {OB_CONST_U64 (0x52e298a69bc61248), OB_CONST_U64 (0x45d0e8cbf8999a16), OB_CONST_U64 (0x5fffb830), OB_CONST_U64 (0x6c39e05230d5bdcb)}, - {OB_CONST_U64 (0xf31bde28294be223), OB_CONST_U64 (0xb57c20d0886767cc), OB_CONST_U64 (0xe815e6ac), OB_CONST_U64 (0xb33f0e59bd552656)}, - {OB_CONST_U64 (0xd1d98f3bbaf26f1e), OB_CONST_U64 (0xfdb28b9faa7455cb), OB_CONST_U64 (0xe8a08288), OB_CONST_U64 (0x24f8d1c92e1a56da)}, - {OB_CONST_U64 (0x77969267e761a5e2), OB_CONST_U64 (0x6a50d507180b9dd8), OB_CONST_U64 (0x5a93e263), OB_CONST_U64 (0x42c647e4a6f6cbb1)}, - {OB_CONST_U64 (0x763f1101a3d8e5d6), OB_CONST_U64 (0xbdc2cec3b0c72126), OB_CONST_U64 (0x1b7ac668), OB_CONST_U64 (0xc9403096677994c0)}, - {OB_CONST_U64 (0xb6ffcab942c26180), OB_CONST_U64 (0x8bc905dfc7b85595), OB_CONST_U64 (0xcd693a5a), OB_CONST_U64 (0x9c7e53f9d23a8a77)}, - {OB_CONST_U64 (0x65a85965268277a5), OB_CONST_U64 (0x0aabf0324ece8814), OB_CONST_U64 (0x1e0de37c), OB_CONST_U64 (0xc5946fa6ce15e9ce)}, - {OB_CONST_U64 (0x6579248c4cabcf91), OB_CONST_U64 (0x727c8a9161e8cc9e), OB_CONST_U64 (0x5cef51bc), OB_CONST_U64 (0x2a1bbbe14183babe)}, - {OB_CONST_U64 (0xfcea6deb6fbc95de), OB_CONST_U64 (0xa402e8b120895dcf), OB_CONST_U64 (0xc2a9c0a4), OB_CONST_U64 (0x0fe6825d6dfaed01)}, - {OB_CONST_U64 (0xa5afb4dac88f15f0), OB_CONST_U64 (0xc118493d086eb030), OB_CONST_U64 (0xefc82c86), OB_CONST_U64 (0x4dd6723285509c19)}, - {OB_CONST_U64 (0x35f437b7acbfd454), OB_CONST_U64 (0xb29d3d3f9fea4832), OB_CONST_U64 (0x166de137), OB_CONST_U64 (0xaa89af4951f86aed)}, - {OB_CONST_U64 (0x8f45f63a2f2d77d5), OB_CONST_U64 (0x7b457c2c096a4fef), OB_CONST_U64 (0x6ea50223), OB_CONST_U64 (0xf17c0651f490f90d)}, - {OB_CONST_U64 (0x62258e6fe64ea749), OB_CONST_U64 (0x1e383042228a6524), OB_CONST_U64 (0xf3efca26), OB_CONST_U64 (0x0516246cf463580b)}, - {OB_CONST_U64 (0xfc109f4192ba2587), OB_CONST_U64 (0xda0616341a86759b), OB_CONST_U64 (0xe6787702), OB_CONST_U64 (0x9f5588e52885524d)}, - {OB_CONST_U64 (0x5364968136715e44), OB_CONST_U64 (0x1b04a476a5af6319), OB_CONST_U64 (0xdf592a85), OB_CONST_U64 (0xf0807df09903fee7)}, - {OB_CONST_U64 (0xdd84538848e07acb), OB_CONST_U64 (0x4a1b7795ab30febc), OB_CONST_U64 (0x1c80156c), OB_CONST_U64 (0xb933fd19f925df6d)}, - {OB_CONST_U64 (0x397d78f9c2fb2a8a), OB_CONST_U64 (0x4b5d814365f300c3), OB_CONST_U64 (0x0dd91e5a), OB_CONST_U64 (0xf2ce01375f6bb0c3)}, - {OB_CONST_U64 (0xa3a22aed573f4128), OB_CONST_U64 (0x61b303cec0f02d33), OB_CONST_U64 (0x18ae05b2), OB_CONST_U64 (0xbb649a569d87157a)}, - {OB_CONST_U64 (0x94bcd5be64b0caf0), OB_CONST_U64 (0x465dd18f325b992d), OB_CONST_U64 (0x2341f964), OB_CONST_U64 (0xc74d1a34a6313b15)}, - {OB_CONST_U64 (0x081d9fe1f35fe8dc), OB_CONST_U64 (0x09cee67a7a5c2455), OB_CONST_U64 (0x027942d4), OB_CONST_U64 (0xcaa239d36383c6d8)}, - {OB_CONST_U64 (0xaa21f88e4310c4aa), OB_CONST_U64 (0x9eb788a336487a2f), OB_CONST_U64 (0x574c81d1), OB_CONST_U64 (0xa9abd6d5b7d8e04f)}, - {OB_CONST_U64 (0x88e65c8bd8fd0dc3), OB_CONST_U64 (0x8e35bd6404cd4a19), OB_CONST_U64 (0x12fc5100), OB_CONST_U64 (0x16a9f9d8fdc20dc3)}, - {OB_CONST_U64 (0xee7c287c7a74eaf6), OB_CONST_U64 (0x15b4a29d0e8621fd), OB_CONST_U64 (0x0fd19c59), OB_CONST_U64 (0xf56970eee4bd614a)}, - {OB_CONST_U64 (0x59492bfd26df7a46), OB_CONST_U64 (0x2dabd903fca564b6), OB_CONST_U64 (0xd0adc89a), OB_CONST_U64 (0x6f146cdb1f14ac52)}, - {OB_CONST_U64 (0x79471e68a2e7b4c3), OB_CONST_U64 (0x1c0c9618d88b7cf9), OB_CONST_U64 (0x87215cdf), OB_CONST_U64 (0x0c4a3256e3a59540)}, - {OB_CONST_U64 (0xf806f8b0f54bbbf4), OB_CONST_U64 (0xc57fbf8500049609), OB_CONST_U64 (0x82da8499), OB_CONST_U64 (0x5b81d54204e8c6fc)}, - {OB_CONST_U64 (0xaf0a9fa8d197fc2a), OB_CONST_U64 (0x297afa7cc277321a), OB_CONST_U64 (0xb345a1d6), OB_CONST_U64 (0x2799b3cd5ffda8f3)}, - {OB_CONST_U64 (0xa93491c935028bfd), OB_CONST_U64 (0xfc5dcf1134041bb3), OB_CONST_U64 (0x003396eb), OB_CONST_U64 (0x332cf9147d64dda7)}, - {OB_CONST_U64 (0x35fb344f57414e7e), OB_CONST_U64 (0xf084e04093c69f21), OB_CONST_U64 (0x0731524a), OB_CONST_U64 (0x4089b86b659ef0ea)}, - {OB_CONST_U64 (0x650c588ae7997006), OB_CONST_U64 (0xfd225f2b4d05e97b), OB_CONST_U64 (0x041e1ae6), OB_CONST_U64 (0x788c83e3ef21c387)}, - {OB_CONST_U64 (0x8e83c18ec4fac9b2), OB_CONST_U64 (0x15a4f84e1fbb081f), OB_CONST_U64 (0x786f9e40), OB_CONST_U64 (0x64356cb8697d3a52)}, - {OB_CONST_U64 (0x35422c6582e3fa2e), OB_CONST_U64 (0xaac1901ece0f6dbe), OB_CONST_U64 (0x23efed01), OB_CONST_U64 (0x416f5d520bae761a)}, - {OB_CONST_U64 (0xfc0cb7f55d516f4e), OB_CONST_U64 (0xf058bdc360787c2e), OB_CONST_U64 (0x5613763f), OB_CONST_U64 (0xe440f39517b4fff8)}, - {OB_CONST_U64 (0xe6245e6273cd7da4), OB_CONST_U64 (0xdef05217f2ba3b7e), OB_CONST_U64 (0x67089e56), OB_CONST_U64 (0x8632d73dc7d0565d)}, - {OB_CONST_U64 (0xbfb40261b25b0146), OB_CONST_U64 (0xd9de3386702c1efa), OB_CONST_U64 (0xea544d65), OB_CONST_U64 (0x5ba92f505b6da6c4)}, - {OB_CONST_U64 (0x298876b240a1f937), OB_CONST_U64 (0xf4ec81df6387b639), OB_CONST_U64 (0x51d84284), OB_CONST_U64 (0xe2b9c145fcfa9666)}, - {OB_CONST_U64 (0xbf26833d8f21542e), OB_CONST_U64 (0x978d2ce692fc2cd8), OB_CONST_U64 (0xfb3e148f), OB_CONST_U64 (0x94d56d967974fa8b)}, - {OB_CONST_U64 (0xff85120bd8fa3cd4), OB_CONST_U64 (0xa7a136668d023fec), OB_CONST_U64 (0x8075f6b6), OB_CONST_U64 (0x46293b3bf8cb4b20)}, - {OB_CONST_U64 (0xa37277b9eb9b16fc), OB_CONST_U64 (0xdd4a2f266cd6aa0f), OB_CONST_U64 (0xec9d68b4), OB_CONST_U64 (0x4ce3953baf274ba5)}, - {OB_CONST_U64 (0xb95c558eb132482f), OB_CONST_U64 (0x8b43da48c6f5fd49), OB_CONST_U64 (0xd45f9b8c), OB_CONST_U64 (0x85b24a7ca43e4ec3)}, - {OB_CONST_U64 (0xeb2a51b23ea2f82d), OB_CONST_U64 (0xa8670a39b06b41ce), OB_CONST_U64 (0x9cca7706), OB_CONST_U64 (0x6e35bae16f64d7aa)}, - {OB_CONST_U64 (0xc85dcc13ce7d29c0), OB_CONST_U64 (0xea19bd7ee74ed003), OB_CONST_U64 (0xab04b3fe), OB_CONST_U64 (0x0eda8daea4f4403c)}, - {OB_CONST_U64 (0x8a8707d80cb54c7a), OB_CONST_U64 (0x411cbfa152de1998), OB_CONST_U64 (0x20dd1f76), OB_CONST_U64 (0x0d78822cde8b81f6)}, - {OB_CONST_U64 (0x12c7ffecff1800ba), OB_CONST_U64 (0x44bd867e67fc8ae4), OB_CONST_U64 (0xe3b2414c), OB_CONST_U64 (0x5507d4e51e9a72cd)}, - {OB_CONST_U64 (0xcb16c5c1e342e34d), OB_CONST_U64 (0xd48a476057f23dc8), OB_CONST_U64 (0xb45e5b1d), OB_CONST_U64 (0x5044444dae8597f7)}, - {OB_CONST_U64 (0x27fddd06bd368c50), OB_CONST_U64 (0xb505f7b0690e3f70), OB_CONST_U64 (0xf3045b3c), OB_CONST_U64 (0x456498683cc816f5)}, - {OB_CONST_U64 (0x5e6c6ee85cec7703), OB_CONST_U64 (0xb0d9d93b584d752f), OB_CONST_U64 (0xbb836a1a), OB_CONST_U64 (0x9d192e8fdc627d20)}, - {OB_CONST_U64 (0x2117190446b50f9d), OB_CONST_U64 (0x68a79e0698163241), OB_CONST_U64 (0xf031912f), OB_CONST_U64 (0xbf95123162e07339)}, - {OB_CONST_U64 (0xf3f12b62f51a9b55), OB_CONST_U64 (0x1476fb5f05a37391), OB_CONST_U64 (0xb4d87dcf), OB_CONST_U64 (0x4325cd69f5ac5a30)}, - {OB_CONST_U64 (0x2ee01b9e2a7692a6), OB_CONST_U64 (0xc6cfbcd09cc47583), OB_CONST_U64 (0x89a4601c), OB_CONST_U64 (0x57e8c519e6d11ef3)}, - {OB_CONST_U64 (0x53ca5e2da19191b7), OB_CONST_U64 (0xede0ddbd23d66d73), OB_CONST_U64 (0x61933402), OB_CONST_U64 (0x336f2bea65510c9d)}, - {OB_CONST_U64 (0xce6d0917744faa2f), OB_CONST_U64 (0x0ecece7b7f05004f), OB_CONST_U64 (0x0ea1dfd8), OB_CONST_U64 (0xdb6d2703e4d90298)}, - {OB_CONST_U64 (0xf9b8ca6b46052208), OB_CONST_U64 (0x6e975d1339c4774a), OB_CONST_U64 (0x0b5b78ab), OB_CONST_U64 (0x5efdfe5ba8b2ab16)}, - {OB_CONST_U64 (0xfb1cb91d94d6cddb), OB_CONST_U64 (0xec4df9c3e90f1e24), OB_CONST_U64 (0x692cb7c6), OB_CONST_U64 (0xd7c8ef1a6d0b8a58)}, - {OB_CONST_U64 (0xa39e2eab5f174f15), OB_CONST_U64 (0xc2e46128224f249b), OB_CONST_U64 (0x81350290), OB_CONST_U64 (0xbc9e2c8723c89334)}, - {OB_CONST_U64 (0xe9bfc7e088623326), OB_CONST_U64 (0xe7a09424c5bd6f77), OB_CONST_U64 (0x21e1ac0c), OB_CONST_U64 (0xad5e2ed4fc2fa9a7)}, - {OB_CONST_U64 (0x24d3561ce4eda075), OB_CONST_U64 (0xc979f4ef12661fbd), OB_CONST_U64 (0xfdd6761a), OB_CONST_U64 (0x9fca3261f343627a)}, - {OB_CONST_U64 (0x3edb299037e41adc), OB_CONST_U64 (0x85d3af0877d1b233), OB_CONST_U64 (0xaa300363), OB_CONST_U64 (0xee63da8dbe00ca69)}, - {OB_CONST_U64 (0x4ccafed99120c34c), OB_CONST_U64 (0xd8a2a419bbd61dd4), OB_CONST_U64 (0x39bc1a03), OB_CONST_U64 (0xdccad7de558f0005)}, - {OB_CONST_U64 (0x811039d76b0f5c10), OB_CONST_U64 (0xb9f230a525dd1a79), OB_CONST_U64 (0x6afc61f7), OB_CONST_U64 (0xcccf44e18e5c74ff)}, - {OB_CONST_U64 (0xf26eca16e4f6b311), OB_CONST_U64 (0x7e13d7dbee27de4e), OB_CONST_U64 (0xb66f9abb), OB_CONST_U64 (0x835ffab19dded036)}, - {OB_CONST_U64 (0x8ce51e30cf1501bb), OB_CONST_U64 (0xe12df99407eac10b), OB_CONST_U64 (0x3321c35d), OB_CONST_U64 (0x983119251bb11319)}, - {OB_CONST_U64 (0x80d0fa7707773de4), OB_CONST_U64 (0xd4cb1cb66a739318), OB_CONST_U64 (0x82aa6a32), OB_CONST_U64 (0x0d75b7a845f6ea8e)}, - {OB_CONST_U64 (0x698d6cc716818773), OB_CONST_U64 (0x9502bc1422758522), OB_CONST_U64 (0x7182a0f2), OB_CONST_U64 (0x339f7304dd683ac1)}, - {OB_CONST_U64 (0xcaaa5ff55032cbcf), OB_CONST_U64 (0xe174f0f93d30f0bc), OB_CONST_U64 (0x5aa174a3), OB_CONST_U64 (0xf93eee2c24187e89)}, - {OB_CONST_U64 (0x3333d53faadbec42), OB_CONST_U64 (0x5c95401451994dac), OB_CONST_U64 (0x91e35caa), OB_CONST_U64 (0xb121c680dadc74dc)}, - {OB_CONST_U64 (0x010882aac3dd3587), OB_CONST_U64 (0x2d2e1c962520b6de), OB_CONST_U64 (0xf2457b55), OB_CONST_U64 (0x06ab0b65960a3666)}, - {OB_CONST_U64 (0xb11fde1059b22334), OB_CONST_U64 (0x36af0ce3f9940bdf), OB_CONST_U64 (0xc8cb304a), OB_CONST_U64 (0xe7d76cba98f7b5b5)}, - {OB_CONST_U64 (0x8977ae72ed603d45), OB_CONST_U64 (0xe2b1b66758d158fc), OB_CONST_U64 (0xfae6e6d0), OB_CONST_U64 (0x7a388f4b11498acd)}, - {OB_CONST_U64 (0xf65b17f58e2f82f6), OB_CONST_U64 (0x5e28d4218467b771), OB_CONST_U64 (0x8e8716cd), OB_CONST_U64 (0xa487a6ca35f6e70b)}, - {OB_CONST_U64 (0x063689bb426fad75), OB_CONST_U64 (0xdb08275d11847a43), OB_CONST_U64 (0xf0516dcc), OB_CONST_U64 (0xc363fef0c7d1a13f)}, - {OB_CONST_U64 (0xf09d687ab01da414), OB_CONST_U64 (0x2c48cf28ff80b17f), OB_CONST_U64 (0xa844f66a), OB_CONST_U64 (0x4f40078471fe4dd7)}, - {OB_CONST_U64 (0xf9946308ce8bcec0), OB_CONST_U64 (0x43f83dac819e8271), OB_CONST_U64 (0xb7abdbff), OB_CONST_U64 (0x56b50e216d176240)}, - {OB_CONST_U64 (0x5f2a932916c5c63f), OB_CONST_U64 (0xfba7efcc1e2629e6), OB_CONST_U64 (0x38752a9b), OB_CONST_U64 (0xf6e1f303912a966a)}, - {OB_CONST_U64 (0x3a7933b10ff2e831), OB_CONST_U64 (0x2e552c66fb8678d2), OB_CONST_U64 (0xc5e09d84), OB_CONST_U64 (0x28175ddefdf028e1)}, - {OB_CONST_U64 (0x041f45d562a6689b), OB_CONST_U64 (0x990e39e880dc1533), OB_CONST_U64 (0x3f24ebe0), OB_CONST_U64 (0xa0b4a6134431638a)}, - {OB_CONST_U64 (0xbcec7d59b5858e63), OB_CONST_U64 (0x6dbc1f5cd79cec30), OB_CONST_U64 (0xa16e13f0), OB_CONST_U64 (0x1b142e3b814c58e5)}, - {OB_CONST_U64 (0x82ea92d6830c37ad), OB_CONST_U64 (0x15f84a79fe513c18), OB_CONST_U64 (0xb8bd2db3), OB_CONST_U64 (0xc19a8db5904b1f14)}, - {OB_CONST_U64 (0x27cc4624e3a8fd6c), OB_CONST_U64 (0xac3dce81ee301ebd), OB_CONST_U64 (0xb1d05bbb), OB_CONST_U64 (0xb1949a368f18c440)}, - {OB_CONST_U64 (0xbfa129745aeb3923), OB_CONST_U64 (0x5daefa90bb67c95e), OB_CONST_U64 (0xa3d358f2), OB_CONST_U64 (0x1e913c2c7f3d74f4)}, - {OB_CONST_U64 (0x9b19fb3f08515329), OB_CONST_U64 (0x5d8dd543eb53b5c5), OB_CONST_U64 (0xd9fa710f), OB_CONST_U64 (0x525f4f4ecc6036be)}, - {OB_CONST_U64 (0xb944c2c819b2038d), OB_CONST_U64 (0xbec7b4166eb32958), OB_CONST_U64 (0x57e3ecba), OB_CONST_U64 (0xd69d103b319e3b5d)}, - {OB_CONST_U64 (0x6e8d2803df3b267a), OB_CONST_U64 (0x4b19fa3db0bb8ae1), OB_CONST_U64 (0xe61e275e), OB_CONST_U64 (0x445ae4d0daf854da)}, - {OB_CONST_U64 (0xa5ed64048af45d9d), OB_CONST_U64 (0x7a4a22451f57afc2), OB_CONST_U64 (0x73dbc457), OB_CONST_U64 (0x030a53edea62a0f9)}, - {OB_CONST_U64 (0x6d56acb61a9abe8e), OB_CONST_U64 (0x352075394f788b74), OB_CONST_U64 (0x0ef0dcbd), OB_CONST_U64 (0x7cb0f0589256792e)}, - {OB_CONST_U64 (0x4f03f6750128b16f), OB_CONST_U64 (0xeba0e38bdfb2f415), OB_CONST_U64 (0xdd7e1a06), OB_CONST_U64 (0x81fbb162316cde03)}, - {OB_CONST_U64 (0x6e717510c8e732c4), OB_CONST_U64 (0x18e0ba1d43b19fe8), OB_CONST_U64 (0xbf20480f), OB_CONST_U64 (0xf3eb404f85fe274b)}, - {OB_CONST_U64 (0x6167f57448c6559b), OB_CONST_U64 (0x99414798c789a18b), OB_CONST_U64 (0xfef3790d), OB_CONST_U64 (0xe44369376e46b46d)}, - {OB_CONST_U64 (0x4c445bb3cc5dc033), OB_CONST_U64 (0x60e78440ab5f7a3f), OB_CONST_U64 (0x39b96886), OB_CONST_U64 (0x446bb8e1469291d0)}, - {OB_CONST_U64 (0x3d63ec327c84a0bf), OB_CONST_U64 (0xf0ba798fa143e548), OB_CONST_U64 (0x7c4aafc1), OB_CONST_U64 (0xfdb58d0a8bfbe9dd)}, - {OB_CONST_U64 (0xeab5f4a8d3ec6334), OB_CONST_U64 (0x3381e6aeaa8906cd), OB_CONST_U64 (0x0a25bf71), OB_CONST_U64 (0x5cbb98adc9c94340)}, - {OB_CONST_U64 (0x1ffad87ddc8ca76a), OB_CONST_U64 (0x51fc65a5f15337a2), OB_CONST_U64 (0x236b6d36), OB_CONST_U64 (0x65f127e4b3e704eb)}, - {OB_CONST_U64 (0xfcc3b1db7bb174a0), OB_CONST_U64 (0x7882e4ab6c8cb280), OB_CONST_U64 (0x30866f8c), OB_CONST_U64 (0x665eb3e1c06b412e)}, - {OB_CONST_U64 (0xcffe79062bb4e7cd), OB_CONST_U64 (0x2a616a3eb9110b32), OB_CONST_U64 (0x4e82bf29), OB_CONST_U64 (0x8d4ac664d3c11ca0)}, - {OB_CONST_U64 (0xa21717e2b3d282ee), OB_CONST_U64 (0x429a8a47cea11c02), OB_CONST_U64 (0xc65bc979), OB_CONST_U64 (0xdea840420487b660)}, - {OB_CONST_U64 (0x7e4143da4d878be5), OB_CONST_U64 (0x0c5096fd7847216c), OB_CONST_U64 (0x84972315), OB_CONST_U64 (0xed55699376e0bd50)}, - {OB_CONST_U64 (0x23b80b8bc4e75405), OB_CONST_U64 (0xb58684b753996de8), OB_CONST_U64 (0x466d2020), OB_CONST_U64 (0x5d7dad3d096b33fa)}, - {OB_CONST_U64 (0xa6ae749a1ed10838), OB_CONST_U64 (0xde2661c018abc48c), OB_CONST_U64 (0xa985da3f), OB_CONST_U64 (0x38ad3acdb7cf98fd)}, - {OB_CONST_U64 (0xd4b4a81be36638f2), OB_CONST_U64 (0x43ab0147e976e855), OB_CONST_U64 (0xa481616d), OB_CONST_U64 (0x88edf3e6f89b928c)}, - {OB_CONST_U64 (0x5bab2890f354896d), OB_CONST_U64 (0x3dcc900485630f0f), OB_CONST_U64 (0x570cb610), OB_CONST_U64 (0xa3eb313dd03da792)}, - {OB_CONST_U64 (0x4c0a184632b0499a), OB_CONST_U64 (0x3e4fd6dfe99c67d2), OB_CONST_U64 (0xbe6bc50d), OB_CONST_U64 (0x559759f714bb822f)}, - {OB_CONST_U64 (0xb45a39714746ec86), OB_CONST_U64 (0x2dd11909380bb2cd), OB_CONST_U64 (0x2f3b176a), OB_CONST_U64 (0xf4d5fbbc54a81bae)}, - {OB_CONST_U64 (0xc4b90839e91abfb2), OB_CONST_U64 (0x4a7ed592a3a82dd4), OB_CONST_U64 (0xd709df71), OB_CONST_U64 (0x55fd0b00d43cb1be)}, - {OB_CONST_U64 (0xe81d35c8ed7827fe), OB_CONST_U64 (0x207dc323cb840325), OB_CONST_U64 (0x0ec6c582), OB_CONST_U64 (0x00b3de6689e4ff89)}, - {OB_CONST_U64 (0x587c5ee43e034ebd), OB_CONST_U64 (0xaf9c82c94dfcda1f), OB_CONST_U64 (0x85bb0a79), OB_CONST_U64 (0x720ac0fa539dc3d6)}, - {OB_CONST_U64 (0xb1ec87f8823040ac), OB_CONST_U64 (0xd41677026942ade4), OB_CONST_U64 (0x070e7748), OB_CONST_U64 (0x31957a1396e3f233)}, - {OB_CONST_U64 (0x7677dff12f92fbd9), OB_CONST_U64 (0xedcd974aa7488258), OB_CONST_U64 (0x11bff4c4), OB_CONST_U64 (0x9d5a3d74b6287159)}, - {OB_CONST_U64 (0xb69cea6e5a0e28fd), OB_CONST_U64 (0x57dedae1b68ddd05), OB_CONST_U64 (0x40ab8430), OB_CONST_U64 (0x1851a13837a6a05a)}, - {OB_CONST_U64 (0xf7180ae2e0f325e5), OB_CONST_U64 (0x500adca11f8e94de), OB_CONST_U64 (0x605f6572), OB_CONST_U64 (0xa9c4e81fa446dc5c)}, - {OB_CONST_U64 (0xa08d214869e84ccf), OB_CONST_U64 (0x6ca21154a2193f1e), OB_CONST_U64 (0xe9a22f5e), OB_CONST_U64 (0x17fb1dbc75adbbdd)}, - {OB_CONST_U64 (0xcfff666740e2f99f), OB_CONST_U64 (0xd12ba6e50904b61f), OB_CONST_U64 (0xe58efb08), OB_CONST_U64 (0x7c5a62263fa9f3d2)}, - {OB_CONST_U64 (0x2fc743551c71634e), OB_CONST_U64 (0x5ae234ee018ecf0b), OB_CONST_U64 (0x4abf3a62), OB_CONST_U64 (0x1c8fb93868045b98)}, - {OB_CONST_U64 (0x9bf4d77b464c9435), OB_CONST_U64 (0xbad6a2d23cb69f3f), OB_CONST_U64 (0x40798637), OB_CONST_U64 (0xe95032ce07d3a101)}, - {OB_CONST_U64 (0x5e6b758083214c84), OB_CONST_U64 (0x4a8d4e03e37c386a), OB_CONST_U64 (0x546d8f39), OB_CONST_U64 (0xe5ddc56338e80835)}, - {OB_CONST_U64 (0x40548138ef68aa78), OB_CONST_U64 (0x9b08bb741da55929), OB_CONST_U64 (0x581ad0db), OB_CONST_U64 (0x23ad2c3b4ae456a5)}, - {OB_CONST_U64 (0x7c6b73ef50249070), OB_CONST_U64 (0x6d3fd907de23f5ee), OB_CONST_U64 (0x1a323917), OB_CONST_U64 (0xd8956d912f7ff636)}, - {OB_CONST_U64 (0x462a1dc5b9cb1b3b), OB_CONST_U64 (0x6b34023aa308a14d), OB_CONST_U64 (0xd684a5fd), OB_CONST_U64 (0xb01d6a0855888474)}, - {OB_CONST_U64 (0xb8b156aa6c884b21), OB_CONST_U64 (0xdab9fa981067044f), OB_CONST_U64 (0xa2a457bb), OB_CONST_U64 (0x98d48686034e3bbc)}, - {OB_CONST_U64 (0xc7afcc722488f9e6), OB_CONST_U64 (0x97c923f4604fdcf4), OB_CONST_U64 (0xe3b0fc15), OB_CONST_U64 (0x2d601b6077705851)}, - {OB_CONST_U64 (0x7a45b5b10dc24dbc), OB_CONST_U64 (0x7f807ade405b7144), OB_CONST_U64 (0x193ea9e5), OB_CONST_U64 (0x5ea6133d2cc9f9e5)}, - {OB_CONST_U64 (0xefe499d7a567391d), OB_CONST_U64 (0xdb5b75c40a8d6871), OB_CONST_U64 (0x9be696af), OB_CONST_U64 (0xce1e4caf6c8b33fb)}, - {OB_CONST_U64 (0xb60d26b461d05e25), OB_CONST_U64 (0xa33941259a71f695), OB_CONST_U64 (0x4ab8c08c), OB_CONST_U64 (0x384a7fe8571b5d95)}, - {OB_CONST_U64 (0xc15d366b98d92986), OB_CONST_U64 (0x5dc43a61cfcdab12), OB_CONST_U64 (0x34647a34), OB_CONST_U64 (0x6c5628cd34f6b815)}, - {OB_CONST_U64 (0x9addb551a523df05), OB_CONST_U64 (0x80019fdf97a7e7af), OB_CONST_U64 (0x0d95d3a2), OB_CONST_U64 (0x5b23acfe0de60665)}, - {OB_CONST_U64 (0xbd0a37a2ad2465b9), OB_CONST_U64 (0xf13fdd1a783dea5b), OB_CONST_U64 (0x17dd8c77), OB_CONST_U64 (0x70e733091290b28d)}, - {OB_CONST_U64 (0xe7a7162d930c5056), OB_CONST_U64 (0x98d7152acf6aead9), OB_CONST_U64 (0x7debd7f2), OB_CONST_U64 (0x4afd16687b833020)}, - {OB_CONST_U64 (0xb9982c5395b09406), OB_CONST_U64 (0xccb79281b0518ea2), OB_CONST_U64 (0xf12cf02e), OB_CONST_U64 (0x2f16dcda901491c0)}, - {OB_CONST_U64 (0xe41766d004eef8fd), OB_CONST_U64 (0x1762a40c971c5256), OB_CONST_U64 (0x3213f3ee), OB_CONST_U64 (0xe119fb7dd86e3a4a)}, - {OB_CONST_U64 (0xa3074a96c88c47de), OB_CONST_U64 (0x7a3010c27a54bf5b), OB_CONST_U64 (0xa36aba5e), OB_CONST_U64 (0xe2441ff6c0b3fac4)}, - {OB_CONST_U64 (0x881caa3913271394), OB_CONST_U64 (0x76ac64366b6f5660), OB_CONST_U64 (0x064e752d), OB_CONST_U64 (0x3528c5346ee361be)}, - {OB_CONST_U64 (0x77d95a600f824230), OB_CONST_U64 (0x7547f8e9b3d7d3bc), OB_CONST_U64 (0x1b5aaae9), OB_CONST_U64 (0x084bf5d508f09f35)}, - {OB_CONST_U64 (0x1984adb7bcfec495), OB_CONST_U64 (0xc4d5f5af08537d31), OB_CONST_U64 (0x656680df), OB_CONST_U64 (0xb643669b38d02e45)}, - {OB_CONST_U64 (0x66f613698d2263a7), OB_CONST_U64 (0x50723eb3c45bba59), OB_CONST_U64 (0x123b8ddb), OB_CONST_U64 (0xf8370abb824a0846)}, - {OB_CONST_U64 (0x50cf2a1c284f5a5a), OB_CONST_U64 (0x3762f19bdf869c75), OB_CONST_U64 (0x5c91f0ab), OB_CONST_U64 (0x23ccdab872ca8559)}, +static const unt64 testdata[kTestSize][4] = { + {OB_CONST_U64 (0x9ae16a3b2f90404f), OB_CONST_U64 (0x3feac5f636039766), + OB_CONST_U64 (0xdec09576), OB_CONST_U64 (0x7678f0163a1eb872)}, + {OB_CONST_U64 (0x75e9dee28ded761d), OB_CONST_U64 (0x245eeb25ba2c172e), + OB_CONST_U64 (0x4e85c798), OB_CONST_U64 (0x2c8ed2401fa1a20b)}, + {OB_CONST_U64 (0x75de892fdc5ba914), OB_CONST_U64 (0x39a82df1f278a297), + OB_CONST_U64 (0xbe5c9477), OB_CONST_U64 (0x7875934b73d6f859)}, + {OB_CONST_U64 (0x69cfe9fca1cc683a), OB_CONST_U64 (0x20575ea6370a9d14), + OB_CONST_U64 (0xf2229b30), OB_CONST_U64 (0x120c187f6f60153a)}, + {OB_CONST_U64 (0x675b04c582a34966), OB_CONST_U64 (0xc412e0931ac8c9b1), + OB_CONST_U64 (0xc892b7ed), OB_CONST_U64 (0x7aa69ab5e0487a86)}, + {OB_CONST_U64 (0x46fa817397ea8b68), OB_CONST_U64 (0xe5f9f947bafb9e79), + OB_CONST_U64 (0xc72ff94c), OB_CONST_U64 (0x2b5768d240808cb1)}, + {OB_CONST_U64 (0x406e959cdffadec7), OB_CONST_U64 (0xe5beb146d4b79a21), + OB_CONST_U64 (0x05d38695), OB_CONST_U64 (0xeb5dc781600cb103)}, + {OB_CONST_U64 (0x46663908b4169b95), OB_CONST_U64 (0xdc660b58daaf8b2c), + OB_CONST_U64 (0x18bd8f1f), OB_CONST_U64 (0xd0c1330e4b75b0a4)}, + {OB_CONST_U64 (0xf214b86cffeab596), OB_CONST_U64 (0x86e7aa8b4154b883), + OB_CONST_U64 (0xc5f386e1), OB_CONST_U64 (0xb56c72801e4f5bae)}, + {OB_CONST_U64 (0xeba670441d1a4f7d), OB_CONST_U64 (0x69f8d424d50c083e), + OB_CONST_U64 (0x9b1488d7), OB_CONST_U64 (0x7c460a659073de89)}, + {OB_CONST_U64 (0x172c17ff21dbf88d), OB_CONST_U64 (0x1e34e9f1fa63bcef), + OB_CONST_U64 (0xdd4ecaf6), OB_CONST_U64 (0xa27f68736ebe04e2)}, + {OB_CONST_U64 (0x5a0838df8a019b8c), OB_CONST_U64 (0x45e39daf153491bd), + OB_CONST_U64 (0xdb57563d), OB_CONST_U64 (0x0600ff191c6ae4ba)}, + {OB_CONST_U64 (0x8f42b1fbb2fc0302), OB_CONST_U64 (0xb87f0cb67cb75d28), + OB_CONST_U64 (0xc5ef9366), OB_CONST_U64 (0x4e7fb72b2c82a98c)}, + {OB_CONST_U64 (0x72085e82d70dcea9), OB_CONST_U64 (0x5ebc98c3645a018f), + OB_CONST_U64 (0x944adf0d), OB_CONST_U64 (0x5737f49ec72d3e06)}, + {OB_CONST_U64 (0x32b75fc2223b5032), OB_CONST_U64 (0xa6fdbc82c9aeecc0), + OB_CONST_U64 (0x4075beef), OB_CONST_U64 (0x61d804a5411e51f9)}, + {OB_CONST_U64 (0xe1dd010487d2d647), OB_CONST_U64 (0xacc5e9b6f6b02dbb), + OB_CONST_U64 (0xc51b53a9), OB_CONST_U64 (0x534a066b75bee7d7)}, + {OB_CONST_U64 (0x2994f9245194a7e2), OB_CONST_U64 (0x2170a7d119c5c6c3), + OB_CONST_U64 (0x5f16d489), OB_CONST_U64 (0x2273ac2a6887ef64)}, + {OB_CONST_U64 (0x32e2ed6fa03e5b22), OB_CONST_U64 (0xa9c599f3f8f50b5b), + OB_CONST_U64 (0x84aad0b0), OB_CONST_U64 (0xfcd6f551816ef7e2)}, + {OB_CONST_U64 (0x37a72b6e89410c9f), OB_CONST_U64 (0x4fccd8f0da7575c3), + OB_CONST_U64 (0x8075e268), OB_CONST_U64 (0x13a59610f8d3153c)}, + {OB_CONST_U64 (0x10836563cb8ff3a1), OB_CONST_U64 (0xedc1bb6a3dcba8df), + OB_CONST_U64 (0xd3e41a32), OB_CONST_U64 (0x942e5fe5f2771c01)}, + {OB_CONST_U64 (0x4dabcb5c1d382e5c), OB_CONST_U64 (0x7b2b6c389b943be5), + OB_CONST_U64 (0xa13710e2), OB_CONST_U64 (0xf4474261894299a1)}, + {OB_CONST_U64 (0x296afb509046d945), OB_CONST_U64 (0xd7b17535df110279), + OB_CONST_U64 (0xda970937), OB_CONST_U64 (0xede3477705173116)}, + {OB_CONST_U64 (0xf7c0257efde772ea), OB_CONST_U64 (0x1cdff4bd07e8d973), + OB_CONST_U64 (0x2bad6ecc), OB_CONST_U64 (0x1fb7eec00594c0c3)}, + {OB_CONST_U64 (0x61e021c8da344ba1), OB_CONST_U64 (0x354ffa8e9d3601f6), + OB_CONST_U64 (0x48963682), OB_CONST_U64 (0x5627bcf480863f1d)}, + {OB_CONST_U64 (0xc0a86ed83908560b), OB_CONST_U64 (0xa99bf2891726ea93), + OB_CONST_U64 (0x580c1239), OB_CONST_U64 (0x52c4f2dbcc0b79eb)}, + {OB_CONST_U64 (0x35c9cf87e4accbf3), OB_CONST_U64 (0x080217695666b2c9), + OB_CONST_U64 (0x7bee29d1), OB_CONST_U64 (0xb254693967a7c94b)}, + {OB_CONST_U64 (0xe74c366b3091e275), OB_CONST_U64 (0xca9afa806f1a54ac), + OB_CONST_U64 (0x61b76780), OB_CONST_U64 (0x8374accf4a2a529d)}, + {OB_CONST_U64 (0xa3f2ca45089ad1a6), OB_CONST_U64 (0x1f93a534bf03e705), + OB_CONST_U64 (0x4a071941), OB_CONST_U64 (0x72a07f38de9eab62)}, + {OB_CONST_U64 (0xe5181466d8e60e26), OB_CONST_U64 (0xd9cee87cb71f75b2), + OB_CONST_U64 (0x209f7c6a), OB_CONST_U64 (0x75180d35aa86468e)}, + {OB_CONST_U64 (0xfb528a8dd1e48ad7), OB_CONST_U64 (0x04abd8fc3377ae1f), + OB_CONST_U64 (0xc697bead), OB_CONST_U64 (0x4c4655e1731ad9f2)}, + {OB_CONST_U64 (0xda6d2b7ea9d5f9b6), OB_CONST_U64 (0x7d3bd1256037142f), + OB_CONST_U64 (0xaa5e47f0), OB_CONST_U64 (0xec564db430a27b6e)}, + {OB_CONST_U64 (0x061d95225bc2293e), OB_CONST_U64 (0x91a0667a7ed6a113), + OB_CONST_U64 (0xd1fbb72a), OB_CONST_U64 (0xc0d8f471f2cac6da)}, + {OB_CONST_U64 (0x81247c01ab6a9cc1), OB_CONST_U64 (0xae18965000c31be0), + OB_CONST_U64 (0x7c9ce289), OB_CONST_U64 (0x5c5ae4854c87eb5d)}, + {OB_CONST_U64 (0xc17f3ebd3257cb8b), OB_CONST_U64 (0x72a5572be35bfc1b), + OB_CONST_U64 (0x48badc43), OB_CONST_U64 (0x1f4fdac9456eeb4f)}, + {OB_CONST_U64 (0x9802438969c3043b), OB_CONST_U64 (0x83e26b6830ea8640), + OB_CONST_U64 (0x78f88ac5), OB_CONST_U64 (0x93e63e958d309218)}, + {OB_CONST_U64 (0x3dd8ed248a03d754), OB_CONST_U64 (0x87a822141ed64927), + OB_CONST_U64 (0xfa19d2c4), OB_CONST_U64 (0x3b023d96d311209a)}, + {OB_CONST_U64 (0xc5bf48d7d3e9a5a3), OB_CONST_U64 (0xc6d2c8a606f45125), + OB_CONST_U64 (0x93de51e2), OB_CONST_U64 (0xe63b550c2d4038bd)}, + {OB_CONST_U64 (0xbc4a21d00cf52288), OB_CONST_U64 (0x06081bbc2a18dd0d), + OB_CONST_U64 (0xfd45b25f), OB_CONST_U64 (0x31ede87349024719)}, + {OB_CONST_U64 (0x172c8674913ff413), OB_CONST_U64 (0x7e011f9467a06650), + OB_CONST_U64 (0x647998cb), OB_CONST_U64 (0x5367e33b7ad89fe5)}, + {OB_CONST_U64 (0x17a361dbdaaa7294), OB_CONST_U64 (0xf49cf8d51ab583d2), + OB_CONST_U64 (0x9adba898), OB_CONST_U64 (0x2122670880fb2ca7)}, + {OB_CONST_U64 (0x05cc268bac4bd55f), OB_CONST_U64 (0x38da1393365c961d), + OB_CONST_U64 (0x83c0baf1), OB_CONST_U64 (0x4a5b79f788781393)}, + {OB_CONST_U64 (0xdb04969cc06547f1), OB_CONST_U64 (0x967ccec4ed0c977e), + OB_CONST_U64 (0xe605b134), OB_CONST_U64 (0xd75b0fde97f8857c)}, + {OB_CONST_U64 (0x25bd8d3ca1b375b2), OB_CONST_U64 (0x9be30ad32f8f28aa), + OB_CONST_U64 (0x32a72bea), OB_CONST_U64 (0x711c1f637a1df80c)}, + {OB_CONST_U64 (0x166c11fbcbc89fd8), OB_CONST_U64 (0x78908959b8ede084), + OB_CONST_U64 (0xbd025b4c), OB_CONST_U64 (0x6b2d95868a93add8)}, + {OB_CONST_U64 (0x3565bcc4ca4ce807), OB_CONST_U64 (0x6a1f690d886e0270), + OB_CONST_U64 (0x0e425cbc), OB_CONST_U64 (0xf495df5ee784a8bb)}, + {OB_CONST_U64 (0xb7897fd2f274307d), OB_CONST_U64 (0x31a2218e64d8fce0), + OB_CONST_U64 (0x2bb5f919), OB_CONST_U64 (0x7a320f115a6c14c6)}, + {OB_CONST_U64 (0xaba98113ab0e4a16), OB_CONST_U64 (0x3ecd2a607193ba3b), + OB_CONST_U64 (0x7e2dc1f2), OB_CONST_U64 (0x5a42a92198c70c8a)}, + {OB_CONST_U64 (0x17f7796e0d4b636c), OB_CONST_U64 (0x65f9735375df1ada), + OB_CONST_U64 (0x9718242b), OB_CONST_U64 (0x6c4fb6bfed558071)}, + {OB_CONST_U64 (0x33c0128e62122440), OB_CONST_U64 (0xf2608199ca14c26a), + OB_CONST_U64 (0x5841ff43), OB_CONST_U64 (0x32f9e904ede0fd06)}, + {OB_CONST_U64 (0x988bc5d290b97aef), OB_CONST_U64 (0x44b5cf8b5b8106a8), + OB_CONST_U64 (0x7d2d36d0), OB_CONST_U64 (0xd3b73e613025573b)}, + {OB_CONST_U64 (0x23c8c25c2ab72381), OB_CONST_U64 (0x6aef5e6eb4a4eb10), + OB_CONST_U64 (0x26892a33), OB_CONST_U64 (0x38d5c43f03f76844)}, + {OB_CONST_U64 (0x450fe4acc4ad3749), OB_CONST_U64 (0xdb570fc2abaf13a9), + OB_CONST_U64 (0x27132ca4), OB_CONST_U64 (0x7587e038073d8977)}, + {OB_CONST_U64 (0x48e1eff032d90c50), OB_CONST_U64 (0xc845776990c96775), + OB_CONST_U64 (0x84c11bd5), OB_CONST_U64 (0x136e45b9b60410ac)}, + {OB_CONST_U64 (0xc048604ba8b6c753), OB_CONST_U64 (0x4e40a127ad2d6834), + OB_CONST_U64 (0xd1307524), OB_CONST_U64 (0x0368f142c482b474)}, + {OB_CONST_U64 (0x67ff1cbe469ebf84), OB_CONST_U64 (0x85bf1ad6b363a14b), + OB_CONST_U64 (0x4d666715), OB_CONST_U64 (0x2799641f84e9c19f)}, + {OB_CONST_U64 (0xb45c7536bd7a5416), OB_CONST_U64 (0xb70b641138765ff5), + OB_CONST_U64 (0x95958f0d), OB_CONST_U64 (0x02b3f524041298cf)}, + {OB_CONST_U64 (0x215c2eaacdb48f6f), OB_CONST_U64 (0x078c4e94ba9f28bf), + OB_CONST_U64 (0x260c2076), OB_CONST_U64 (0x9097aef0fd761c33)}, + {OB_CONST_U64 (0x241baf16d80e0fe8), OB_CONST_U64 (0x6ae6b36209eecd70), + OB_CONST_U64 (0x77b0b654), OB_CONST_U64 (0x4b81699dd420b70f)}, + {OB_CONST_U64 (0xd10a9743b5b1c4d1), OB_CONST_U64 (0xfbd20a91b6085ed3), + OB_CONST_U64 (0xdc2141d7), OB_CONST_U64 (0x6dcbd5a2ebcfd061)}, + {OB_CONST_U64 (0x919ef9e209f2edd1), OB_CONST_U64 (0x00540353f94e8033), + OB_CONST_U64 (0x1adbf546), OB_CONST_U64 (0xf676660ca4d826fd)}, + {OB_CONST_U64 (0x0b5f9519b6c9280b), OB_CONST_U64 (0xd379a205a3bd4660), + OB_CONST_U64 (0x20ab6975), OB_CONST_U64 (0x53ad41972a8138a0)}, + {OB_CONST_U64 (0x77a75e89679e6757), OB_CONST_U64 (0xd81f2dfd08890060), + OB_CONST_U64 (0x5514da97), OB_CONST_U64 (0x223850d6e1b33c7e)}, + {OB_CONST_U64 (0x9d709e1b086aabe2), OB_CONST_U64 (0xdf73b01acd416e84), + OB_CONST_U64 (0x0660852f), OB_CONST_U64 (0x43ddc71378ac41f9)}, + {OB_CONST_U64 (0x91c89971b3c20a8a), OB_CONST_U64 (0xbc47bb80dfdaefcd), + OB_CONST_U64 (0x3b1f578e), OB_CONST_U64 (0x508284a7e7bb5928)}, + {OB_CONST_U64 (0x16468c55a1b3f2b4), OB_CONST_U64 (0x143adc6fee592576), + OB_CONST_U64 (0xf410f8f0), OB_CONST_U64 (0x0ad5d860d1a556cc)}, + {OB_CONST_U64 (0x8015f298161f861e), OB_CONST_U64 (0x37b223562c48b473), + OB_CONST_U64 (0xc6a7cd79), OB_CONST_U64 (0xa851af0175c557ae)}, + {OB_CONST_U64 (0x71e244d7e2843a41), OB_CONST_U64 (0x1791b7a5b93ad1f9), + OB_CONST_U64 (0x0ed77012), OB_CONST_U64 (0x1e99355f076eb276)}, + {OB_CONST_U64 (0x5d3cb0d2c7ccf11f), OB_CONST_U64 (0xea833d94dca4809a), + OB_CONST_U64 (0xe571b90a), OB_CONST_U64 (0x1e87ef9748f93ec9)}, + {OB_CONST_U64 (0xd6cffe6c223aba65), OB_CONST_U64 (0x67268f8829a9f99d), + OB_CONST_U64 (0x2a32f349), OB_CONST_U64 (0x48a58f215c151b10)}, + {OB_CONST_U64 (0x8a17c5054e85e2be), OB_CONST_U64 (0x9b345fa359c4e8e3), + OB_CONST_U64 (0x963330fd), OB_CONST_U64 (0x69649a9c54ab0d01)}, + {OB_CONST_U64 (0x77d112a0b7084c6a), OB_CONST_U64 (0xa3c8f877e8ebc840), + OB_CONST_U64 (0x0bdcd0e0), OB_CONST_U64 (0xc1bb0c27946d773f)}, + {OB_CONST_U64 (0x708f2a6e8bd57583), OB_CONST_U64 (0xd28955c99ed63d38), + OB_CONST_U64 (0xb87dc444), OB_CONST_U64 (0x73a5f5b744f57654)}, + {OB_CONST_U64 (0x50bc8f76b62c8de9), OB_CONST_U64 (0xda08ee1bf528e82e), + OB_CONST_U64 (0x0e493311), OB_CONST_U64 (0x54eb66b6bed8cdff)}, + {OB_CONST_U64 (0x8b15a656b553641a), OB_CONST_U64 (0xa051cbbf796013c1), + OB_CONST_U64 (0x86fc4e19), OB_CONST_U64 (0x65522cbed0be9571)}, + {OB_CONST_U64 (0x6ba74ccf722a52be), OB_CONST_U64 (0x32e95f14d29a1c01), + OB_CONST_U64 (0x1494e01f), OB_CONST_U64 (0x39e39ac7b3d02e1d)}, + {OB_CONST_U64 (0xfb317bb7533454d0), OB_CONST_U64 (0x593d179631ddf22c), + OB_CONST_U64 (0x95599cb1), OB_CONST_U64 (0x0bb6a2b8b7c8ea81)}, + {OB_CONST_U64 (0x8eec643f62c90fea), OB_CONST_U64 (0x62fa77ed321e937f), + OB_CONST_U64 (0x84fc499e), OB_CONST_U64 (0xe64e02f824380f19)}, + {OB_CONST_U64 (0x81ce6becdf10dff2), OB_CONST_U64 (0xdb5cb16e44cb1e37), + OB_CONST_U64 (0x4cc8cdb0), OB_CONST_U64 (0x7ddf32e47426424a)}, + {OB_CONST_U64 (0x549c669fb0049f69), OB_CONST_U64 (0x675a9a86499cd4e4), + OB_CONST_U64 (0x145a7958), OB_CONST_U64 (0x5a1eef2ce790329d)}, + {OB_CONST_U64 (0x2b6a3433940bbf2d), OB_CONST_U64 (0x812bcb2a17f1f652), + OB_CONST_U64 (0x1a2d0277), OB_CONST_U64 (0xe6eaa23c531ae775)}, + {OB_CONST_U64 (0xd80b7a3c691401b7), OB_CONST_U64 (0x8e44beb4b7cde31b), + OB_CONST_U64 (0x253fd8c9), OB_CONST_U64 (0x5ea1e5a33a00bec5)}, + {OB_CONST_U64 (0xab3bf6b494f66ef3), OB_CONST_U64 (0x383cc50df33afc6f), + OB_CONST_U64 (0xeb48ec69), OB_CONST_U64 (0x29eb16239c5037cc)}, + {OB_CONST_U64 (0x83f7b824a3911d44), OB_CONST_U64 (0x13c001ebba408aaa), + OB_CONST_U64 (0x15501a6e), OB_CONST_U64 (0xd782115f871ba789)}, + {OB_CONST_U64 (0x3fb8d482d0d9d03f), OB_CONST_U64 (0x96ebbf1ceac7b4cb), + OB_CONST_U64 (0x9cd3cf59), OB_CONST_U64 (0x5894ba9f6170fe16)}, + {OB_CONST_U64 (0xad346a1f100b3944), OB_CONST_U64 (0x77664abec282db4c), + OB_CONST_U64 (0xee8c6c74), OB_CONST_U64 (0xf461a205ab40bfe8)}, + {OB_CONST_U64 (0xdb210eb547a3dbc5), OB_CONST_U64 (0x4ca87abbb73194d8), + OB_CONST_U64 (0xed28ad5c), OB_CONST_U64 (0x2113a98d39f4d31c)}, + {OB_CONST_U64 (0xe55fab4f920abdc0), OB_CONST_U64 (0x6f67cf7344c18fce), + OB_CONST_U64 (0xcc3cced7), OB_CONST_U64 (0x008d8386b0dd439d)}, + {OB_CONST_U64 (0x3b530fff7e848c5e), OB_CONST_U64 (0x4340e5798860241a), + OB_CONST_U64 (0x26231582), OB_CONST_U64 (0xa4e9eb6db74b4534)}, + {OB_CONST_U64 (0xbde3379279d1cae1), OB_CONST_U64 (0x9f070e7509abc6bf), + OB_CONST_U64 (0xcfe03f57), OB_CONST_U64 (0x189ee9bbe0732501)}, + {OB_CONST_U64 (0x4008062bc7755b37), OB_CONST_U64 (0x4502cd3133c94d7d), + OB_CONST_U64 (0x1b98d193), OB_CONST_U64 (0xbd6c66f578831956)}, + {OB_CONST_U64 (0x76a66ce0ee8094d1), OB_CONST_U64 (0x83b12c2aff5dd46e), + OB_CONST_U64 (0x3fa1e23f), OB_CONST_U64 (0xfd32c55a814c4579)}, + {OB_CONST_U64 (0x2bc3dfb3b1756918), OB_CONST_U64 (0x52c60b61184e08de), + OB_CONST_U64 (0x09b3e288), OB_CONST_U64 (0x2264268c78fd42c8)}, + {OB_CONST_U64 (0xd060dc1e8ca204ee), OB_CONST_U64 (0x1f120ffb0524d537), + OB_CONST_U64 (0xcb19d348), OB_CONST_U64 (0x9d4d58317482a536)}, + {OB_CONST_U64 (0xc8ec4fc839254a74), OB_CONST_U64 (0xd6a77d7a8c6d11f4), + OB_CONST_U64 (0xc89d6d86), OB_CONST_U64 (0x7038877f940915f8)}, + {OB_CONST_U64 (0x7cdf98a07b1315b0), OB_CONST_U64 (0x0d2480e4e97602ad), + OB_CONST_U64 (0x586cc72f), OB_CONST_U64 (0xb1a55580d0a1ea94)}, + {OB_CONST_U64 (0x78284cb5c0143ed8), OB_CONST_U64 (0x71d171a63a6187b5), + OB_CONST_U64 (0x655cf59e), OB_CONST_U64 (0x270614d5542392f3)}, + {OB_CONST_U64 (0x5c2c485bdc8e3317), OB_CONST_U64 (0x6b433526b05fc4d8), + OB_CONST_U64 (0x6b581138), OB_CONST_U64 (0x70433126e160b999)}, + {OB_CONST_U64 (0x6e38acb798627f75), OB_CONST_U64 (0x766ef46cf807f655), + OB_CONST_U64 (0x26550b5a), OB_CONST_U64 (0xbe354ed28da71552)}, + {OB_CONST_U64 (0xc5fb48f0939b4878), OB_CONST_U64 (0x6d36a844bb3f3360), + OB_CONST_U64 (0xc710cec5), OB_CONST_U64 (0x0c08698221559bc5)}, + {OB_CONST_U64 (0x0292da6390260110), OB_CONST_U64 (0xf843ecb8366f0809), + OB_CONST_U64 (0x63a0800f), OB_CONST_U64 (0xc8dd9110875c2fa1)}, + {OB_CONST_U64 (0x1e0ee26b7044741b), OB_CONST_U64 (0xb24891afcb0faa49), + OB_CONST_U64 (0xaff7df8c), OB_CONST_U64 (0x8040ddb247bf497f)}, + {OB_CONST_U64 (0x69b8f7e762db77ec), OB_CONST_U64 (0xb1e8e3f0f5c9037e), + OB_CONST_U64 (0xf05014b1), OB_CONST_U64 (0xff09fea8a55c4662)}, + {OB_CONST_U64 (0x9b321366d6585031), OB_CONST_U64 (0x3b7321189816fdcc), + OB_CONST_U64 (0x0b814a2e), OB_CONST_U64 (0x69e47772c90fe4c5)}, + {OB_CONST_U64 (0x9375c89169bf70cf), OB_CONST_U64 (0x3ab599efd811ae97), + OB_CONST_U64 (0xdff4a026), OB_CONST_U64 (0xf81c2c819b274b2f)}, + {OB_CONST_U64 (0xa8db1643cc52d94d), OB_CONST_U64 (0x925b29c3dbfea463), + OB_CONST_U64 (0xe51b5324), OB_CONST_U64 (0x0d19829a9daee02f)}, + {OB_CONST_U64 (0xcf7a9ea6a7a30dee), OB_CONST_U64 (0x6793c6e1fad303dd), + OB_CONST_U64 (0xa54188c2), OB_CONST_U64 (0x565963a1a008b17e)}, + {OB_CONST_U64 (0x42c2e9f84dc7f129), OB_CONST_U64 (0x0216a0d505d49b80), + OB_CONST_U64 (0xf656e374), OB_CONST_U64 (0xdcc457d95bb94b35)}, + {OB_CONST_U64 (0x394c2c1cca4e9271), OB_CONST_U64 (0x5113e80f2555b54c), + OB_CONST_U64 (0x1577b7cf), OB_CONST_U64 (0xee977883cc2f003c)}, + {OB_CONST_U64 (0xd38df9e9740cb16c), OB_CONST_U64 (0xa15ead26a317837e), + OB_CONST_U64 (0x19adf32e), OB_CONST_U64 (0xca8f4f5838e8cce9)}, + {OB_CONST_U64 (0xec12466d1379cfdf), OB_CONST_U64 (0x1407e7cad8d977df), + OB_CONST_U64 (0xf16bddf9), OB_CONST_U64 (0x89e3b52c15a26c5b)}, + {OB_CONST_U64 (0x9050986d9ced6a2e), OB_CONST_U64 (0xb16a21f3ae8ddaf4), + OB_CONST_U64 (0x96096a72), OB_CONST_U64 (0x9a12c3fa15055b73)}, + {OB_CONST_U64 (0xc7362967930e8a48), OB_CONST_U64 (0x96e9b973fe114561), + OB_CONST_U64 (0x909af69c), OB_CONST_U64 (0xc46c02c67615746a)}, + {OB_CONST_U64 (0x47bd8137d464eab3), OB_CONST_U64 (0x499063daa6e4eae3), + OB_CONST_U64 (0xa567056a), OB_CONST_U64 (0x8d354e14449fde3a)}, + {OB_CONST_U64 (0xcff30d9303db2dfe), OB_CONST_U64 (0xb2d9cc739ab9f148), + OB_CONST_U64 (0x8b0eded5), OB_CONST_U64 (0xddc86739148bf938)}, + {OB_CONST_U64 (0x8d086fc30b6694b2), OB_CONST_U64 (0xf24a7ec2f48b6809), + OB_CONST_U64 (0x099c0a25), OB_CONST_U64 (0x94d3b7741e488ac5)}, + {OB_CONST_U64 (0xb7d681356bdd9e4f), OB_CONST_U64 (0xe8f5fbafde7bea61), + OB_CONST_U64 (0x1548b82f), OB_CONST_U64 (0x8e47a2340ebb3601)}, + {OB_CONST_U64 (0x5bb01fcb2e6ad355), OB_CONST_U64 (0x1f7a98978f1bf049), + OB_CONST_U64 (0x38f69920), OB_CONST_U64 (0x9673eb5b2231f3ac)}, + {OB_CONST_U64 (0xcd2ff001a80d1b11), OB_CONST_U64 (0x5df56e499e9ca980), + OB_CONST_U64 (0x3261c992), OB_CONST_U64 (0x40f4531ee98c27b6)}, + {OB_CONST_U64 (0x8bfbf611401100cd), OB_CONST_U64 (0x056b61ed81d29796), + OB_CONST_U64 (0x64b52009), OB_CONST_U64 (0xe71f818de60cd8ca)}, + {OB_CONST_U64 (0xec9ae0cf9290d012), OB_CONST_U64 (0xde04cc7d2c562fcf), + OB_CONST_U64 (0x2ff97516), OB_CONST_U64 (0x0c025a58cafb90ea)}, + {OB_CONST_U64 (0x4ac2a5e9dc03176d), OB_CONST_U64 (0xe5fcbc1dfe65f7db), + OB_CONST_U64 (0xc74fba39), OB_CONST_U64 (0x8ec1168f7e078784)}, + {OB_CONST_U64 (0x5fd51f635bc557a8), OB_CONST_U64 (0x603d74dd65a3baf6), + OB_CONST_U64 (0xe3e6d95e), OB_CONST_U64 (0xd5a676e984e3d2a6)}, + {OB_CONST_U64 (0xec3521e8efdb1779), OB_CONST_U64 (0xa372b6a2f501313c), + OB_CONST_U64 (0xa1d0c39d), OB_CONST_U64 (0x8aa08a2843d48d67)}, + {OB_CONST_U64 (0xa9147f0fb2e38bb1), OB_CONST_U64 (0x7bfb951842162784), + OB_CONST_U64 (0x83de5195), OB_CONST_U64 (0xe3abd60325e6e7d2)}, + {OB_CONST_U64 (0xa080e609751f2e81), OB_CONST_U64 (0xb9a0f8b45d79c318), + OB_CONST_U64 (0x121c46a1), OB_CONST_U64 (0x5574538fc45a63ce)}, + {OB_CONST_U64 (0x3bc578f69905fa2d), OB_CONST_U64 (0x18646edbbf14b0ed), + OB_CONST_U64 (0x4f0c262c), OB_CONST_U64 (0x56a730dd842bc51a)}, + {OB_CONST_U64 (0x9e6a5e0641d1c0d9), OB_CONST_U64 (0x73c0bcd5a7366e15), + OB_CONST_U64 (0x5b117800), OB_CONST_U64 (0x6ed1c62dbebab3d9)}, + {OB_CONST_U64 (0x83b0cdb3c934c679), OB_CONST_U64 (0x25cbcd575a21c446), + OB_CONST_U64 (0x520c98ab), OB_CONST_U64 (0x631930ea8e36cc88)}, + {OB_CONST_U64 (0xf174161497c5fa97), OB_CONST_U64 (0x5eb7a9d5a724daed), + OB_CONST_U64 (0x906148ee), OB_CONST_U64 (0xc7c94b895e6b6258)}, + {OB_CONST_U64 (0xd7262cb2f2755e70), OB_CONST_U64 (0x76a474a551662078), + OB_CONST_U64 (0x5a2ecb92), OB_CONST_U64 (0x6142c974ac71b347)}, + {OB_CONST_U64 (0x1444ce264e8784b7), OB_CONST_U64 (0x7e52afec3d9d166e), + OB_CONST_U64 (0x3067423e), OB_CONST_U64 (0xef88ce34aebe6d9f)}, + {OB_CONST_U64 (0x532e6b5c95a2e229), OB_CONST_U64 (0x90febf2e15deaaa5), + OB_CONST_U64 (0x8dbec7a8), OB_CONST_U64 (0x0011e7a3d2883a6b)}, + {OB_CONST_U64 (0x183d112159f539eb), OB_CONST_U64 (0x82051bab809a3bf3), + OB_CONST_U64 (0x2e9b2d9e), OB_CONST_U64 (0xed785a34053a1cd5)}, + {OB_CONST_U64 (0x8f18272400b3ace9), OB_CONST_U64 (0xa395a3524727f255), + OB_CONST_U64 (0xda8abd8f), OB_CONST_U64 (0x1869b9964373be96)}, + {OB_CONST_U64 (0x43761e6a5f6f2fd6), OB_CONST_U64 (0x9db86e928d9c50d8), + OB_CONST_U64 (0x4235d6aa), OB_CONST_U64 (0x9db4d3a1996d848b)}, + {OB_CONST_U64 (0x44f615fcd096fbfe), OB_CONST_U64 (0xb0153a7a31076599), + OB_CONST_U64 (0xb47bf565), OB_CONST_U64 (0x9cd91557a3c29906)}, + {OB_CONST_U64 (0x27613f9db818cf78), OB_CONST_U64 (0xbf8519db808bc3fa), + OB_CONST_U64 (0x52a37beb), OB_CONST_U64 (0x1b504a79d45501df)}, + {OB_CONST_U64 (0x3f6984c7afaebd0b), OB_CONST_U64 (0x5b4fdfaf084a67cb), + OB_CONST_U64 (0xa252b32c), OB_CONST_U64 (0x37e9335fa8f29171)}, + {OB_CONST_U64 (0x8fc511284f47c772), OB_CONST_U64 (0xd04d61891a700659), + OB_CONST_U64 (0xbd4e635f), OB_CONST_U64 (0xdcaca9444a855911)}, + {OB_CONST_U64 (0x15ae5f12f88592e2), OB_CONST_U64 (0x5bd91d548ffefd6e), + OB_CONST_U64 (0x15428f4c), OB_CONST_U64 (0x3bbe10daaa790a2b)}, + {OB_CONST_U64 (0x905f995bddf92cb7), OB_CONST_U64 (0x4dc5bb06cd995cee), + OB_CONST_U64 (0xd5a63731), OB_CONST_U64 (0x8711063a55f2825e)}, + {OB_CONST_U64 (0xa23ac6bef8905fec), OB_CONST_U64 (0xb363b9add66e1684), + OB_CONST_U64 (0x0b484491), OB_CONST_U64 (0xa4bd47c024836acc)}, + {OB_CONST_U64 (0x403b94a75160a06b), OB_CONST_U64 (0xaa0739cef99075f8), + OB_CONST_U64 (0x3c641984), OB_CONST_U64 (0x899b3e365a68e975)}, + {OB_CONST_U64 (0x14d1ee05672fc19b), OB_CONST_U64 (0xd065eb50cfb5c451), + OB_CONST_U64 (0x7de1a18a), OB_CONST_U64 (0xb3d32e5e51babb47)}, + {OB_CONST_U64 (0xf59376c617951a2a), OB_CONST_U64 (0x5d291a873d8d9f9a), + OB_CONST_U64 (0x428e73df), OB_CONST_U64 (0xf98433bb496756b3)}, + {OB_CONST_U64 (0x063982fdc37a9dc5), OB_CONST_U64 (0xe7d5ccc2c570c989), + OB_CONST_U64 (0xe46558a6), OB_CONST_U64 (0x1595ed9d69027073)}, + {OB_CONST_U64 (0xeb480334ed838b48), OB_CONST_U64 (0x39dfa7182359c93d), + OB_CONST_U64 (0x960ae3c5), OB_CONST_U64 (0x971f3449913b016a)}, + {OB_CONST_U64 (0xd0b9004efa0a1164), OB_CONST_U64 (0x0b5d9a7ab23808f7), + OB_CONST_U64 (0x7dc815f0), OB_CONST_U64 (0xc762dd40848a0028)}, + {OB_CONST_U64 (0xb31f2b6cc2a15506), OB_CONST_U64 (0x341f7d6f1212356b), + OB_CONST_U64 (0x9f1aafa1), OB_CONST_U64 (0x4eeaf94e83181752)}, + {OB_CONST_U64 (0x4f9da8a709bec12f), OB_CONST_U64 (0xd82b32d7831a57aa), + OB_CONST_U64 (0x1369efd1), OB_CONST_U64 (0x7bbd80eb7b64fd3a)}, + {OB_CONST_U64 (0x5504000602e6f8cf), OB_CONST_U64 (0xd83dda14a4423630), + OB_CONST_U64 (0x810961e0), OB_CONST_U64 (0xc3e4450343620672)}, + {OB_CONST_U64 (0x2d022d82f513a883), OB_CONST_U64 (0xb339f8f80f556971), + OB_CONST_U64 (0x94aa9431), OB_CONST_U64 (0xdb6e093cfac2ff78)}, + {OB_CONST_U64 (0xa87268205997eddb), OB_CONST_U64 (0xc69eac6e1256a4d9), + OB_CONST_U64 (0x9d97da8b), OB_CONST_U64 (0xa2219ef4fad86b69)}, + {OB_CONST_U64 (0xfde5f0a803c3affc), OB_CONST_U64 (0x6a678f40a8058ab0), + OB_CONST_U64 (0x4338229d), OB_CONST_U64 (0xff8a7d57a0507b44)}, + {OB_CONST_U64 (0xfa46e0e215c1aabd), OB_CONST_U64 (0x14571d59c36d29ea), + OB_CONST_U64 (0x0adc4cfe), OB_CONST_U64 (0xc6a7802a40c3f34a)}, + {OB_CONST_U64 (0x7e1f98b2c16f8b2b), OB_CONST_U64 (0xd23b89c36294385a), + OB_CONST_U64 (0x3a3a88b9), OB_CONST_U64 (0x831c8306200413ab)}, + {OB_CONST_U64 (0x65a58d22d8665e60), OB_CONST_U64 (0x14ce593a63d5a590), + OB_CONST_U64 (0x7245b01b), OB_CONST_U64 (0xfb791a7acd48fa22)}, + {OB_CONST_U64 (0xb781b9a55e7d6ab9), OB_CONST_U64 (0xb2ae79ab4b601bec), + OB_CONST_U64 (0x1f906322), OB_CONST_U64 (0x6fda72cfc1055b02)}, + {OB_CONST_U64 (0xa88c857b1aeb0835), OB_CONST_U64 (0xb03b42ed85390bea), + OB_CONST_U64 (0xb095a5a2), OB_CONST_U64 (0x2731ac19776140af)}, + {OB_CONST_U64 (0x2a25994979124643), OB_CONST_U64 (0x08667e3420bb8d50), + OB_CONST_U64 (0xe85e52bd), OB_CONST_U64 (0x99b6adf6324a63a3)}, + {OB_CONST_U64 (0x17236ed61e669c6f), OB_CONST_U64 (0x028fe56765c1b7ed), + OB_CONST_U64 (0x7be7f30c), OB_CONST_U64 (0x07f8598ff5292a31)}, + {OB_CONST_U64 (0x304f56359ac375a8), OB_CONST_U64 (0xd52df3445a1a027c), + OB_CONST_U64 (0x276bf62b), OB_CONST_U64 (0x68a05cdb805a7cba)}, + {OB_CONST_U64 (0x2e236ded6ce34194), OB_CONST_U64 (0xb0b18d56850de1a5), + OB_CONST_U64 (0x384b054b), OB_CONST_U64 (0x5d6e36272139a968)}, + {OB_CONST_U64 (0x837ecb10d69f9bb9), OB_CONST_U64 (0x620aaae18ac52da4), + OB_CONST_U64 (0x36ea0dbc), OB_CONST_U64 (0x0919d413bbed1f82)}, + {OB_CONST_U64 (0xc94bc80993d726f2), OB_CONST_U64 (0x4b2b9d78cda610a0), + OB_CONST_U64 (0x4ba74b7e), OB_CONST_U64 (0x4d28e86fc2e28a98)}, + {OB_CONST_U64 (0x463b54729349357a), OB_CONST_U64 (0xab16e09e606fd74f), + OB_CONST_U64 (0x118b9cf3), OB_CONST_U64 (0x97323f9b43e7f70f)}, + {OB_CONST_U64 (0x52e298a69bc61248), OB_CONST_U64 (0x45d0e8cbf8999a16), + OB_CONST_U64 (0x5fffb830), OB_CONST_U64 (0x6c39e05230d5bdcb)}, + {OB_CONST_U64 (0xf31bde28294be223), OB_CONST_U64 (0xb57c20d0886767cc), + OB_CONST_U64 (0xe815e6ac), OB_CONST_U64 (0xb33f0e59bd552656)}, + {OB_CONST_U64 (0xd1d98f3bbaf26f1e), OB_CONST_U64 (0xfdb28b9faa7455cb), + OB_CONST_U64 (0xe8a08288), OB_CONST_U64 (0x24f8d1c92e1a56da)}, + {OB_CONST_U64 (0x77969267e761a5e2), OB_CONST_U64 (0x6a50d507180b9dd8), + OB_CONST_U64 (0x5a93e263), OB_CONST_U64 (0x42c647e4a6f6cbb1)}, + {OB_CONST_U64 (0x763f1101a3d8e5d6), OB_CONST_U64 (0xbdc2cec3b0c72126), + OB_CONST_U64 (0x1b7ac668), OB_CONST_U64 (0xc9403096677994c0)}, + {OB_CONST_U64 (0xb6ffcab942c26180), OB_CONST_U64 (0x8bc905dfc7b85595), + OB_CONST_U64 (0xcd693a5a), OB_CONST_U64 (0x9c7e53f9d23a8a77)}, + {OB_CONST_U64 (0x65a85965268277a5), OB_CONST_U64 (0x0aabf0324ece8814), + OB_CONST_U64 (0x1e0de37c), OB_CONST_U64 (0xc5946fa6ce15e9ce)}, + {OB_CONST_U64 (0x6579248c4cabcf91), OB_CONST_U64 (0x727c8a9161e8cc9e), + OB_CONST_U64 (0x5cef51bc), OB_CONST_U64 (0x2a1bbbe14183babe)}, + {OB_CONST_U64 (0xfcea6deb6fbc95de), OB_CONST_U64 (0xa402e8b120895dcf), + OB_CONST_U64 (0xc2a9c0a4), OB_CONST_U64 (0x0fe6825d6dfaed01)}, + {OB_CONST_U64 (0xa5afb4dac88f15f0), OB_CONST_U64 (0xc118493d086eb030), + OB_CONST_U64 (0xefc82c86), OB_CONST_U64 (0x4dd6723285509c19)}, + {OB_CONST_U64 (0x35f437b7acbfd454), OB_CONST_U64 (0xb29d3d3f9fea4832), + OB_CONST_U64 (0x166de137), OB_CONST_U64 (0xaa89af4951f86aed)}, + {OB_CONST_U64 (0x8f45f63a2f2d77d5), OB_CONST_U64 (0x7b457c2c096a4fef), + OB_CONST_U64 (0x6ea50223), OB_CONST_U64 (0xf17c0651f490f90d)}, + {OB_CONST_U64 (0x62258e6fe64ea749), OB_CONST_U64 (0x1e383042228a6524), + OB_CONST_U64 (0xf3efca26), OB_CONST_U64 (0x0516246cf463580b)}, + {OB_CONST_U64 (0xfc109f4192ba2587), OB_CONST_U64 (0xda0616341a86759b), + OB_CONST_U64 (0xe6787702), OB_CONST_U64 (0x9f5588e52885524d)}, + {OB_CONST_U64 (0x5364968136715e44), OB_CONST_U64 (0x1b04a476a5af6319), + OB_CONST_U64 (0xdf592a85), OB_CONST_U64 (0xf0807df09903fee7)}, + {OB_CONST_U64 (0xdd84538848e07acb), OB_CONST_U64 (0x4a1b7795ab30febc), + OB_CONST_U64 (0x1c80156c), OB_CONST_U64 (0xb933fd19f925df6d)}, + {OB_CONST_U64 (0x397d78f9c2fb2a8a), OB_CONST_U64 (0x4b5d814365f300c3), + OB_CONST_U64 (0x0dd91e5a), OB_CONST_U64 (0xf2ce01375f6bb0c3)}, + {OB_CONST_U64 (0xa3a22aed573f4128), OB_CONST_U64 (0x61b303cec0f02d33), + OB_CONST_U64 (0x18ae05b2), OB_CONST_U64 (0xbb649a569d87157a)}, + {OB_CONST_U64 (0x94bcd5be64b0caf0), OB_CONST_U64 (0x465dd18f325b992d), + OB_CONST_U64 (0x2341f964), OB_CONST_U64 (0xc74d1a34a6313b15)}, + {OB_CONST_U64 (0x081d9fe1f35fe8dc), OB_CONST_U64 (0x09cee67a7a5c2455), + OB_CONST_U64 (0x027942d4), OB_CONST_U64 (0xcaa239d36383c6d8)}, + {OB_CONST_U64 (0xaa21f88e4310c4aa), OB_CONST_U64 (0x9eb788a336487a2f), + OB_CONST_U64 (0x574c81d1), OB_CONST_U64 (0xa9abd6d5b7d8e04f)}, + {OB_CONST_U64 (0x88e65c8bd8fd0dc3), OB_CONST_U64 (0x8e35bd6404cd4a19), + OB_CONST_U64 (0x12fc5100), OB_CONST_U64 (0x16a9f9d8fdc20dc3)}, + {OB_CONST_U64 (0xee7c287c7a74eaf6), OB_CONST_U64 (0x15b4a29d0e8621fd), + OB_CONST_U64 (0x0fd19c59), OB_CONST_U64 (0xf56970eee4bd614a)}, + {OB_CONST_U64 (0x59492bfd26df7a46), OB_CONST_U64 (0x2dabd903fca564b6), + OB_CONST_U64 (0xd0adc89a), OB_CONST_U64 (0x6f146cdb1f14ac52)}, + {OB_CONST_U64 (0x79471e68a2e7b4c3), OB_CONST_U64 (0x1c0c9618d88b7cf9), + OB_CONST_U64 (0x87215cdf), OB_CONST_U64 (0x0c4a3256e3a59540)}, + {OB_CONST_U64 (0xf806f8b0f54bbbf4), OB_CONST_U64 (0xc57fbf8500049609), + OB_CONST_U64 (0x82da8499), OB_CONST_U64 (0x5b81d54204e8c6fc)}, + {OB_CONST_U64 (0xaf0a9fa8d197fc2a), OB_CONST_U64 (0x297afa7cc277321a), + OB_CONST_U64 (0xb345a1d6), OB_CONST_U64 (0x2799b3cd5ffda8f3)}, + {OB_CONST_U64 (0xa93491c935028bfd), OB_CONST_U64 (0xfc5dcf1134041bb3), + OB_CONST_U64 (0x003396eb), OB_CONST_U64 (0x332cf9147d64dda7)}, + {OB_CONST_U64 (0x35fb344f57414e7e), OB_CONST_U64 (0xf084e04093c69f21), + OB_CONST_U64 (0x0731524a), OB_CONST_U64 (0x4089b86b659ef0ea)}, + {OB_CONST_U64 (0x650c588ae7997006), OB_CONST_U64 (0xfd225f2b4d05e97b), + OB_CONST_U64 (0x041e1ae6), OB_CONST_U64 (0x788c83e3ef21c387)}, + {OB_CONST_U64 (0x8e83c18ec4fac9b2), OB_CONST_U64 (0x15a4f84e1fbb081f), + OB_CONST_U64 (0x786f9e40), OB_CONST_U64 (0x64356cb8697d3a52)}, + {OB_CONST_U64 (0x35422c6582e3fa2e), OB_CONST_U64 (0xaac1901ece0f6dbe), + OB_CONST_U64 (0x23efed01), OB_CONST_U64 (0x416f5d520bae761a)}, + {OB_CONST_U64 (0xfc0cb7f55d516f4e), OB_CONST_U64 (0xf058bdc360787c2e), + OB_CONST_U64 (0x5613763f), OB_CONST_U64 (0xe440f39517b4fff8)}, + {OB_CONST_U64 (0xe6245e6273cd7da4), OB_CONST_U64 (0xdef05217f2ba3b7e), + OB_CONST_U64 (0x67089e56), OB_CONST_U64 (0x8632d73dc7d0565d)}, + {OB_CONST_U64 (0xbfb40261b25b0146), OB_CONST_U64 (0xd9de3386702c1efa), + OB_CONST_U64 (0xea544d65), OB_CONST_U64 (0x5ba92f505b6da6c4)}, + {OB_CONST_U64 (0x298876b240a1f937), OB_CONST_U64 (0xf4ec81df6387b639), + OB_CONST_U64 (0x51d84284), OB_CONST_U64 (0xe2b9c145fcfa9666)}, + {OB_CONST_U64 (0xbf26833d8f21542e), OB_CONST_U64 (0x978d2ce692fc2cd8), + OB_CONST_U64 (0xfb3e148f), OB_CONST_U64 (0x94d56d967974fa8b)}, + {OB_CONST_U64 (0xff85120bd8fa3cd4), OB_CONST_U64 (0xa7a136668d023fec), + OB_CONST_U64 (0x8075f6b6), OB_CONST_U64 (0x46293b3bf8cb4b20)}, + {OB_CONST_U64 (0xa37277b9eb9b16fc), OB_CONST_U64 (0xdd4a2f266cd6aa0f), + OB_CONST_U64 (0xec9d68b4), OB_CONST_U64 (0x4ce3953baf274ba5)}, + {OB_CONST_U64 (0xb95c558eb132482f), OB_CONST_U64 (0x8b43da48c6f5fd49), + OB_CONST_U64 (0xd45f9b8c), OB_CONST_U64 (0x85b24a7ca43e4ec3)}, + {OB_CONST_U64 (0xeb2a51b23ea2f82d), OB_CONST_U64 (0xa8670a39b06b41ce), + OB_CONST_U64 (0x9cca7706), OB_CONST_U64 (0x6e35bae16f64d7aa)}, + {OB_CONST_U64 (0xc85dcc13ce7d29c0), OB_CONST_U64 (0xea19bd7ee74ed003), + OB_CONST_U64 (0xab04b3fe), OB_CONST_U64 (0x0eda8daea4f4403c)}, + {OB_CONST_U64 (0x8a8707d80cb54c7a), OB_CONST_U64 (0x411cbfa152de1998), + OB_CONST_U64 (0x20dd1f76), OB_CONST_U64 (0x0d78822cde8b81f6)}, + {OB_CONST_U64 (0x12c7ffecff1800ba), OB_CONST_U64 (0x44bd867e67fc8ae4), + OB_CONST_U64 (0xe3b2414c), OB_CONST_U64 (0x5507d4e51e9a72cd)}, + {OB_CONST_U64 (0xcb16c5c1e342e34d), OB_CONST_U64 (0xd48a476057f23dc8), + OB_CONST_U64 (0xb45e5b1d), OB_CONST_U64 (0x5044444dae8597f7)}, + {OB_CONST_U64 (0x27fddd06bd368c50), OB_CONST_U64 (0xb505f7b0690e3f70), + OB_CONST_U64 (0xf3045b3c), OB_CONST_U64 (0x456498683cc816f5)}, + {OB_CONST_U64 (0x5e6c6ee85cec7703), OB_CONST_U64 (0xb0d9d93b584d752f), + OB_CONST_U64 (0xbb836a1a), OB_CONST_U64 (0x9d192e8fdc627d20)}, + {OB_CONST_U64 (0x2117190446b50f9d), OB_CONST_U64 (0x68a79e0698163241), + OB_CONST_U64 (0xf031912f), OB_CONST_U64 (0xbf95123162e07339)}, + {OB_CONST_U64 (0xf3f12b62f51a9b55), OB_CONST_U64 (0x1476fb5f05a37391), + OB_CONST_U64 (0xb4d87dcf), OB_CONST_U64 (0x4325cd69f5ac5a30)}, + {OB_CONST_U64 (0x2ee01b9e2a7692a6), OB_CONST_U64 (0xc6cfbcd09cc47583), + OB_CONST_U64 (0x89a4601c), OB_CONST_U64 (0x57e8c519e6d11ef3)}, + {OB_CONST_U64 (0x53ca5e2da19191b7), OB_CONST_U64 (0xede0ddbd23d66d73), + OB_CONST_U64 (0x61933402), OB_CONST_U64 (0x336f2bea65510c9d)}, + {OB_CONST_U64 (0xce6d0917744faa2f), OB_CONST_U64 (0x0ecece7b7f05004f), + OB_CONST_U64 (0x0ea1dfd8), OB_CONST_U64 (0xdb6d2703e4d90298)}, + {OB_CONST_U64 (0xf9b8ca6b46052208), OB_CONST_U64 (0x6e975d1339c4774a), + OB_CONST_U64 (0x0b5b78ab), OB_CONST_U64 (0x5efdfe5ba8b2ab16)}, + {OB_CONST_U64 (0xfb1cb91d94d6cddb), OB_CONST_U64 (0xec4df9c3e90f1e24), + OB_CONST_U64 (0x692cb7c6), OB_CONST_U64 (0xd7c8ef1a6d0b8a58)}, + {OB_CONST_U64 (0xa39e2eab5f174f15), OB_CONST_U64 (0xc2e46128224f249b), + OB_CONST_U64 (0x81350290), OB_CONST_U64 (0xbc9e2c8723c89334)}, + {OB_CONST_U64 (0xe9bfc7e088623326), OB_CONST_U64 (0xe7a09424c5bd6f77), + OB_CONST_U64 (0x21e1ac0c), OB_CONST_U64 (0xad5e2ed4fc2fa9a7)}, + {OB_CONST_U64 (0x24d3561ce4eda075), OB_CONST_U64 (0xc979f4ef12661fbd), + OB_CONST_U64 (0xfdd6761a), OB_CONST_U64 (0x9fca3261f343627a)}, + {OB_CONST_U64 (0x3edb299037e41adc), OB_CONST_U64 (0x85d3af0877d1b233), + OB_CONST_U64 (0xaa300363), OB_CONST_U64 (0xee63da8dbe00ca69)}, + {OB_CONST_U64 (0x4ccafed99120c34c), OB_CONST_U64 (0xd8a2a419bbd61dd4), + OB_CONST_U64 (0x39bc1a03), OB_CONST_U64 (0xdccad7de558f0005)}, + {OB_CONST_U64 (0x811039d76b0f5c10), OB_CONST_U64 (0xb9f230a525dd1a79), + OB_CONST_U64 (0x6afc61f7), OB_CONST_U64 (0xcccf44e18e5c74ff)}, + {OB_CONST_U64 (0xf26eca16e4f6b311), OB_CONST_U64 (0x7e13d7dbee27de4e), + OB_CONST_U64 (0xb66f9abb), OB_CONST_U64 (0x835ffab19dded036)}, + {OB_CONST_U64 (0x8ce51e30cf1501bb), OB_CONST_U64 (0xe12df99407eac10b), + OB_CONST_U64 (0x3321c35d), OB_CONST_U64 (0x983119251bb11319)}, + {OB_CONST_U64 (0x80d0fa7707773de4), OB_CONST_U64 (0xd4cb1cb66a739318), + OB_CONST_U64 (0x82aa6a32), OB_CONST_U64 (0x0d75b7a845f6ea8e)}, + {OB_CONST_U64 (0x698d6cc716818773), OB_CONST_U64 (0x9502bc1422758522), + OB_CONST_U64 (0x7182a0f2), OB_CONST_U64 (0x339f7304dd683ac1)}, + {OB_CONST_U64 (0xcaaa5ff55032cbcf), OB_CONST_U64 (0xe174f0f93d30f0bc), + OB_CONST_U64 (0x5aa174a3), OB_CONST_U64 (0xf93eee2c24187e89)}, + {OB_CONST_U64 (0x3333d53faadbec42), OB_CONST_U64 (0x5c95401451994dac), + OB_CONST_U64 (0x91e35caa), OB_CONST_U64 (0xb121c680dadc74dc)}, + {OB_CONST_U64 (0x010882aac3dd3587), OB_CONST_U64 (0x2d2e1c962520b6de), + OB_CONST_U64 (0xf2457b55), OB_CONST_U64 (0x06ab0b65960a3666)}, + {OB_CONST_U64 (0xb11fde1059b22334), OB_CONST_U64 (0x36af0ce3f9940bdf), + OB_CONST_U64 (0xc8cb304a), OB_CONST_U64 (0xe7d76cba98f7b5b5)}, + {OB_CONST_U64 (0x8977ae72ed603d45), OB_CONST_U64 (0xe2b1b66758d158fc), + OB_CONST_U64 (0xfae6e6d0), OB_CONST_U64 (0x7a388f4b11498acd)}, + {OB_CONST_U64 (0xf65b17f58e2f82f6), OB_CONST_U64 (0x5e28d4218467b771), + OB_CONST_U64 (0x8e8716cd), OB_CONST_U64 (0xa487a6ca35f6e70b)}, + {OB_CONST_U64 (0x063689bb426fad75), OB_CONST_U64 (0xdb08275d11847a43), + OB_CONST_U64 (0xf0516dcc), OB_CONST_U64 (0xc363fef0c7d1a13f)}, + {OB_CONST_U64 (0xf09d687ab01da414), OB_CONST_U64 (0x2c48cf28ff80b17f), + OB_CONST_U64 (0xa844f66a), OB_CONST_U64 (0x4f40078471fe4dd7)}, + {OB_CONST_U64 (0xf9946308ce8bcec0), OB_CONST_U64 (0x43f83dac819e8271), + OB_CONST_U64 (0xb7abdbff), OB_CONST_U64 (0x56b50e216d176240)}, + {OB_CONST_U64 (0x5f2a932916c5c63f), OB_CONST_U64 (0xfba7efcc1e2629e6), + OB_CONST_U64 (0x38752a9b), OB_CONST_U64 (0xf6e1f303912a966a)}, + {OB_CONST_U64 (0x3a7933b10ff2e831), OB_CONST_U64 (0x2e552c66fb8678d2), + OB_CONST_U64 (0xc5e09d84), OB_CONST_U64 (0x28175ddefdf028e1)}, + {OB_CONST_U64 (0x041f45d562a6689b), OB_CONST_U64 (0x990e39e880dc1533), + OB_CONST_U64 (0x3f24ebe0), OB_CONST_U64 (0xa0b4a6134431638a)}, + {OB_CONST_U64 (0xbcec7d59b5858e63), OB_CONST_U64 (0x6dbc1f5cd79cec30), + OB_CONST_U64 (0xa16e13f0), OB_CONST_U64 (0x1b142e3b814c58e5)}, + {OB_CONST_U64 (0x82ea92d6830c37ad), OB_CONST_U64 (0x15f84a79fe513c18), + OB_CONST_U64 (0xb8bd2db3), OB_CONST_U64 (0xc19a8db5904b1f14)}, + {OB_CONST_U64 (0x27cc4624e3a8fd6c), OB_CONST_U64 (0xac3dce81ee301ebd), + OB_CONST_U64 (0xb1d05bbb), OB_CONST_U64 (0xb1949a368f18c440)}, + {OB_CONST_U64 (0xbfa129745aeb3923), OB_CONST_U64 (0x5daefa90bb67c95e), + OB_CONST_U64 (0xa3d358f2), OB_CONST_U64 (0x1e913c2c7f3d74f4)}, + {OB_CONST_U64 (0x9b19fb3f08515329), OB_CONST_U64 (0x5d8dd543eb53b5c5), + OB_CONST_U64 (0xd9fa710f), OB_CONST_U64 (0x525f4f4ecc6036be)}, + {OB_CONST_U64 (0xb944c2c819b2038d), OB_CONST_U64 (0xbec7b4166eb32958), + OB_CONST_U64 (0x57e3ecba), OB_CONST_U64 (0xd69d103b319e3b5d)}, + {OB_CONST_U64 (0x6e8d2803df3b267a), OB_CONST_U64 (0x4b19fa3db0bb8ae1), + OB_CONST_U64 (0xe61e275e), OB_CONST_U64 (0x445ae4d0daf854da)}, + {OB_CONST_U64 (0xa5ed64048af45d9d), OB_CONST_U64 (0x7a4a22451f57afc2), + OB_CONST_U64 (0x73dbc457), OB_CONST_U64 (0x030a53edea62a0f9)}, + {OB_CONST_U64 (0x6d56acb61a9abe8e), OB_CONST_U64 (0x352075394f788b74), + OB_CONST_U64 (0x0ef0dcbd), OB_CONST_U64 (0x7cb0f0589256792e)}, + {OB_CONST_U64 (0x4f03f6750128b16f), OB_CONST_U64 (0xeba0e38bdfb2f415), + OB_CONST_U64 (0xdd7e1a06), OB_CONST_U64 (0x81fbb162316cde03)}, + {OB_CONST_U64 (0x6e717510c8e732c4), OB_CONST_U64 (0x18e0ba1d43b19fe8), + OB_CONST_U64 (0xbf20480f), OB_CONST_U64 (0xf3eb404f85fe274b)}, + {OB_CONST_U64 (0x6167f57448c6559b), OB_CONST_U64 (0x99414798c789a18b), + OB_CONST_U64 (0xfef3790d), OB_CONST_U64 (0xe44369376e46b46d)}, + {OB_CONST_U64 (0x4c445bb3cc5dc033), OB_CONST_U64 (0x60e78440ab5f7a3f), + OB_CONST_U64 (0x39b96886), OB_CONST_U64 (0x446bb8e1469291d0)}, + {OB_CONST_U64 (0x3d63ec327c84a0bf), OB_CONST_U64 (0xf0ba798fa143e548), + OB_CONST_U64 (0x7c4aafc1), OB_CONST_U64 (0xfdb58d0a8bfbe9dd)}, + {OB_CONST_U64 (0xeab5f4a8d3ec6334), OB_CONST_U64 (0x3381e6aeaa8906cd), + OB_CONST_U64 (0x0a25bf71), OB_CONST_U64 (0x5cbb98adc9c94340)}, + {OB_CONST_U64 (0x1ffad87ddc8ca76a), OB_CONST_U64 (0x51fc65a5f15337a2), + OB_CONST_U64 (0x236b6d36), OB_CONST_U64 (0x65f127e4b3e704eb)}, + {OB_CONST_U64 (0xfcc3b1db7bb174a0), OB_CONST_U64 (0x7882e4ab6c8cb280), + OB_CONST_U64 (0x30866f8c), OB_CONST_U64 (0x665eb3e1c06b412e)}, + {OB_CONST_U64 (0xcffe79062bb4e7cd), OB_CONST_U64 (0x2a616a3eb9110b32), + OB_CONST_U64 (0x4e82bf29), OB_CONST_U64 (0x8d4ac664d3c11ca0)}, + {OB_CONST_U64 (0xa21717e2b3d282ee), OB_CONST_U64 (0x429a8a47cea11c02), + OB_CONST_U64 (0xc65bc979), OB_CONST_U64 (0xdea840420487b660)}, + {OB_CONST_U64 (0x7e4143da4d878be5), OB_CONST_U64 (0x0c5096fd7847216c), + OB_CONST_U64 (0x84972315), OB_CONST_U64 (0xed55699376e0bd50)}, + {OB_CONST_U64 (0x23b80b8bc4e75405), OB_CONST_U64 (0xb58684b753996de8), + OB_CONST_U64 (0x466d2020), OB_CONST_U64 (0x5d7dad3d096b33fa)}, + {OB_CONST_U64 (0xa6ae749a1ed10838), OB_CONST_U64 (0xde2661c018abc48c), + OB_CONST_U64 (0xa985da3f), OB_CONST_U64 (0x38ad3acdb7cf98fd)}, + {OB_CONST_U64 (0xd4b4a81be36638f2), OB_CONST_U64 (0x43ab0147e976e855), + OB_CONST_U64 (0xa481616d), OB_CONST_U64 (0x88edf3e6f89b928c)}, + {OB_CONST_U64 (0x5bab2890f354896d), OB_CONST_U64 (0x3dcc900485630f0f), + OB_CONST_U64 (0x570cb610), OB_CONST_U64 (0xa3eb313dd03da792)}, + {OB_CONST_U64 (0x4c0a184632b0499a), OB_CONST_U64 (0x3e4fd6dfe99c67d2), + OB_CONST_U64 (0xbe6bc50d), OB_CONST_U64 (0x559759f714bb822f)}, + {OB_CONST_U64 (0xb45a39714746ec86), OB_CONST_U64 (0x2dd11909380bb2cd), + OB_CONST_U64 (0x2f3b176a), OB_CONST_U64 (0xf4d5fbbc54a81bae)}, + {OB_CONST_U64 (0xc4b90839e91abfb2), OB_CONST_U64 (0x4a7ed592a3a82dd4), + OB_CONST_U64 (0xd709df71), OB_CONST_U64 (0x55fd0b00d43cb1be)}, + {OB_CONST_U64 (0xe81d35c8ed7827fe), OB_CONST_U64 (0x207dc323cb840325), + OB_CONST_U64 (0x0ec6c582), OB_CONST_U64 (0x00b3de6689e4ff89)}, + {OB_CONST_U64 (0x587c5ee43e034ebd), OB_CONST_U64 (0xaf9c82c94dfcda1f), + OB_CONST_U64 (0x85bb0a79), OB_CONST_U64 (0x720ac0fa539dc3d6)}, + {OB_CONST_U64 (0xb1ec87f8823040ac), OB_CONST_U64 (0xd41677026942ade4), + OB_CONST_U64 (0x070e7748), OB_CONST_U64 (0x31957a1396e3f233)}, + {OB_CONST_U64 (0x7677dff12f92fbd9), OB_CONST_U64 (0xedcd974aa7488258), + OB_CONST_U64 (0x11bff4c4), OB_CONST_U64 (0x9d5a3d74b6287159)}, + {OB_CONST_U64 (0xb69cea6e5a0e28fd), OB_CONST_U64 (0x57dedae1b68ddd05), + OB_CONST_U64 (0x40ab8430), OB_CONST_U64 (0x1851a13837a6a05a)}, + {OB_CONST_U64 (0xf7180ae2e0f325e5), OB_CONST_U64 (0x500adca11f8e94de), + OB_CONST_U64 (0x605f6572), OB_CONST_U64 (0xa9c4e81fa446dc5c)}, + {OB_CONST_U64 (0xa08d214869e84ccf), OB_CONST_U64 (0x6ca21154a2193f1e), + OB_CONST_U64 (0xe9a22f5e), OB_CONST_U64 (0x17fb1dbc75adbbdd)}, + {OB_CONST_U64 (0xcfff666740e2f99f), OB_CONST_U64 (0xd12ba6e50904b61f), + OB_CONST_U64 (0xe58efb08), OB_CONST_U64 (0x7c5a62263fa9f3d2)}, + {OB_CONST_U64 (0x2fc743551c71634e), OB_CONST_U64 (0x5ae234ee018ecf0b), + OB_CONST_U64 (0x4abf3a62), OB_CONST_U64 (0x1c8fb93868045b98)}, + {OB_CONST_U64 (0x9bf4d77b464c9435), OB_CONST_U64 (0xbad6a2d23cb69f3f), + OB_CONST_U64 (0x40798637), OB_CONST_U64 (0xe95032ce07d3a101)}, + {OB_CONST_U64 (0x5e6b758083214c84), OB_CONST_U64 (0x4a8d4e03e37c386a), + OB_CONST_U64 (0x546d8f39), OB_CONST_U64 (0xe5ddc56338e80835)}, + {OB_CONST_U64 (0x40548138ef68aa78), OB_CONST_U64 (0x9b08bb741da55929), + OB_CONST_U64 (0x581ad0db), OB_CONST_U64 (0x23ad2c3b4ae456a5)}, + {OB_CONST_U64 (0x7c6b73ef50249070), OB_CONST_U64 (0x6d3fd907de23f5ee), + OB_CONST_U64 (0x1a323917), OB_CONST_U64 (0xd8956d912f7ff636)}, + {OB_CONST_U64 (0x462a1dc5b9cb1b3b), OB_CONST_U64 (0x6b34023aa308a14d), + OB_CONST_U64 (0xd684a5fd), OB_CONST_U64 (0xb01d6a0855888474)}, + {OB_CONST_U64 (0xb8b156aa6c884b21), OB_CONST_U64 (0xdab9fa981067044f), + OB_CONST_U64 (0xa2a457bb), OB_CONST_U64 (0x98d48686034e3bbc)}, + {OB_CONST_U64 (0xc7afcc722488f9e6), OB_CONST_U64 (0x97c923f4604fdcf4), + OB_CONST_U64 (0xe3b0fc15), OB_CONST_U64 (0x2d601b6077705851)}, + {OB_CONST_U64 (0x7a45b5b10dc24dbc), OB_CONST_U64 (0x7f807ade405b7144), + OB_CONST_U64 (0x193ea9e5), OB_CONST_U64 (0x5ea6133d2cc9f9e5)}, + {OB_CONST_U64 (0xefe499d7a567391d), OB_CONST_U64 (0xdb5b75c40a8d6871), + OB_CONST_U64 (0x9be696af), OB_CONST_U64 (0xce1e4caf6c8b33fb)}, + {OB_CONST_U64 (0xb60d26b461d05e25), OB_CONST_U64 (0xa33941259a71f695), + OB_CONST_U64 (0x4ab8c08c), OB_CONST_U64 (0x384a7fe8571b5d95)}, + {OB_CONST_U64 (0xc15d366b98d92986), OB_CONST_U64 (0x5dc43a61cfcdab12), + OB_CONST_U64 (0x34647a34), OB_CONST_U64 (0x6c5628cd34f6b815)}, + {OB_CONST_U64 (0x9addb551a523df05), OB_CONST_U64 (0x80019fdf97a7e7af), + OB_CONST_U64 (0x0d95d3a2), OB_CONST_U64 (0x5b23acfe0de60665)}, + {OB_CONST_U64 (0xbd0a37a2ad2465b9), OB_CONST_U64 (0xf13fdd1a783dea5b), + OB_CONST_U64 (0x17dd8c77), OB_CONST_U64 (0x70e733091290b28d)}, + {OB_CONST_U64 (0xe7a7162d930c5056), OB_CONST_U64 (0x98d7152acf6aead9), + OB_CONST_U64 (0x7debd7f2), OB_CONST_U64 (0x4afd16687b833020)}, + {OB_CONST_U64 (0xb9982c5395b09406), OB_CONST_U64 (0xccb79281b0518ea2), + OB_CONST_U64 (0xf12cf02e), OB_CONST_U64 (0x2f16dcda901491c0)}, + {OB_CONST_U64 (0xe41766d004eef8fd), OB_CONST_U64 (0x1762a40c971c5256), + OB_CONST_U64 (0x3213f3ee), OB_CONST_U64 (0xe119fb7dd86e3a4a)}, + {OB_CONST_U64 (0xa3074a96c88c47de), OB_CONST_U64 (0x7a3010c27a54bf5b), + OB_CONST_U64 (0xa36aba5e), OB_CONST_U64 (0xe2441ff6c0b3fac4)}, + {OB_CONST_U64 (0x881caa3913271394), OB_CONST_U64 (0x76ac64366b6f5660), + OB_CONST_U64 (0x064e752d), OB_CONST_U64 (0x3528c5346ee361be)}, + {OB_CONST_U64 (0x77d95a600f824230), OB_CONST_U64 (0x7547f8e9b3d7d3bc), + OB_CONST_U64 (0x1b5aaae9), OB_CONST_U64 (0x084bf5d508f09f35)}, + {OB_CONST_U64 (0x1984adb7bcfec495), OB_CONST_U64 (0xc4d5f5af08537d31), + OB_CONST_U64 (0x656680df), OB_CONST_U64 (0xb643669b38d02e45)}, + {OB_CONST_U64 (0x66f613698d2263a7), OB_CONST_U64 (0x50723eb3c45bba59), + OB_CONST_U64 (0x123b8ddb), OB_CONST_U64 (0xf8370abb824a0846)}, + {OB_CONST_U64 (0x50cf2a1c284f5a5a), OB_CONST_U64 (0x3762f19bdf869c75), + OB_CONST_U64 (0x5c91f0ab), OB_CONST_U64 (0x23ccdab872ca8559)}, }; -static void check (unt64 expected, unt64 actual) { +static void check (unt64 expected, unt64 actual) +{ if (expected != actual) - { error_report ("ERROR: expected 0x%016" OB_FMT_64 "x, but got 0x%016" - OB_FMT_64 "x\n", expected, actual); + { + error_report ("ERROR: expected 0x%016" OB_FMT_64 + "x, but got 0x%016" OB_FMT_64 "x\n", + expected, actual); ++errors; } } -static void test (const unt64* expected, size_t offset, size_t len) -{ unt32 io1 = (unt32) kSeed1; +static void test (const unt64 *expected, size_t offset, size_t len) +{ + unt32 io1 = (unt32) kSeed1; unt32 io2 = (unt32) (kSeed1 >> 32); check (expected[0], ob_city_hash64 (data + offset, len)); - check (expected[1], ob_city_hash64_with_seeds (data + offset, len, - kSeed0, kSeed1)); + check (expected[1], + ob_city_hash64_with_seeds (data + offset, len, kSeed0, kSeed1)); check (expected[2], ob_jenkins_hash (data + offset, len, kSeed0)); ob_jenkins_hash2 (data + offset, len, &io1, &io2); unt64 h64 = (io1 | (((unt64) io2) << 32)); check (expected[3], h64); } -int main (int argc, char** argv) -{ setup (); +int main (int argc, char **argv) +{ + setup (); size_t i = 0; - for ( ; i < kTestSize - 1 ; i++) + for (; i < kTestSize - 1; i++) test (testdata[i], i * i, i); test (testdata[i], 0, kDataSize); return errors > 0; diff --git a/libLoam/c/tests/test-logging.c b/libLoam/c/tests/test-logging.c index ae217751..444f180f 100644 --- a/libLoam/c/tests/test-logging.c +++ b/libLoam/c/tests/test-logging.c @@ -22,7 +22,8 @@ static bool yeah_i_got_called = false; static void cback_func (const struct ob_log_level *lvl, unt64 code, float64 t, int64 lnum, int64 lcount, const char *file, int line, - const char *msg, const char *fmtdmsg, OB_UNUSED const char *stack) + const char *msg, const char *fmtdmsg, + OB_UNUSED const char *stack) { if (code != 0xc0de) error_exit ("code was %" OB_FMT_64 "x\n", code); @@ -62,78 +63,80 @@ static void cback_func (const struct ob_log_level *lvl, unt64 code, float64 t, yeah_i_got_called = true; } -static ob_log_level blue_plain = - {OB_DST_FD, OB_FOREGROUND_ENABLE | OB_FOREGROUND_BLUE, /* blue */ - LOG_INFO, 1, - "blue text: ", NULL, - NULL, NULL, NULL}; +static ob_log_level blue_plain = { + OB_DST_FD, OB_FOREGROUND_ENABLE | OB_FOREGROUND_BLUE, /* blue */ + LOG_INFO, 1, + "blue text: ", NULL, + NULL, NULL, + NULL}; static ob_log_level totally_plain = {OB_DST_FD, 0, /* no color */ LOG_INFO, 1, "", NULL, NULL, NULL, NULL}; -static ob_log_level red_error = - {OB_DST_FD | OB_FLG_SHOW_CODE_OR_WHERE, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED, /* red */ - LOG_ERR, - 1, - "", - NULL, - NULL, - NULL, - NULL}; - -static ob_log_level green_prog = - {OB_DST_FD | OB_FLG_SHOW_PROG | OB_FLG_SHOW_PID, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_GREEN, /* green */ - LOG_INFO, - 1, - "", - NULL, - NULL, - NULL, - NULL}; - -static ob_log_level stack_trace = - {OB_DST_FD | OB_FLG_SHOW_TIME | OB_FLG_SHOW_WHERE | OB_FLG_STACK_TRACE, - 0, /* no color */ - LOG_INFO, - 1, - "", - NULL, - NULL, - NULL, - NULL}; - -static ob_log_level cyan_syslog = - {OB_DST_FD | OB_DST_SYSLOG, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_GREEN | OB_FOREGROUND_BLUE, /* cyan */ - LOG_INFO, - 1, - "this is only a test: ", - NULL, - NULL, - NULL, - NULL}; - -static ob_log_level limited = - {OB_DST_FD, OB_FOREGROUND_ENABLE | OB_FOREGROUND_GREEN, /* green */ - LOG_INFO, 1, - "", NULL, - NULL, NULL, NULL}; +static ob_log_level red_error = {OB_DST_FD | OB_FLG_SHOW_CODE_OR_WHERE, + OB_FOREGROUND_ENABLE + | OB_FOREGROUND_RED, /* red */ + LOG_ERR, + 1, + "", + NULL, + NULL, + NULL, + NULL}; + +static ob_log_level green_prog = { + OB_DST_FD | OB_FLG_SHOW_PROG | OB_FLG_SHOW_PID, + OB_FOREGROUND_ENABLE | OB_FOREGROUND_GREEN, /* green */ + LOG_INFO, + 1, + "", + NULL, + NULL, + NULL, + NULL}; + +static ob_log_level stack_trace = {OB_DST_FD | OB_FLG_SHOW_TIME + | OB_FLG_SHOW_WHERE | OB_FLG_STACK_TRACE, + 0, /* no color */ + LOG_INFO, + 1, + "", + NULL, + NULL, + NULL, + NULL}; + +static ob_log_level cyan_syslog = {OB_DST_FD | OB_DST_SYSLOG, + OB_FOREGROUND_ENABLE | OB_FOREGROUND_GREEN + | OB_FOREGROUND_BLUE, /* cyan */ + LOG_INFO, + 1, + "this is only a test: ", + NULL, + NULL, + NULL, + NULL}; + +static ob_log_level limited = { + OB_DST_FD, OB_FOREGROUND_ENABLE | OB_FOREGROUND_GREEN, /* green */ + LOG_INFO, 1, + "", NULL, + NULL, NULL, + NULL}; static ob_log_level limited2 = {OB_DST_FD, 0, /* no color */ LOG_INFO, 1, "foo: ", NULL, NULL, NULL, NULL}; -static ob_log_level callback = - {OB_DST_FD | OB_DST_CALLBACK | OB_FLG_SHOW_CODE, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_GREEN, /* green */ - LOG_INFO, - 1, - "", - cback_func, - (void *) "monster", - NULL, - NULL}; +static ob_log_level callback = {OB_DST_FD | OB_DST_CALLBACK | OB_FLG_SHOW_CODE, + OB_FOREGROUND_ENABLE + | OB_FOREGROUND_GREEN, /* green */ + LOG_INFO, + 1, + "", + cback_func, + (void *) "monster", + NULL, + NULL}; #define LINE(f, b) \ errno = 0; \ @@ -423,16 +426,17 @@ int main (int argc, char **argv) ob_log (&totally_plain, 0, "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - ob_log (&totally_plain, 0, "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" - "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" - "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" - "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" - "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" - "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" - "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" - "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" - "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" - "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n", + ob_log (&totally_plain, 0, + "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" + "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" + "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" + "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" + "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" + "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" + "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" + "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" + "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" + "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, diff --git a/libLoam/c/tests/test-time.c b/libLoam/c/tests/test-time.c index 1147239e..1c8f07c6 100644 --- a/libLoam/c/tests/test-time.c +++ b/libLoam/c/tests/test-time.c @@ -22,37 +22,35 @@ typedef struct for_a_good_time_call char expected[32]; } for_a_good_time_call; -static const for_a_good_time_call good_times[] = - { - { "Dec 20, 2024 13:30:53.63 " , "Dec 20, 2024 13:30:53.63 " }, - { "Dec 20, 2024 13:30:53.63" , "Dec 20, 2024 13:30:53.63 " }, - { "Dec 20, 2024 13:30:53.631 " , "Dec 20, 2024 13:30:53.63 " }, - { "Dec 20, 2024 13:30:53.631" , "Dec 20, 2024 13:30:53.63 " }, - { "Dec 20, 2024 13:30:53.50 " , "Dec 20, 2024 13:30:53.50 " }, - { "Dec 20, 2024 13:30:53.50" , "Dec 20, 2024 13:30:53.50 " }, - { "Dec 20, 2024 13:30:53.5 " , "Dec 20, 2024 13:30:53.50 " }, - { "Dec 20, 2024 13:30:53.5" , "Dec 20, 2024 13:30:53.50 " }, - { "Dec 20, 2024 13:30:53 " , "Dec 20, 2024 13:30:53.00 " }, - { "Dec 20, 2024 13:30:53" , "Dec 20, 2024 13:30:53.00 " }, - }; +static const for_a_good_time_call good_times[] = { + {"Dec 20, 2024 13:30:53.63 ", "Dec 20, 2024 13:30:53.63 "}, + {"Dec 20, 2024 13:30:53.63", "Dec 20, 2024 13:30:53.63 "}, + {"Dec 20, 2024 13:30:53.631 ", "Dec 20, 2024 13:30:53.63 "}, + {"Dec 20, 2024 13:30:53.631", "Dec 20, 2024 13:30:53.63 "}, + {"Dec 20, 2024 13:30:53.50 ", "Dec 20, 2024 13:30:53.50 "}, + {"Dec 20, 2024 13:30:53.50", "Dec 20, 2024 13:30:53.50 "}, + {"Dec 20, 2024 13:30:53.5 ", "Dec 20, 2024 13:30:53.50 "}, + {"Dec 20, 2024 13:30:53.5", "Dec 20, 2024 13:30:53.50 "}, + {"Dec 20, 2024 13:30:53 ", "Dec 20, 2024 13:30:53.00 "}, + {"Dec 20, 2024 13:30:53", "Dec 20, 2024 13:30:53.00 "}, +}; typedef struct for_a_bad_time_call { - char bad_time[32]; + char bad_time[32]; ob_retort expected; } for_a_bad_time_call; -static const for_a_bad_time_call bad_times[] = - { - { "Dec 32, 2024 13:30:53.63" , OB_PARSE_ERROR }, - { "Dec 20, 2024 25:30:53.63" , OB_PARSE_ERROR }, - { "Dec 20, 2024 13:30:xx.63" , OB_PARSE_ERROR }, - { "Dec 20, 2024 13:30:53.xx" , OB_PARSE_ERROR }, - { "Dec 20, 867-5309 13:30:53.63", OB_PARSE_ERROR }, - { "Blob 20, 2024 13:30:53.63" , OB_PARSE_ERROR }, - { ".63" , OB_PARSE_ERROR }, - { "" , OB_PARSE_ERROR }, - }; +static const for_a_bad_time_call bad_times[] = { + {"Dec 32, 2024 13:30:53.63", OB_PARSE_ERROR}, + {"Dec 20, 2024 25:30:53.63", OB_PARSE_ERROR}, + {"Dec 20, 2024 13:30:xx.63", OB_PARSE_ERROR}, + {"Dec 20, 2024 13:30:53.xx", OB_PARSE_ERROR}, + {"Dec 20, 867-5309 13:30:53.63", OB_PARSE_ERROR}, + {"Blob 20, 2024 13:30:53.63", OB_PARSE_ERROR}, + {".63", OB_PARSE_ERROR}, + {"", OB_PARSE_ERROR}, +}; /* oddly, ob_format_time outputs a single trailing space. */ static const char beg_of_time_s[] = "Jan 1, 1970 00:00:00.00 "; @@ -208,11 +206,11 @@ static void test_ob_strptime (void) for (i = 0; i < sizeof (good_times) / sizeof (good_times[0]); i++) { - float64 secs = -1.0; + float64 secs = -1.0; const char *good = good_times[i].good_time; print_test_string (good); - ob_retort tort = ob_strptime (good, &secs); + ob_retort tort = ob_strptime (good, &secs); if (tort == OB_OK) { @@ -225,7 +223,7 @@ static void test_ob_strptime (void) } else { - const char *msg = ob_error_string (tort); + const char *msg = ob_error_string (tort); print_passfail (false); printf (" %s\n", msg); } @@ -234,15 +232,15 @@ static void test_ob_strptime (void) /* Test whether some known-bad strings fail as expected */ for (i = 0; i < sizeof (bad_times) / sizeof (bad_times[0]); i++) { - float64 secs = -1.0; - const char *bad = bad_times[i].bad_time; + float64 secs = -1.0; + const char *bad = bad_times[i].bad_time; print_test_string (bad); - ob_retort tort = ob_strptime (bad, &secs); + ob_retort tort = ob_strptime (bad, &secs); print_passfail (tort == bad_times[i].expected); - const char *msg = ob_error_string (tort); + const char *msg = ob_error_string (tort); printf (" %s\n", msg); } } diff --git a/libLoam/c/tests/test-vasprintf.c b/libLoam/c/tests/test-vasprintf.c index 6e0b0b72..06e73da4 100644 --- a/libLoam/c/tests/test-vasprintf.c +++ b/libLoam/c/tests/test-vasprintf.c @@ -281,9 +281,10 @@ int main (int argc, char **argv) "string %s, hex %X, negative %" OB_FMT_64 "d", "theory", 0xdeadbeef, OB_CONST_I64 (-1000000000000000000)); - do_test (j, "This is a truly evil string, because it has a gr8 number of " - "arguments 2 format, so if there R problems with not having " - "va_copy on Windows, we should hopefully C them!", + do_test (j, + "This is a truly evil string, because it has a gr8 number of " + "arguments 2 format, so if there R problems with not having " + "va_copy on Windows, we should hopefully C them!", "%s is %x truly %c%c%c%c string, because it has %x%c" "gr%d number of arguments %d %s, so if there %c " "problems with not having %s on %s, we should %s " @@ -291,9 +292,10 @@ int main (int argc, char **argv) "This", 10, 'e', 'v', 'i', 'l', 10, ' ', 8, 2, "format", 'R', "va_copy", "Windows", "hopefully", OB_CONST_I64 (12), '!'); - do_test (j, "Parser error: while parsing a block mapping at " - "line 9259457, column 5\n" - "did not find expected key at line 9260367, column 5\n", + do_test (j, + "Parser error: while parsing a block mapping at " + "line 9259457, column 5\n" + "did not find expected key at line 9260367, column 5\n", "Parser error: %s at line %" OB_FMT_SIZE "d, column %" OB_FMT_SIZE "d\n" "%s at line %" OB_FMT_SIZE "d, column %" OB_FMT_SIZE "d\n", @@ -307,10 +309,11 @@ int main (int argc, char **argv) char *a; int ret = - asprintf (&a, "%s is %x truly %c%c%c%c string, because it has %x%c" - "gr%d number of arguments %d %s, so if there %c " - "problems with not having %s on %s, we should %s " - "%" OB_FMT_64 "X them%c", + asprintf (&a, + "%s is %x truly %c%c%c%c string, because it has %x%c" + "gr%d number of arguments %d %s, so if there %c " + "problems with not having %s on %s, we should %s " + "%" OB_FMT_64 "X them%c", "This", 10, 'e', 'v', 'i', 'l', 10, ' ', 8, 2, "format", 'R', "va_copy", "Windows", "hopefully", OB_CONST_I64 (12), '!'); if (ret != strlen (expected)) diff --git a/libLoam/c/win32/ob-sys-win32-cpp.cpp b/libLoam/c/win32/ob-sys-win32-cpp.cpp index 799f74e8..2372256c 100644 --- a/libLoam/c/win32/ob-sys-win32-cpp.cpp +++ b/libLoam/c/win32/ob-sys-win32-cpp.cpp @@ -22,10 +22,11 @@ static MsgMap *mmptr; static char *ob_string_from_last_error (DWORD err) { char *msg = NULL; - if (0 != FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM - | FORMAT_MESSAGE_IGNORE_INSERTS - | FORMAT_MESSAGE_ALLOCATE_BUFFER, - NULL, err, 0, (LPTSTR) &msg, 0, NULL)) + if (0 + != FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_IGNORE_INSERTS + | FORMAT_MESSAGE_ALLOCATE_BUFFER, + NULL, err, 0, (LPTSTR) &msg, 0, NULL)) { char *ret = strdup (msg); LocalFree (msg); diff --git a/libLoam/c/win32/ob-sys-win32.c b/libLoam/c/win32/ob-sys-win32.c index 28fa17bd..647f75f4 100644 --- a/libLoam/c/win32/ob-sys-win32.c +++ b/libLoam/c/win32/ob-sys-win32.c @@ -374,9 +374,9 @@ int pthread_create (pthread_t *out_handle, void *attr_ignored, if (new_handle == 0) { - OB_FATAL_ERROR_CODE (0x10030003, "error creating thread - %s\n", - ob_error_string ( - ob_win32err_to_retort (GetLastError ()))); + OB_FATAL_ERROR_CODE ( + 0x10030003, "error creating thread - %s\n", + ob_error_string (ob_win32err_to_retort (GetLastError ()))); } *out_handle = new_handle; @@ -393,10 +393,9 @@ int pthread_timedjoin_np (pthread_t thread, void **value_ptr, DWORD exit_code = 0; if (!GetExitCodeThread (thread, &exit_code)) { - OB_LOG_ERROR_CODE (0x10030004, - "error getting thread exit code - %s\n", - ob_error_string ( - ob_win32err_to_retort (GetLastError ()))); + OB_LOG_ERROR_CODE ( + 0x10030004, "error getting thread exit code - %s\n", + ob_error_string (ob_win32err_to_retort (GetLastError ()))); exit_code = 1; } @@ -414,15 +413,15 @@ int pthread_timedjoin_np (pthread_t thread, void **value_ptr, return EBUSY; else if (res == WAIT_FAILED) { - OB_FATAL_ERROR_CODE (0x10030006, - "error on pthread_join: WAIT_FAILED: %s\n", - ob_error_string ( - ob_win32err_to_retort (GetLastError ()))); + OB_FATAL_ERROR_CODE ( + 0x10030006, "error on pthread_join: WAIT_FAILED: %s\n", + ob_error_string (ob_win32err_to_retort (GetLastError ()))); } //any error causes an exit - OB_FATAL_ERROR_CODE (0x10030005, "error on pthread_join: WaitForSingleObject " - "returned 0x%08x\n", + OB_FATAL_ERROR_CODE (0x10030005, + "error on pthread_join: WaitForSingleObject " + "returned 0x%08x\n", res); } @@ -801,8 +800,8 @@ static void set_week_number_mon4 (struct tm *timeptr, int wnum) /* strptime: roken */ /* extern "C" */ char * - /* strptime (const char *buf, const char *format, struct tm *timeptr) */ - strptime (const char *buf, const char *format, struct tm *timeptr) +/* strptime (const char *buf, const char *format, struct tm *timeptr) */ +strptime (const char *buf, const char *format, struct tm *timeptr) { char c; diff --git a/libPlasma/bench/LoneWorker.cpp b/libPlasma/bench/LoneWorker.cpp index 01631e00..ef3486d0 100644 --- a/libPlasma/bench/LoneWorker.cpp +++ b/libPlasma/bench/LoneWorker.cpp @@ -7,9 +7,7 @@ namespace oblong { namespace plasma { namespace bench { -LoneWorker::LoneWorker (const Config &c) : Worker (c) -{ -} +LoneWorker::LoneWorker (const Config &c) : Worker (c) {} void LoneWorker::AddError (unt64 b, unt64 i, ob_retort r) { diff --git a/libPlasma/bench/PingPonger.cpp b/libPlasma/bench/PingPonger.cpp index 48b8c597..07ba6414 100644 --- a/libPlasma/bench/PingPonger.cpp +++ b/libPlasma/bench/PingPonger.cpp @@ -14,9 +14,7 @@ namespace plasma { namespace bench { -PingPonger::Config::Config () : timeout (0), ping (false) -{ -} +PingPonger::Config::Config () : timeout (0), ping (false) {} PingPonger::Config::Config (const Config &other) diff --git a/libPlasma/bench/SerialWorker.cpp b/libPlasma/bench/SerialWorker.cpp index 1afe1a50..923bb675 100644 --- a/libPlasma/bench/SerialWorker.cpp +++ b/libPlasma/bench/SerialWorker.cpp @@ -15,9 +15,7 @@ SerialWorker::~SerialWorker () delete workers_[i].second; } -SerialWorker::SerialWorker (const Config &cfg) : Worker (cfg) -{ -} +SerialWorker::SerialWorker (const Config &cfg) : Worker (cfg) {} void SerialWorker::Add (Worker *w) { diff --git a/libPlasma/c++/AtomicComposite.cpp b/libPlasma/c++/AtomicComposite.cpp index de233a20..5d04ed39 100644 --- a/libPlasma/c++/AtomicComposite.cpp +++ b/libPlasma/c++/AtomicComposite.cpp @@ -10,9 +10,7 @@ namespace plasma { namespace detail { -AtomicComposite::AtomicComposite (SlawRef s) : slaw_ (s) -{ -} +AtomicComposite::AtomicComposite (SlawRef s) : slaw_ (s) {} bool AtomicComposite::IsNull () const { diff --git a/libPlasma/c++/CompositeSlaw.cpp b/libPlasma/c++/CompositeSlaw.cpp index d06be431..31f0a0e3 100644 --- a/libPlasma/c++/CompositeSlaw.cpp +++ b/libPlasma/c++/CompositeSlaw.cpp @@ -73,9 +73,7 @@ void CompositeSlaw::RefTraits::Destroy (CompositeSlaw *s) /* ---------------------------------------------------------------------- */ // Construction -CompositeSlaw::~CompositeSlaw () -{ -} +CompositeSlaw::~CompositeSlaw () {} /* ---------------------------------------------------------------------- */ diff --git a/libPlasma/c++/Protein.cpp b/libPlasma/c++/Protein.cpp index c1d98202..9766fa8b 100644 --- a/libPlasma/c++/Protein.cpp +++ b/libPlasma/c++/Protein.cpp @@ -15,9 +15,7 @@ const pool_timestamp Protein::NO_TIME (-1); const int64 Protein::NO_INDEX (-1); -Protein::~Protein () -{ -} +Protein::~Protein () {} Protein::Protein (const Protein &o) : protein_ (o.protein_), diff --git a/libPlasma/c++/ProteinComposite.cpp b/libPlasma/c++/ProteinComposite.cpp index 3b7e539a..8ff28999 100644 --- a/libPlasma/c++/ProteinComposite.cpp +++ b/libPlasma/c++/ProteinComposite.cpp @@ -43,7 +43,8 @@ CompositeSlaw::Ref ExtractIngests (SlawRef s) } // namespace ProteinComposite::ProteinComposite (SlawRef protein) - : descrips_ (proteincomposite::ExtractDescrips (protein)), ingests_ (proteincomposite::ExtractIngests (protein)) + : descrips_ (proteincomposite::ExtractDescrips (protein)), + ingests_ (proteincomposite::ExtractIngests (protein)) { } diff --git a/libPlasma/c++/Slaw.cpp b/libPlasma/c++/Slaw.cpp index 0db1929e..94f71af1 100644 --- a/libPlasma/c++/Slaw.cpp +++ b/libPlasma/c++/Slaw.cpp @@ -42,25 +42,15 @@ const Slaw &Slaw::Null () return A_NULL_SLAW; } -Slaw::~Slaw () -{ -} +Slaw::~Slaw () {} -Slaw::Slaw () -{ -} +Slaw::Slaw () {} -Slaw::Slaw (slaw s) : slaw_ (s) -{ -} +Slaw::Slaw (slaw s) : slaw_ (s) {} -Slaw::Slaw (detail::SlawRef s) : slaw_ (s) -{ -} +Slaw::Slaw (detail::SlawRef s) : slaw_ (s) {} -Slaw::Slaw (detail::CompositeSlaw::Ref c) : composite_ (c) -{ -} +Slaw::Slaw (detail::CompositeSlaw::Ref c) : composite_ (c) {} /* ---------------------------------------------------------------------- */ // Equality and typing diff --git a/libPlasma/c++/SlawCons.cpp b/libPlasma/c++/SlawCons.cpp index 727d0297..67c125c9 100644 --- a/libPlasma/c++/SlawCons.cpp +++ b/libPlasma/c++/SlawCons.cpp @@ -50,9 +50,7 @@ SlawRefs ExtractComponents (SlawRef s) /* ---------------------------------------------------------------------- */ // Construction -SlawCons::SlawCons (SlawRef cons) : elements_ (ExtractComponents (cons)) -{ -} +SlawCons::SlawCons (SlawRef cons) : elements_ (ExtractComponents (cons)) {} SlawCons::SlawCons (SlawRef car, SlawRef cdr) : elements_ (MakeCons (car, cdr)) { diff --git a/libPlasma/c++/SlawIterator.cpp b/libPlasma/c++/SlawIterator.cpp index 9d00a6a3..82dfe060 100644 --- a/libPlasma/c++/SlawIterator.cpp +++ b/libPlasma/c++/SlawIterator.cpp @@ -16,9 +16,7 @@ void SlawIterator::SetIndex (unt64 idx) idx_ = (::std::min) (idx, unt64 (slaw_.Count ())); } -SlawIterator::SlawIterator () : idx_ (0) -{ -} +SlawIterator::SlawIterator () : idx_ (0) {} SlawIterator::SlawIterator (const Slaw &s) : slaw_ (s) { @@ -40,7 +38,7 @@ SlawIterator::reference SlawIterator::operator* () const return slaw_.Nth (idx_); } -SlawIterator::pointer SlawIterator::operator-> () const +SlawIterator::pointer SlawIterator::operator->() const { return pointer (slaw_.Nth (idx_)); } @@ -131,8 +129,8 @@ bool SlawIterator::IsEnd () const return idx_ == unt64 (slaw_.Count ()); } -SlawIterator::difference_type SlawIterator:: -operator- (const SlawIterator &other) const +SlawIterator::difference_type +SlawIterator::operator- (const SlawIterator &other) const { unt64 end = slaw_.IsNull () ? unt64 (other.slaw_.Count ()) : idx_; return SlawIterator::difference_type (end - other.idx_); diff --git a/libPlasma/c++/SlawList.cpp b/libPlasma/c++/SlawList.cpp index 9647967e..b51197ad 100644 --- a/libPlasma/c++/SlawList.cpp +++ b/libPlasma/c++/SlawList.cpp @@ -125,17 +125,11 @@ SlawRefs GetComponents (SlawRef s) /* ---------------------------------------------------------------------- */ // Construction -SlawList::SlawList () -{ -} +SlawList::SlawList () {} -SlawList::SlawList (SlawRef s) : elements_ (slawlist::GetComponents (s)) -{ -} +SlawList::SlawList (SlawRef s) : elements_ (slawlist::GetComponents (s)) {} -SlawList::SlawList (const SlawRefs &elems) : elements_ (elems) -{ -} +SlawList::SlawList (const SlawRefs &elems) : elements_ (elems) {} /* ---------------------------------------------------------------------- */ // Typing diff --git a/libPlasma/c++/SlawRef.cpp b/libPlasma/c++/SlawRef.cpp index bed6546d..44e77884 100644 --- a/libPlasma/c++/SlawRef.cpp +++ b/libPlasma/c++/SlawRef.cpp @@ -33,13 +33,9 @@ SlawRef SlawRef::NilRef () return nil; } -SlawRef::SlawRef () : parent_ (NULL_REF), slaw_ (NULL_BSLAW) -{ -} +SlawRef::SlawRef () : parent_ (NULL_REF), slaw_ (NULL_BSLAW) {} -SlawRef::SlawRef (slaw s) : parent_ (s), slaw_ (s) -{ -} +SlawRef::SlawRef (slaw s) : parent_ (s), slaw_ (s) {} SlawRef::SlawRef (bslaw s, SlawRef parent) : parent_ (parent.parent_), slaw_ (s) { diff --git a/libPlasma/c++/tests/ArraySlawTest.cpp b/libPlasma/c++/tests/ArraySlawTest.cpp index d3f1a21a..c32ab338 100644 --- a/libPlasma/c++/tests/ArraySlawTest.cpp +++ b/libPlasma/c++/tests/ArraySlawTest.cpp @@ -15,14 +15,14 @@ namespace { #define DEFINE_ARRAY_TEST(T) \ TEST (ArraySlawTest, T##array) \ { \ - const T values[][5] = \ - {{static_cast ((std::numeric_limits::min) ()), \ - static_cast ((std::numeric_limits::min) () + 22), \ - static_cast ((std::numeric_limits::max) ()), \ - static_cast ((std::numeric_limits::max) () - 42), T (0)}, \ - {static_cast ((std::numeric_limits::min) () + 18), \ - static_cast ((std::numeric_limits::min) ()), \ - static_cast ((std::numeric_limits::max) () - 2), T (1), T (0)}}; \ + const T values[][5] = { \ + {static_cast ((std::numeric_limits::min) ()), \ + static_cast ((std::numeric_limits::min) () + 22), \ + static_cast ((std::numeric_limits::max) ()), \ + static_cast ((std::numeric_limits::max) () - 42), T (0)}, \ + {static_cast ((std::numeric_limits::min) () + 18), \ + static_cast ((std::numeric_limits::min) ()), \ + static_cast ((std::numeric_limits::max) () - 2), T (1), T (0)}}; \ \ const size_t N (2); \ const size_t M (5); \ diff --git a/libPlasma/c++/tests/PoolTest.cpp b/libPlasma/c++/tests/PoolTest.cpp index 84dc6817..060c3263 100644 --- a/libPlasma/c++/tests/PoolTest.cpp +++ b/libPlasma/c++/tests/PoolTest.cpp @@ -9,8 +9,7 @@ namespace { class PoolTest : public PoolTestBase -{ -}; +{}; TEST_F (PoolTest, Creation) { diff --git a/libPlasma/c++/tests/SlawListTest.cpp b/libPlasma/c++/tests/SlawListTest.cpp index e70e2aa6..05523a24 100644 --- a/libPlasma/c++/tests/SlawListTest.cpp +++ b/libPlasma/c++/tests/SlawListTest.cpp @@ -40,8 +40,8 @@ class SlawListTest : public SlawTypesTest EXPECT_EQ (clst, cclst); EXPECT_TRUE (lst.Nth (c.Count ()).IsNull ()); EXPECT_TRUE (lst.Nth (c.Count () + 10).IsNull ()); - EXPECT_TRUE (lst.Nth (-int(c.Count () + 1)).IsNull ()); - EXPECT_TRUE (lst.Nth (-int(c.Count () + 10)).IsNull ()); + EXPECT_TRUE (lst.Nth (-int (c.Count () + 1)).IsNull ()); + EXPECT_TRUE (lst.Nth (-int (c.Count () + 10)).IsNull ()); c.CheckElements (lst); for (int64 i = 0, n = int64 (c.Count ()); i < n; ++i) { @@ -301,13 +301,10 @@ TEST (SlawListBasicTest, Equality) TEST (SlawListBasicTest, ExplicitConstruction) { - slaw sls[7] = {make_slaw (3), - make_slaw ("foo"), - make_slaw (3.14), - make_slaw ("bar"), - make_slaw (int64 (2000)), - make_slaw (unt32 (2)), - make_slaw ("baz")}; + slaw sls[7] = { + make_slaw (3), make_slaw ("foo"), make_slaw (3.14), + make_slaw ("bar"), make_slaw (int64 (2000)), make_slaw (unt32 (2)), + make_slaw ("baz")}; Slaw Sls[7]; for (size_t i = 0; i < 7; ++i) diff --git a/libPlasma/c++/tests/SlawMapDuplicateTest.cpp b/libPlasma/c++/tests/SlawMapDuplicateTest.cpp index 556acca9..d9799d9f 100644 --- a/libPlasma/c++/tests/SlawMapDuplicateTest.cpp +++ b/libPlasma/c++/tests/SlawMapDuplicateTest.cpp @@ -11,12 +11,12 @@ using namespace oblong::plasma; namespace { -const char *const words[] = - {"mortals", "foolish", "pallor", "cadaverous", "aura", - "foreboding", "metamorphosis", "disquieting", "observation", "dismaying", - "no", "windows", "no", "doors", "challenge", - "chilling", "way", "out", "way", "my", - "frighten", "prematurely"}; +const char *const words[] = { + "mortals", "foolish", "pallor", "cadaverous", "aura", + "foreboding", "metamorphosis", "disquieting", "observation", "dismaying", + "no", "windows", "no", "doors", "challenge", + "chilling", "way", "out", "way", "my", + "frighten", "prematurely"}; const int nwords = sizeof (words) / sizeof (words[0]); const int npairs = nwords / 2; diff --git a/libPlasma/c++/tests/SlawMapTest.cpp b/libPlasma/c++/tests/SlawMapTest.cpp index 45b69a13..b4a6c1a8 100644 --- a/libPlasma/c++/tests/SlawMapTest.cpp +++ b/libPlasma/c++/tests/SlawMapTest.cpp @@ -165,12 +165,12 @@ void check_elements (slaw *values, size_t n, const Slaw &m) TEST_F (SlawMapTest, ExplicitConstructors) { - slaw sls[14] = - {make_slaw (3), make_slaw (4), make_slaw ("foo"), - make_slaw ("e"), make_slaw (3.14), make_slaw (3.14), - make_slaw ("bar"), make_slaw (2), make_slaw (int64 (2000)), - make_slaw ("int64"), make_slaw (unt32 (2)), make_slaw ("aha"), - make_slaw ("baz"), make_slaw (1234543)}; + slaw sls[14] = { + make_slaw (3), make_slaw (4), make_slaw ("foo"), + make_slaw ("e"), make_slaw (3.14), make_slaw (3.14), + make_slaw ("bar"), make_slaw (2), make_slaw (int64 (2000)), + make_slaw ("int64"), make_slaw (unt32 (2)), make_slaw ("aha"), + make_slaw ("baz"), make_slaw (1234543)}; Slaw Sls[14]; for (size_t i = 0; i < 14; ++i) @@ -479,10 +479,9 @@ TEST_F (SlawMapTest, Nth) TEST_F (SlawMapTest, MapOfMaps) { - Slaw map = - Slaw::Map (unt32 (2), Slaw::Map ("blue", unt32 (0), "logo", unt32 (1)), - unt32 (3), Slaw::Map ("yellow", unt32 (0), "green", unt32 (1), - "blue", unt32 (2))); + Slaw map = Slaw::Map ( + unt32 (2), Slaw::Map ("blue", unt32 (0), "logo", unt32 (1)), unt32 (3), + Slaw::Map ("yellow", unt32 (0), "green", unt32 (1), "blue", unt32 (2))); Slaw keys (Slaw::List (unt32 (2), unt32 (3))); Slaw vals (Slaw::List (map.Find (unt32 (2)), map.Find (unt32 (3)))); diff --git a/libPlasma/c++/tests/SlawSerializationTest.cpp b/libPlasma/c++/tests/SlawSerializationTest.cpp index d6aa32a9..fc1b0a3a 100644 --- a/libPlasma/c++/tests/SlawSerializationTest.cpp +++ b/libPlasma/c++/tests/SlawSerializationTest.cpp @@ -70,13 +70,13 @@ TEST (SlawSerializationTest, LousySerialization) { Slaw from; Slaw to; - } data[] = - {{Slaw (unt16 (124)), Slaw (int64 (124))}, - {Slaw (float32 (3.141)), Slaw (float64 (3.141))}, - {Slaw (int64 (12321312)), Slaw ()}, - {Slaw (int64 (1)), Slaw ()}, - {Slaw ("a string"), Slaw ()}, - {Slaw::List ("a", "b", int8 (2)), Slaw::List ("a", "b", int64 (2))}}; + } data[] = { + {Slaw (unt16 (124)), Slaw (int64 (124))}, + {Slaw (float32 (3.141)), Slaw (float64 (3.141))}, + {Slaw (int64 (12321312)), Slaw ()}, + {Slaw (int64 (1)), Slaw ()}, + {Slaw ("a string"), Slaw ()}, + {Slaw::List ("a", "b", int8 (2)), Slaw::List ("a", "b", int64 (2))}}; const int N (sizeof (data) / sizeof (data[0])); diff --git a/libPlasma/c++/tests/SlawTest.cpp b/libPlasma/c++/tests/SlawTest.cpp index 189eafc6..e2910572 100644 --- a/libPlasma/c++/tests/SlawTest.cpp +++ b/libPlasma/c++/tests/SlawTest.cpp @@ -202,8 +202,8 @@ SomeSlaw::SomeSlaw () larger_meaning (int32 (42)), negativity (int8 (-1)), sixty_four_bits (unt64 (OB_CONST_U64 (0xdefacedbadfacade))), - really (bool(true)), - not_so_much (bool(false)), + really (bool (true)), + not_so_much (bool (false)), unready ("\303\246thelred-the-unready"), foo ("foo"), empty ("") diff --git a/libPlasma/c++/tests/SlawTypesTest.cpp b/libPlasma/c++/tests/SlawTypesTest.cpp index 231dcaed..31de3916 100644 --- a/libPlasma/c++/tests/SlawTypesTest.cpp +++ b/libPlasma/c++/tests/SlawTypesTest.cpp @@ -161,11 +161,10 @@ void SlawTypesTest::TestVectorClasses () void SlawTypesTest::TestVect () { - oblong::loam::Vect vs[] = {oblong::loam::Vect (0, 1, 2), - oblong::loam::Vect (-3.14159265358979, - 2.718281828459045, - 9902345.009123), - oblong::loam::Vect ()}; + oblong::loam::Vect vs[] = { + oblong::loam::Vect (0, 1, 2), + oblong::loam::Vect (-3.14159265358979, 2.718281828459045, 9902345.009123), + oblong::loam::Vect ()}; wrapped_slaw_test_v (this, vs); } diff --git a/libPlasma/c/await_test.c b/libPlasma/c/await_test.c index 91ebee33..8b5289a0 100644 --- a/libPlasma/c/await_test.c +++ b/libPlasma/c/await_test.c @@ -129,8 +129,9 @@ static void *await_main (void *arg) else if (prot == NULL) { pool_withdraw (ph); - OB_LOG_ERROR_CODE (0x2040002f, "[u%d] await thread %d prot was NULL, " - "returning 1\n", + OB_LOG_ERROR_CODE (0x2040002f, + "[u%d] await thread %d prot was NULL, " + "returning 1\n", ubi, thread_num); return (void *) 1; } @@ -369,8 +370,9 @@ static void *forever_await_main (void *arg) if (pret == POOL_AWAIT_WOKEN) return (void *) 0; - OB_LOG_ERROR_CODE (0x20400016, "[u%d] pool_await_next returned '%s' but " - "expected POOL_AWAIT_WOKEN\n", + OB_LOG_ERROR_CODE (0x20400016, + "[u%d] pool_await_next returned '%s' but " + "expected POOL_AWAIT_WOKEN\n", ubi, ob_error_string (pret)); return (void *) 1; @@ -396,8 +398,9 @@ static void *wakeup_main (void *arg) // We can't just depend on the return (void*)1 to fail the test, // because if the wakeup failed, forever_await_main will wait forever, // and the test will never exit at all. - OB_FATAL_ERROR_CODE (0x20400019, "[u%d] pool_hose_wake_up returned '%s' but " - "expected OB_OK\n", + OB_FATAL_ERROR_CODE (0x20400019, + "[u%d] pool_hose_wake_up returned '%s' but " + "expected OB_OK\n", ubi, ob_error_string (err)); return (void *) 1; } @@ -478,8 +481,9 @@ static pthread_t *create_threads (int my_nthreads, int i; pthread_t *threads = (pthread_t *) malloc (my_nthreads * sizeof (*threads)); if (!threads) - OB_FATAL_ERROR_CODE (0x20400030, "[u%d] Can't allocate thread struct array " - "for %d threads\n", + OB_FATAL_ERROR_CODE (0x20400030, + "[u%d] Can't allocate thread struct array " + "for %d threads\n", ubi, my_nthreads); for (i = 0; i < my_nthreads; i++) @@ -589,10 +593,9 @@ static int mainish (int argc, char *argv[]) forever_awaiting_gang = NULL; pret = pool_create (cmd.pool_name, cmd.type, cmd.create_options); if (pret != OB_OK) - OB_FATAL_ERROR_CODE (0x20400020, - "[u%d] no can create %s (%" OB_FMT_64 "u): %s\n", - ubi, cmd.pool_name, cmd.size, - ob_error_string (pret)); + OB_FATAL_ERROR_CODE ( + 0x20400020, "[u%d] no can create %s (%" OB_FMT_64 "u): %s\n", ubi, + cmd.pool_name, cmd.size, ob_error_string (pret)); // Each thread must now open the pool to get its own private pool // hose, otherwise they will stomp on each other's pool indexes. diff --git a/libPlasma/c/bin2yaml.c b/libPlasma/c/bin2yaml.c index b94d0efe..d2732eb3 100644 --- a/libPlasma/c/bin2yaml.c +++ b/libPlasma/c/bin2yaml.c @@ -53,11 +53,9 @@ int main (int argc, char **argv) if (argc != 2) usage (); - slaw options = - slaw_map_inline_cf ("tag_numbers", slaw_boolean (!lossy), - "ordered_maps", slaw_boolean (!lossy), - "directives", slaw_boolean (directives), - NULL); + slaw options = slaw_map_inline_cf ( + "tag_numbers", slaw_boolean (!lossy), "ordered_maps", slaw_boolean (!lossy), + "directives", slaw_boolean (directives), NULL); err = slaw_input_open_binary (argv[0], &in); OB_DIE_ON_ERROR (err); diff --git a/libPlasma/c/fifo_ops.c b/libPlasma/c/fifo_ops.c index 863b5f35..e33c408a 100644 --- a/libPlasma/c/fifo_ops.c +++ b/libPlasma/c/fifo_ops.c @@ -142,8 +142,8 @@ void pool_fifo_multi_destroy_awaiter (pool_hose ph) ph->name, ph->fifo_path); if (ph->fifo_path[0] != 0) if (unlink (ph->fifo_path) != 0) - ob_log (OBLV_DBUG, 0x20100004, "Couldn't unlink fifo %s: ", - ph->fifo_path); + ob_log (OBLV_DBUG, 0x20100004, + "Couldn't unlink fifo %s: ", ph->fifo_path); ph->fifo_path[0] = 0; pool_notification_unlock (ph); @@ -489,8 +489,8 @@ ob_retort pool_fifo_wake_awaiters (pool_hose ph) ob_log (OBLV_DBUG, 0x2010000e, "Unlinking orphaned fifo %s\n", fifo_path); if (unlink (fifo_path) != 0) - ob_log (OBLV_DBUG, 0x2010000f, "Couldn't unlink fifo %s: ", - fifo_path); + ob_log (OBLV_DBUG, 0x2010000f, + "Couldn't unlink fifo %s: ", fifo_path); continue; } else if (erryes == EACCES) @@ -508,8 +508,8 @@ ob_retort pool_fifo_wake_awaiters (pool_hose ph) "fifo:\n%s\n", strerror (erryes), fifo_path); if (unlink (fifo_path) != 0) - ob_log (OBLV_DBUG, 0x20100011, "Couldn't unlink fifo %s: ", - fifo_path); + ob_log (OBLV_DBUG, 0x20100011, + "Couldn't unlink fifo %s: ", fifo_path); continue; } } diff --git a/libPlasma/c/fill_pool.c b/libPlasma/c/fill_pool.c index 8b348bad..28207f75 100644 --- a/libPlasma/c/fill_pool.c +++ b/libPlasma/c/fill_pool.c @@ -22,7 +22,7 @@ int main (int argc, char *argv[]) pool_cmd_info cmd; int c; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "s:t:")) != -1) { @@ -44,8 +44,9 @@ int main (int argc, char *argv[]) ob_retort pret = pool_create (cmd.pool_name, cmd.type, cmd.create_options); if ((pret != OB_OK) && (pret != POOL_EXISTS)) - OB_FATAL_ERROR_CODE (0x20200000, "Can't create %s: %" OB_FMT_RETORT "d" - "\n", + OB_FATAL_ERROR_CODE (0x20200000, + "Can't create %s: %" OB_FMT_RETORT "d" + "\n", cmd.pool_name, pret); pool_cmd_fill_pool (&cmd); diff --git a/libPlasma/c/fire-and-forget.c b/libPlasma/c/fire-and-forget.c index 3fc0811f..212c5daa 100644 --- a/libPlasma/c/fire-and-forget.c +++ b/libPlasma/c/fire-and-forget.c @@ -41,7 +41,7 @@ int main (int argc, char **argv) NULL, // Use parent's starting directory &si, // Pointer to STARTUPINFO structure &pi) // Pointer to PROCESS_INFORMATION structure - ) + ) { printf ("CreateProcess failed (%d).\n", GetLastError ()); return 1; diff --git a/libPlasma/c/matrix_test.c b/libPlasma/c/matrix_test.c index bef9fec8..1ef18dfe 100644 --- a/libPlasma/c/matrix_test.c +++ b/libPlasma/c/matrix_test.c @@ -479,9 +479,8 @@ static void create_children (void) d->thread_results = 0; d->is_depositor = true; - d->thread_handle = - (HANDLE) _beginthreadex (NULL, 0, child_depositor_thread, - (void *) d, 0, NULL); + d->thread_handle = (HANDLE) _beginthreadex ( + NULL, 0, child_depositor_thread, (void *) d, 0, NULL); if (d->thread_handle == 0) { @@ -500,9 +499,8 @@ static void create_children (void) d->thread_results = 0; d->is_depositor = false; - d->thread_handle = - (HANDLE) _beginthreadex (NULL, 0, child_reader_thread, (void *) d, - 0, NULL); + d->thread_handle = (HANDLE) _beginthreadex ( + NULL, 0, child_reader_thread, (void *) d, 0, NULL); if (d->thread_handle == 0) { @@ -691,9 +689,8 @@ static int reap_children (void) } else { - OB_LOG_ERROR_CODE (0x2020101c, - "child process %d ceased to exist... but why?\n", - err); + OB_LOG_ERROR_CODE ( + 0x2020101c, "child process %d ceased to exist... but why?\n", err); all_errors |= 0xffff; } } diff --git a/libPlasma/c/multi_test.c b/libPlasma/c/multi_test.c index 8e6732f7..9634f4fa 100644 --- a/libPlasma/c/multi_test.c +++ b/libPlasma/c/multi_test.c @@ -27,7 +27,7 @@ int main (int argc, char *argv[]) ob_retort pret; int c; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "s:t:")) != -1) { switch (c) diff --git a/libPlasma/c/ossl/ossl-client.c b/libPlasma/c/ossl/ossl-client.c index fdeaff5e..21804776 100644 --- a/libPlasma/c/ossl/ossl-client.c +++ b/libPlasma/c/ossl/ossl-client.c @@ -19,24 +19,25 @@ static ob_once_t ossl_client_once_control = OB_ONCE_INIT; static void init_client_context (void) { - ossl_client_init_client_retort = ob_ossl_create_context (SSLv23_client_method, &ossl_client_context); + ossl_client_init_client_retort = + ob_ossl_create_context (SSLv23_client_method, &ossl_client_context); if (ossl_client_init_client_retort >= OB_OK) { if (ob_tls_num_cert_authorities > 0) - SSL_CTX_set_verify (ossl_client_context, SSL_VERIFY_PEER, OREILLY_verify_callback); + SSL_CTX_set_verify (ossl_client_context, SSL_VERIFY_PEER, + OREILLY_verify_callback); else ossl_client_init_client_retort = POOL_ANONYMOUS_ONLY; - char *certificate_chain = - ob_resolve_standard_path (ob_etc_path, "client-certificate-chain.pem", - "RF"); + char *certificate_chain = ob_resolve_standard_path ( + ob_etc_path, "client-certificate-chain.pem", "RF"); char *private_key = ob_resolve_standard_path (ob_etc_path, "client-private-key.pem", "RF"); if (certificate_chain && private_key) { int dmy; /* unused */ - ob_retort tort = - ob_ossl_setup_certs (ossl_client_context, certificate_chain, private_key, &dmy); + ob_retort tort = ob_ossl_setup_certs ( + ossl_client_context, certificate_chain, private_key, &dmy); if (tort < OB_OK) ossl_client_init_client_retort = tort; } @@ -47,7 +48,8 @@ static void init_client_context (void) ob_retort ob_tls_client_available (void) { - const ob_retort tort = ob_once (&ossl_client_once_control, init_client_context); + const ob_retort tort = + ob_once (&ossl_client_once_control, init_client_context); if (tort < OB_OK) return tort; return ossl_client_init_client_retort; diff --git a/libPlasma/c/ossl/ossl-common.c b/libPlasma/c/ossl/ossl-common.c index 5843a8b7..c240b3a7 100644 --- a/libPlasma/c/ossl/ossl-common.c +++ b/libPlasma/c/ossl/ossl-common.c @@ -354,7 +354,7 @@ ob_retort ob_ossl_create_context (method_func mfun, SSL_CTX **ctx_out) | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 ; -// clang-format on + // clang-format on #ifdef SSL_OP_NO_TLSv1_3 /* (partially?) work around hang in openssl 1.1.1b. @@ -482,8 +482,9 @@ static void *ossl_common_thread_main (void *v) OB_LOG_DEBUG_CODE (0x20500005, "started new thread\n"); transfer_entropy (); t[1] = ob_monotonic_time (); - OB_LOG_DEBUG_CODE (0x20500006, "entropy transfer took %" OB_FMT_64 "u ns\n" - "performing handshake\n", + OB_LOG_DEBUG_CODE (0x20500006, + "entropy transfer took %" OB_FMT_64 "u ns\n" + "performing handshake\n", t[1] - t[0]); long err509; long ssl_error = 0; @@ -512,13 +513,13 @@ static void *ossl_common_thread_main (void *v) const int interpretation = SSL_get_error (args.B, ret); char *errstack = ob_ossl_err_as_string (); char buf[160]; - OB_LOG_ERROR_CODE (0x20500007, "SSL handshake error!\n" - "ret was %d, interpretation was %s\n" - "%s", + OB_LOG_ERROR_CODE (0x20500007, + "SSL handshake error!\n" + "ret was %d, interpretation was %s\n" + "%s", ret, - ob_ossl_interpretation_as_string (buf, sizeof (buf), - interpretation, - erryes), + ob_ossl_interpretation_as_string ( + buf, sizeof (buf), interpretation, erryes), errstack); free (errstack); t[2] = erryes; @@ -540,19 +541,19 @@ static void *ossl_common_thread_main (void *v) shrink_spaces (fub, sizeof (fub), SSL_CIPHER_description (SSL_get_current_cipher (args.B), buf, sizeof (buf))); - OB_LOG_INFO_CODE (0x2050000f, - "Connected securely using %s with cipher suite:\n%s", - mangle_version (vers, sizeof (vers), - SSL_get_version (args.B)), - fub); + OB_LOG_INFO_CODE ( + 0x2050000f, "Connected securely using %s with cipher suite:\n%s", + mangle_version (vers, sizeof (vers), SSL_get_version (args.B)), fub); t[2] = ob_monotonic_time (); - OB_LOG_DEBUG_CODE (0x20500008, "handshake took %" OB_FMT_64 "u ns\n" - "starting data transfer\n", + OB_LOG_DEBUG_CODE (0x20500008, + "handshake took %" OB_FMT_64 "u ns\n" + "starting data transfer\n", t[2] - t[1]); OREILLY_data_transfer (args.A, args.B); t[3] = ob_monotonic_time (); - OB_LOG_DEBUG_CODE (0x20500009, "data transfer took %" OB_FMT_64 "u ns\n" - "cleaning up thread-local data\n", + OB_LOG_DEBUG_CODE (0x20500009, + "data transfer took %" OB_FMT_64 "u ns\n" + "cleaning up thread-local data\n", t[3] - t[2]); } @@ -733,7 +734,8 @@ ob_retort ob_ossl_launch_thread (int clear_sock, int cipher_sock, if (host) ob_safe_copy_string (args->host, sizeof (args->host), host); - const int ptc_ret = pthread_create (thr_out, NULL, ossl_common_thread_main, args); + const int ptc_ret = + pthread_create (thr_out, NULL, ossl_common_thread_main, args); if (ptc_ret != 0) return ob_errno_to_retort (ptc_ret); return OB_OK; @@ -814,17 +816,19 @@ ob_retort ob_tls_banner (FILE *where) if (0 == strcmp (build_version, run_version)) fprintf (where, "%s %s\n", run_version, ecc); else - fprintf (where, "%s (build-time) %s\n" - " %s (run-time)\n", + fprintf (where, + "%s (build-time) %s\n" + " %s (run-time)\n", build_version, ecc, run_version); fprintf (where, "\nCertificate-based ciphersuites can be customized " "with " OB_CIPHER_SUITES " environment variable.\nCurrently: %s\n", get_authenticated_ciphers ()); - fprintf (where, "\nAnonymous ciphersuites can be customized " - "with " OB_CIPHER_SUITES_ANON - " environment variable.\nCurrently: %s\n", + fprintf (where, + "\nAnonymous ciphersuites can be customized " + "with " OB_CIPHER_SUITES_ANON + " environment variable.\nCurrently: %s\n", get_anonymous_ciphers ()); return OB_OK; @@ -847,8 +851,9 @@ ob_retort ob_ossl_setup_certs (SSL_CTX *ctx, const char *certificate_chain, const char *badfunc; const char *badfile; - OB_LOG_INFO_CODE (0x20500013, "Loading certificate chain from '%s'\n" - "and private key from '%s'\n", + OB_LOG_INFO_CODE (0x20500013, + "Loading certificate chain from '%s'\n" + "and private key from '%s'\n", certificate_chain, private_key); badfunc = "SSL_CTX_use_certificate_chain_file"; @@ -894,7 +899,7 @@ ob_retort ob_ossl_setup_certs (SSL_CTX *ctx, const char *certificate_chain, badfile = private_key; if (1 != SSL_CTX_check_private_key (ctx)) { - bad: +bad: errstack = ob_ossl_err_as_string (); OB_LOG_ERROR_CODE (0x20500014, "certificate unhappiness in %s on %s:\n%s", badfunc, badfile, errstack); diff --git a/libPlasma/c/ossl/ossl-io.c b/libPlasma/c/ossl/ossl-io.c index aac90452..9e6464a6 100644 --- a/libPlasma/c/ossl/ossl-io.c +++ b/libPlasma/c/ossl/ossl-io.c @@ -348,13 +348,15 @@ void OREILLY_data_transfer (ob_sock_t A, SSL *B) default: /* ERROR */ erryes = errno; - OB_LOG_DEBUG_CODE (0x20501005, "code %d, " - "interpretation %s, " - "descriptor %d\n", - code, ob_ossl_interpretation_as_string ( - errbuf, sizeof (errbuf), - interpretation, erryes), - B_sock); + OB_LOG_DEBUG_CODE ( + 0x20501005, + "code %d, " + "interpretation %s, " + "descriptor %d\n", + code, + ob_ossl_interpretation_as_string (errbuf, sizeof (errbuf), + interpretation, erryes), + B_sock); goto err; } } diff --git a/libPlasma/c/ossl/ossl-server.c b/libPlasma/c/ossl/ossl-server.c index abd18684..64cc3878 100644 --- a/libPlasma/c/ossl/ossl-server.c +++ b/libPlasma/c/ossl/ossl-server.c @@ -132,7 +132,8 @@ static void init_server_context (void) ob_retort ob_tls_server_available (void) { - const ob_retort tort = ob_once (&ossl_server_once_control, init_server_context); + const ob_retort tort = + ob_once (&ossl_server_once_control, init_server_context); if (tort < OB_OK) return tort; return init_server_retort; @@ -146,11 +147,10 @@ ob_retort ob_tls_server_launch_thread (int clear_sock, int cipher_sock, if (tort < OB_OK) return tort; - return ob_ossl_launch_thread (clear_sock, cipher_sock, context, SSL_accept, - thr_out, - (init_server_retort != POOL_ANONYMOUS_ONLY), - anon_ok, client_auth_required, NULL, NULL, - NULL); + return ob_ossl_launch_thread ( + clear_sock, cipher_sock, context, SSL_accept, thr_out, + (init_server_retort != POOL_ANONYMOUS_ONLY), anon_ok, client_auth_required, + NULL, NULL, NULL); } ob_retort ob_tls_server_join_thread (pthread_t thr) diff --git a/libPlasma/c/ossl/ossl-validation.c b/libPlasma/c/ossl/ossl-validation.c index cff30b0a..3bf122b1 100644 --- a/libPlasma/c/ossl/ossl-validation.c +++ b/libPlasma/c/ossl/ossl-validation.c @@ -29,10 +29,11 @@ int OREILLY_verify_callback (int ok, X509_STORE_CTX *store) X509_NAME_oneline (X509_get_issuer_name (cert), issuer, sizeof (issuer)); X509_NAME_oneline (X509_get_subject_name (cert), subject, sizeof (subject)); - OB_LOG_ERROR_CODE (0x20503000, "-Error with certificate at depth: %i\n" - " issuer = %s\n" - " subject = %s\n" - " err %i:%s\n", + OB_LOG_ERROR_CODE (0x20503000, + "-Error with certificate at depth: %i\n" + " issuer = %s\n" + " subject = %s\n" + " err %i:%s\n", depth, issuer, subject, err, X509_verify_cert_error_string (err)); } @@ -52,9 +53,8 @@ long OREILLY_post_connection_check (SSL *ssl, const char *host, bool anon_ok) { if (anon_ok) return X509_V_OK; - OB_LOG_ERROR_CODE (0x20503001, - "certificate is required, but %s doesn't have one\n", - host); + OB_LOG_ERROR_CODE ( + 0x20503001, "certificate is required, but %s doesn't have one\n", host); goto err_occurred; } if ((extcount = X509_get_ext_count (cert)) > 0) diff --git a/libPlasma/c/p-await.c b/libPlasma/c/p-await.c index 3fff91e8..b3021114 100644 --- a/libPlasma/c/p-await.c +++ b/libPlasma/c/p-await.c @@ -27,7 +27,7 @@ int main (int argc, char **argv) pool_timestamp ts; pool_cmd_info cmd; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); if (pool_cmd_get_poolname (&cmd, argc, argv, optind)) usage (); diff --git a/libPlasma/c/p-create.c b/libPlasma/c/p-create.c index f07a49cf..4a335ceb 100644 --- a/libPlasma/c/p-create.c +++ b/libPlasma/c/p-create.c @@ -56,7 +56,7 @@ int main (int argc, char **argv) slabu *sb = slabu_new (); int gr = 0; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "g:m:s:t:i:u:vzqGRSFl4c")) != -1) { switch (c) @@ -132,10 +132,8 @@ int main (int argc, char **argv) pool_cmd_setup_options (&cmd); slaw perm = slaw_map_f (sb); - protein opts = - protein_from_ff (NULL, - slaw_maps_merge (protein_ingests (cmd.create_options), - perm, NULL)); + protein opts = protein_from_ff ( + NULL, slaw_maps_merge (protein_ingests (cmd.create_options), perm, NULL)); for (i = 0; i < argc; i++) { diff --git a/libPlasma/c/p-deposit.c b/libPlasma/c/p-deposit.c index 464d5132..0ffa9d15 100644 --- a/libPlasma/c/p-deposit.c +++ b/libPlasma/c/p-deposit.c @@ -71,7 +71,7 @@ int main (int argc, char **argv) slaw ingest; int c; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); // Get our descrips and ingests. It's okay if we have zero descrips // or ingests, null proteins are useful too. slabu *descrips = slabu_new (); diff --git a/libPlasma/c/p-info.c b/libPlasma/c/p-info.c index 77e3afbb..a17228bc 100644 --- a/libPlasma/c/p-info.c +++ b/libPlasma/c/p-info.c @@ -67,7 +67,7 @@ int main (int argc, char **argv) int ret = EXIT_SUCCESS; slaw f; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); if (pool_cmd_get_poolname (&cmd, argc, argv, optind)) usage (); @@ -95,11 +95,10 @@ int main (int argc, char **argv) } info = protein_ingests (p); terminal = slaw_path_get_bool (info, "terminal", true); - tort = - slaw_to_string_options_f (info, &yaml, - slaw_map_inline_cl ("tag_numbers", f, - "directives", f, - "ordered_maps", f, NULL)); + tort = slaw_to_string_options_f ( + info, &yaml, + slaw_map_inline_cl ("tag_numbers", f, "directives", f, "ordered_maps", + f, NULL)); protein_free (p); if (tort < OB_OK) { diff --git a/libPlasma/c/p-list.c b/libPlasma/c/p-list.c index 612f42d6..9b75a7f9 100644 --- a/libPlasma/c/p-list.c +++ b/libPlasma/c/p-list.c @@ -119,8 +119,8 @@ static slaw summarize_info (const char *poolName) } if (istep > 0) - slabu_list_add_x (sb, slaw_string_format ("%s*%" OB_FMT_64 "d", flag_str, - istep)); + slabu_list_add_x ( + sb, slaw_string_format ("%s*%" OB_FMT_64 "d", flag_str, istep)); else if (flag_str[0] != 0) slabu_list_add_x (sb, slaw_string (flag_str)); @@ -196,10 +196,11 @@ int main (int argc, char **argv) { if (tort == POOL_POOLNAME_BADTH) { - fprintf (stderr, "'%s' was not acceptable:\nA remote poolserver " - "URI should be of the form tcp://host[:port]/\n" - "e. g. tcp://redbean.oblong.com/ or " - "tcp://squash.local:1234/\n", + fprintf (stderr, + "'%s' was not acceptable:\nA remote poolserver " + "URI should be of the form tcp://host[:port]/\n" + "e. g. tcp://redbean.oblong.com/ or " + "tcp://squash.local:1234/\n", server); } else diff --git a/libPlasma/c/p-newest-idx.c b/libPlasma/c/p-newest-idx.c index 4b1f9a1c..c59a58ce 100644 --- a/libPlasma/c/p-newest-idx.c +++ b/libPlasma/c/p-newest-idx.c @@ -24,7 +24,7 @@ int main (int argc, char **argv) int64 idx; pool_cmd_info cmd; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); if (pool_cmd_get_poolname (&cmd, argc, argv, optind)) usage (); diff --git a/libPlasma/c/p-nth.c b/libPlasma/c/p-nth.c index 7023bb7a..64ef1134 100644 --- a/libPlasma/c/p-nth.c +++ b/libPlasma/c/p-nth.c @@ -31,7 +31,7 @@ int main (int argc, char **argv) if (argc < 3 || argc > 4) usage (); - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); cmd.pool_name = argv[1]; int64 ind = strtoll (argv[2], NULL, 0); diff --git a/libPlasma/c/p-oldest-idx.c b/libPlasma/c/p-oldest-idx.c index 9f0be722..ca824be7 100644 --- a/libPlasma/c/p-oldest-idx.c +++ b/libPlasma/c/p-oldest-idx.c @@ -24,7 +24,7 @@ int main (int argc, char **argv) int64 idx; pool_cmd_info cmd; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); if (pool_cmd_get_poolname (&cmd, argc, argv, optind)) usage (); diff --git a/libPlasma/c/p-sleep.c b/libPlasma/c/p-sleep.c index bc0a40ee..db8a0640 100644 --- a/libPlasma/c/p-sleep.c +++ b/libPlasma/c/p-sleep.c @@ -19,7 +19,7 @@ int main (int argc, char **argv) pool_cmd_info cmd; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); if (pool_cmd_get_poolname (&cmd, argc, argv, optind)) usage (); diff --git a/libPlasma/c/plasma-util.c b/libPlasma/c/plasma-util.c index 4c8cb960..48521714 100644 --- a/libPlasma/c/plasma-util.c +++ b/libPlasma/c/plasma-util.c @@ -121,9 +121,8 @@ static ob_retort ensure_capacity (ob_numeric_builder **nb_inout) ob_retort ob_nb_new (ob_numeric_builder **nb_out) { - *nb_out = (ob_numeric_builder *) calloc (sizeof (ob_numeric_builder) - + INITIAL_CAPACITY, - 1); + *nb_out = (ob_numeric_builder *) calloc ( + sizeof (ob_numeric_builder) + INITIAL_CAPACITY, 1); if (!*nb_out) return OB_NO_MEM; (*nb_out)->capacity = INITIAL_CAPACITY; @@ -328,21 +327,21 @@ typedef struct old_retort } old_retort; static old_retort old_retorts[] = { - {OB_UNKNOWN_ERR, 0, 2, -203}, - {OB_ARGUMENT_WAS_NULL, 0, 2, -210000}, - {SLAW_CORRUPT_PROTEIN, 0, 2, -210001}, - {SLAW_CORRUPT_SLAW, 0, 2, -210002}, + {OB_UNKNOWN_ERR, 0, 2, -203}, + {OB_ARGUMENT_WAS_NULL, 0, 2, -210000}, + {SLAW_CORRUPT_PROTEIN, 0, 2, -210001}, + {SLAW_CORRUPT_SLAW, 0, 2, -210002}, {SLAW_FABRICATOR_BADNESS, 0, 2, -210003}, - {SLAW_NOT_NUMERIC, 0, 2, -210004}, - {SLAW_RANGE_ERR, 0, 2, -210005}, - {SLAW_UNIDENTIFIED_SLAW, 0, 2, -210006}, - {SLAW_WRONG_LENGTH, 0, 2, -210007}, - {SLAW_NOT_FOUND, 0, 2, -210008}, - {POOL_NO_SUCH_PROTEIN, 0, 2, -200010}, // POOL_EMPTY - {OB_NO_MEM, 0, 2, -200530}, // POOL_MALLOC_BADTH - {POOL_INVALID_SIZE, 0, 2, -200590}, // POOL_ARG_BADTH - {POOL_NO_SUCH_PROTEIN, 0, 2, -200610}, // POOL_DISCARDED_PROTEIN - {POOL_NO_SUCH_PROTEIN, 0, 2, -200620}, // POOL_FUTURE_PROTEIN + {SLAW_NOT_NUMERIC, 0, 2, -210004}, + {SLAW_RANGE_ERR, 0, 2, -210005}, + {SLAW_UNIDENTIFIED_SLAW, 0, 2, -210006}, + {SLAW_WRONG_LENGTH, 0, 2, -210007}, + {SLAW_NOT_FOUND, 0, 2, -210008}, + {POOL_NO_SUCH_PROTEIN, 0, 2, -200010}, // POOL_EMPTY + {OB_NO_MEM, 0, 2, -200530}, // POOL_MALLOC_BADTH + {POOL_INVALID_SIZE, 0, 2, -200590}, // POOL_ARG_BADTH + {POOL_NO_SUCH_PROTEIN, 0, 2, -200610}, // POOL_DISCARDED_PROTEIN + {POOL_NO_SUCH_PROTEIN, 0, 2, -200620}, // POOL_FUTURE_PROTEIN }; #define N_OLD_RETORTS (sizeof (old_retorts) / sizeof (old_retorts[0])) diff --git a/libPlasma/c/pool-context.c b/libPlasma/c/pool-context.c index fdfd748d..489fd2e3 100644 --- a/libPlasma/c/pool-context.c +++ b/libPlasma/c/pool-context.c @@ -32,12 +32,14 @@ void pool_validate_context (pool_context ctx, const char *where) { const unt32 magic = ctx->magic; if (magic != POOL_CTX_MAGIC) - OB_FATAL_BUG_CODE (0x20111000, "in %s: %p is %s\n" - "magic is 0x%08x; should be 0x%08x\n", - where, ctx, magic == POOL_CTX_FREED - ? "an already-freed pool context" - : "not a pool context (presumed " - "memory corruption)", + OB_FATAL_BUG_CODE (0x20111000, + "in %s: %p is %s\n" + "magic is 0x%08x; should be 0x%08x\n", + where, ctx, + magic == POOL_CTX_FREED + ? "an already-freed pool context" + : "not a pool context (presumed " + "memory corruption)", magic, POOL_CTX_MAGIC); } } diff --git a/libPlasma/c/pool-log.c b/libPlasma/c/pool-log.c index 615a3465..93baf459 100644 --- a/libPlasma/c/pool-log.c +++ b/libPlasma/c/pool-log.c @@ -101,15 +101,20 @@ static pthread_t logging_pthread; /// This is a special log level, used for logging messages /// from the pool logging code, to avoid an uncomfortable /// circularity. -static ob_log_level emergency_log = - {OB_DST_FD | OB_DST_VALGRIND | OB_FLG_SHOW_CODE_OR_WHERE - | OB_FLG_SHOW_TID_NONMAIN, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED, /* red */ - LOG_ERR, 2, "error in pool logging: ", NULL, NULL, NULL, NULL}; - -static const ob_log_level tmp_level_prototype = {OB_DST_FD, 0, LOG_ERR, - 2, "", NULL, - NULL, NULL, NULL}; +static ob_log_level emergency_log = { + OB_DST_FD | OB_DST_VALGRIND | OB_FLG_SHOW_CODE_OR_WHERE + | OB_FLG_SHOW_TID_NONMAIN, + OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED, /* red */ + LOG_ERR, + 2, + "error in pool logging: ", + NULL, + NULL, + NULL, + NULL}; + +static const ob_log_level tmp_level_prototype = { + OB_DST_FD, 0, LOG_ERR, 2, "", NULL, NULL, NULL, NULL}; #define NOMORE ((log_entry *) -1) @@ -181,7 +186,7 @@ static void log_callback (const struct ob_log_level *lvl, unt64 code, float64 t, } else { - failed: +failed: /* only need to do this if not already logging to stderr */ if (!(lvl->flags & OB_DST_FD)) { diff --git a/libPlasma/c/pool-mmap-header.c b/libPlasma/c/pool-mmap-header.c index 1e3b3b48..76ac2d80 100644 --- a/libPlasma/c/pool-mmap-header.c +++ b/libPlasma/c/pool-mmap-header.c @@ -257,8 +257,9 @@ static ob_retort read_v1_header (pool_mmap_data *d) const unt64 header_bytes2 = get_header_size (d); if (header_bytes != header_bytes2) { - OB_LOG_ERROR_CODE (0x20110040, "mismatching header sizes: %" OB_FMT_64 - "u and %" OB_FMT_64 "u\n", + OB_LOG_ERROR_CODE (0x20110040, + "mismatching header sizes: %" OB_FMT_64 + "u and %" OB_FMT_64 "u\n", header_bytes, header_bytes2); return POOL_CORRUPT; } @@ -296,9 +297,8 @@ static protein make_mmap_config_protein (unt64 fsize, unt64 hsize, OB_UNUSED unt64 toc_cap) { slaw conf_b = - slaw_map_inline_cf (CFG_KEY_FILE_SIZE, slaw_unt64 (fsize), - CFG_KEY_HEADER_SIZE, slaw_unt64 (hsize), - NULL); + slaw_map_inline_cf (CFG_KEY_FILE_SIZE, slaw_unt64 (fsize), + CFG_KEY_HEADER_SIZE, slaw_unt64 (hsize), NULL); return conf_b ? protein_from_ff (NULL, conf_b) : NULL; } @@ -351,10 +351,9 @@ static ob_retort pool_mmap_bootstrap_config_v1_prime (const char *path, static ob_retort pool_mmap_bootstrap_config_v1 (pool_mmap_data *d) { - return pool_mmap_call_with_backing_file (d->ph->name, - d->ph->pool_directory_version, false, - pool_mmap_bootstrap_config_v1_prime, - d); + return pool_mmap_call_with_backing_file ( + d->ph->name, d->ph->pool_directory_version, false, + pool_mmap_bootstrap_config_v1_prime, d); } static ob_retort pool_mmap_bootstrap_config_v1_prime (const char *path, @@ -423,18 +422,18 @@ static ob_retort pool_mmap_bootstrap_config_v1_prime (const char *path, */ if (h.conf.hdr.sig != POOL_CHUNK_CONF) { - OB_LOG_ERROR_CODE (0x20110049, "POOL_CORRUPT: 0x%016" OB_FMT_64 "x != " - "0x%016" OB_FMT_64 "x\n", + OB_LOG_ERROR_CODE (0x20110049, + "POOL_CORRUPT: 0x%016" OB_FMT_64 "x != " + "0x%016" OB_FMT_64 "x\n", h.conf.hdr.sig, POOL_CHUNK_CONF); return POOL_CORRUPT; } if (h.conf.hdr.len < sizeof (h.conf) / sizeof (h.conf.hdr.len)) { - OB_LOG_ERROR_CODE (0x2011004a, - "POOL_CORRUPT: %" OB_FMT_64 "d < %" OB_FMT_SIZE "u\n", - h.conf.hdr.len, - sizeof (h.conf) / sizeof (h.conf.hdr.len)); + OB_LOG_ERROR_CODE ( + 0x2011004a, "POOL_CORRUPT: %" OB_FMT_64 "d < %" OB_FMT_SIZE "u\n", + h.conf.hdr.len, sizeof (h.conf) / sizeof (h.conf.hdr.len)); return POOL_CORRUPT; } diff --git a/libPlasma/c/pool-portable.c b/libPlasma/c/pool-portable.c index 9dd7654c..5a16d27a 100644 --- a/libPlasma/c/pool-portable.c +++ b/libPlasma/c/pool-portable.c @@ -26,9 +26,10 @@ ob_retort ob_select2_prepare (ob_select2_t *sel, ob_select2_dir dir, int sock, WSAGetLastError ()); return OB_UNKNOWN_ERR; } - if (0 != WSAEventSelect (sock, socketEvent, - FD_CLOSE - | (dir == OB_SEL2_SEND ? FD_WRITE : FD_READ))) + if (0 + != WSAEventSelect (sock, socketEvent, + FD_CLOSE + | (dir == OB_SEL2_SEND ? FD_WRITE : FD_READ))) { OB_LOG_ERROR_CODE (0x20107001, "WSAEventSelect failed - %d\n", WSAGetLastError ()); @@ -102,8 +103,9 @@ ob_retort ob_select2 (ob_select2_t *sel, pool_timestamp timeout, bool consume) default: // http://msdn.microsoft.com/en-us/library/ms687025(VS.85).aspx - OB_LOG_ERROR_CODE (0x20107004, "unexpected return value for " - "WaitForMultipleObjects = 0x%08x\n", + OB_LOG_ERROR_CODE (0x20107004, + "unexpected return value for " + "WaitForMultipleObjects = 0x%08x\n", wait_res); return OB_UNKNOWN_ERR; } @@ -115,9 +117,8 @@ ob_retort ob_select2 (ob_select2_t *sel, pool_timestamp timeout, bool consume) for (;;) { fd_set read_fds, write_fds, except_fds; - tp = - pool_timeout_to_timeval (private_incremental_timeout (timeout, &target), - &timeout_tv); + tp = pool_timeout_to_timeval ( + private_incremental_timeout (timeout, &target), &timeout_tv); read_fds = sel->read_fds; write_fds = sel->write_fds; except_fds = sel->except_fds; @@ -130,8 +131,9 @@ ob_retort ob_select2 (ob_select2_t *sel, pool_timestamp timeout, bool consume) } else if (nready == 0) return POOL_AWAIT_TIMEDOUT; - else if (sel->wake_fd >= 0 && (FD_ISSET (sel->wake_fd, &read_fds) - || FD_ISSET (sel->wake_fd, &except_fds))) + else if (sel->wake_fd >= 0 + && (FD_ISSET (sel->wake_fd, &read_fds) + || FD_ISSET (sel->wake_fd, &except_fds))) { if (consume) { @@ -142,9 +144,10 @@ ob_retort ob_select2 (ob_select2_t *sel, pool_timestamp timeout, bool consume) } return POOL_AWAIT_WOKEN; } - else if (sel->sock_fd >= 0 && (FD_ISSET (sel->sock_fd, &read_fds) - || FD_ISSET (sel->sock_fd, &write_fds) - || FD_ISSET (sel->sock_fd, &except_fds))) + else if (sel->sock_fd >= 0 + && (FD_ISSET (sel->sock_fd, &read_fds) + || FD_ISSET (sel->sock_fd, &write_fds) + || FD_ISSET (sel->sock_fd, &except_fds))) return OB_OK; else OB_LOG_ERROR_CODE (0x20107005, diff --git a/libPlasma/c/pool-toc.c b/libPlasma/c/pool-toc.c index cb9fbb09..c33b5eea 100644 --- a/libPlasma/c/pool-toc.c +++ b/libPlasma/c/pool-toc.c @@ -27,10 +27,7 @@ struct pool_toc_s index_entry entries[1]; /* start of the circular buffer */ }; -#define EMPTY_ENTRY_GUTS \ - { \ - POOL_TOC_UNKNOWN_OFFSET, POOL_TOC_UNKNOWN_TIME \ - } +#define EMPTY_ENTRY_GUTS {POOL_TOC_UNKNOWN_OFFSET, POOL_TOC_UNKNOWN_TIME} static const index_entry EMPTY_ENTRY = EMPTY_ENTRY_GUTS; @@ -199,8 +196,9 @@ static bool check_result (const pool_toc_t *pi, const pool_toc_entry *e) static void garbage_collect (pool_toc_t *pi, unt64 oldest_offset) { if (pi->count > pi->capacity) - OB_LOG_ERROR_CODE (0x20103000, "pi->count (%" OB_FMT_64 "u) is larger than " - "pi->capacity (%" OB_FMT_64 "u)\n", + OB_LOG_ERROR_CODE (0x20103000, + "pi->count (%" OB_FMT_64 "u) is larger than " + "pi->capacity (%" OB_FMT_64 "u)\n", pi->count, pi->capacity); else if (pi->count == pi->capacity) { @@ -272,9 +270,8 @@ static void add_entry (pool_toc_t *pi, const pool_toc_entry *e, /* ---------------------------------------------------------------------- */ // Public interface -const pool_toc_entry POOL_TOC_NULL_ENTRY = {POOL_TOC_UNKNOWN_IDX, - POOL_TOC_UNKNOWN_OFFSET, - POOL_TOC_UNKNOWN_TIME}; +const pool_toc_entry POOL_TOC_NULL_ENTRY = { + POOL_TOC_UNKNOWN_IDX, POOL_TOC_UNKNOWN_OFFSET, POOL_TOC_UNKNOWN_TIME}; pool_toc_t *pool_toc_read (const byte *buffer) diff --git a/libPlasma/c/pool.c b/libPlasma/c/pool.c index 89a4df1c..d505c011 100644 --- a/libPlasma/c/pool.c +++ b/libPlasma/c/pool.c @@ -215,14 +215,10 @@ void pool_enable_atfork_handlers (void) #else /* No-op on Windows. */ -void pool_disable_atfork_handlers (void) -{ -} +void pool_disable_atfork_handlers (void) {} /* Ditto. */ -void pool_enable_atfork_handlers (void) -{ -} +void pool_enable_atfork_handlers (void) {} #endif // ndef _MSC_VER @@ -791,12 +787,10 @@ static ob_retort pool_save_default_config_with_permissions (pool_hose ph, if (cf) OB_LOG_DEBUG_CODE (0x20101005, "writing sem-key %u\n", ph->sem_key); slaw m1 = - slaw_map_inline_cf ("type", slaw_string (reliable_type), - "pool-version", slaw_int32 (ph->pool_directory_version), - NULL); - slaw m2 = slaw_map_inline_cf ("sem-key", slaw_int32 (ph->sem_key), - "perms", slaw_v3int32 (perms_v), - NULL); + slaw_map_inline_cf ("type", slaw_string (reliable_type), "pool-version", + slaw_int32 (ph->pool_directory_version), NULL); + slaw m2 = slaw_map_inline_cf ("sem-key", slaw_int32 (ph->sem_key), "perms", + slaw_v3int32 (perms_v), NULL); slaw m = slaw_maps_merge (m1, (cf ? m2 : NULL), NULL); if (!m1 || !m2 || !m) return slaw_free (m1), slaw_free (m2), slaw_free (m), OB_NO_MEM; @@ -814,9 +808,8 @@ static ob_retort pool_save_default_config_with_permissions (pool_hose ph, // only exported for rewrite of config file in pool_sem.c ob_retort pool_save_default_config (pool_hose ph) { - return pool_save_default_config_with_permissions (ph, ph->perms.mode, - ph->perms.uid, - ph->perms.gid); + return pool_save_default_config_with_permissions ( + ph, ph->perms.mode, ph->perms.uid, ph->perms.gid); } static ob_retort pool_load_default_config (pool_hose ph) @@ -844,11 +837,11 @@ static ob_retort pool_load_default_config (pool_hose ph) && version != POOL_DIRECTORY_VERSION_CONFIG_IN_MMAP) { protein_free (conf); - OB_LOG_ERROR_CODE (0x20101006, "'%s' had pool-version %" OB_FMT_64 - "d, but expected either %d or %d\n", - ph->name, version, - POOL_DIRECTORY_VERSION_CONFIG_IN_FILE, - POOL_DIRECTORY_VERSION_CONFIG_IN_MMAP); + OB_LOG_ERROR_CODE ( + 0x20101006, + "'%s' had pool-version %" OB_FMT_64 "d, but expected either %d or %d\n", + ph->name, version, POOL_DIRECTORY_VERSION_CONFIG_IN_FILE, + POOL_DIRECTORY_VERSION_CONFIG_IN_MMAP); return POOL_WRONG_VERSION; } @@ -1060,9 +1053,8 @@ ob_retort pool_get_info (pool_hose ph, int64 hops, protein *return_prot) return ph->info (ph, hops, return_prot); // else, fake it - slaw ingests = slaw_map_inline_cf ("type", slaw_string (ph->method), - "terminal", slaw_boolean (true), - NULL); + slaw ingests = slaw_map_inline_cf ("type", slaw_string (ph->method), + "terminal", slaw_boolean (true), NULL); if (!ingests) return OB_NO_MEM; *return_prot = protein_from_ff (NULL, ingests); @@ -1550,7 +1542,7 @@ void pool_fetch_ex (pool_hose ph, pool_fetch_op *ops, int64 nops, tort = check_hose_validity (ph); if (tort < OB_OK) { - splatter_retort: +splatter_retort: if (oldest_idx_out) *oldest_idx_out = tort; if (newest_idx_out) @@ -1603,12 +1595,9 @@ void pool_fetch_ex (pool_hose ph, pool_fetch_op *ops, int64 nops, else { // construct a new protein with the parts we want - protein np = - protein_from_llr (ops[i].want_descrips ? protein_descrips (p) - : NULL, - ops[i].want_ingests ? protein_ingests (p) - : NULL, - rude, rlen); + protein np = protein_from_llr ( + ops[i].want_descrips ? protein_descrips (p) : NULL, + ops[i].want_ingests ? protein_ingests (p) : NULL, rude, rlen); protein_free (p); ops[i].p = np; } @@ -1618,8 +1607,9 @@ void pool_fetch_ex (pool_hose ph, pool_fetch_op *ops, int64 nops, int64 idx; if (OB_OK == pool_oldest_index (ph, &idx)) { - if (idx > ops[i].idx || (OB_OK == pool_newest_index (ph, &idx) - && idx < ops[i].idx)) + if (idx > ops[i].idx + || (OB_OK == pool_newest_index (ph, &idx) + && idx < ops[i].idx)) { ops[i].idx = idx; /* clamp the index to oldest or newest */ i--; /* and go round again */ @@ -1754,9 +1744,8 @@ static ob_retort pool_list_internal (slabu *sb, const char *dir_path, int prefix) { struct dirent **namelist = NULL; - const int nentries = - ob_scandir (dir_path, &namelist, filter_out_dot_and_doubledot, - hackishly_sort_my_way); + const int nentries = ob_scandir ( + dir_path, &namelist, filter_out_dot_and_doubledot, hackishly_sort_my_way); if (nentries < 0 && errno == ENOENT) { @@ -2085,9 +2074,8 @@ static pclock_t pool_config_lock (bool need_not_exist, bprotein permissions) return result; } - OB_LOG_ERROR_CODE (0x20101018, - "unknown result waiting for config lock - %d\n", - winResult); + OB_LOG_ERROR_CODE ( + 0x20101018, "unknown result waiting for config lock - %d\n", winResult); result.status = OB_UNKNOWN_ERR; return result; @@ -2365,9 +2353,8 @@ static ob_retort __pool_create (const char *pool_uri, const char *type, { if (pool_name_is_remote (pool_uri)) { - OB_LOG_BUG_CODE (0x2010103a, - "Didn't expect that for pool '%s'\n", - pool_uri); + OB_LOG_BUG_CODE ( + 0x2010103a, "Didn't expect that for pool '%s'\n", pool_uri); return OB_UNKNOWN_ERR; } pret = __pool_dispose (pool_uri); @@ -2554,8 +2541,9 @@ ob_retort pool_create_ctx (const char *pool_uri, const char *type, options = options_map_or_prot; if (options != NULL && !slaw_is_protein (options)) { - OB_LOG_ERROR_CODE (0x20101021, "For pool '%s', options is not a map " - "or a protein\n", + OB_LOG_ERROR_CODE (0x20101021, + "For pool '%s', options is not a map " + "or a protein\n", pool_uri); return POOL_NOT_A_PROTEIN_OR_MAP; } @@ -2743,8 +2731,9 @@ ob_retort pool_participate_creatingly_ctx (const char *pool_uri, options = options_map_or_prot; if (options != NULL && !slaw_is_protein (options)) { - OB_LOG_ERROR_CODE (0x20101039, "For pool '%s', options is not a map " - "or a protein\n", + OB_LOG_ERROR_CODE (0x20101039, + "For pool '%s', options is not a map " + "or a protein\n", pool_uri); return POOL_NOT_A_PROTEIN_OR_MAP; } diff --git a/libPlasma/c/pool_cmd.c b/libPlasma/c/pool_cmd.c index 21da4dce..ad0ea686 100644 --- a/libPlasma/c/pool_cmd.c +++ b/libPlasma/c/pool_cmd.c @@ -154,9 +154,8 @@ void pool_cmd_fill_pool (pool_cmd_info *cmd) slaw hosename = slaw_string_format ("filling %s", ob_basename (cmd->pool_name)); - OB_DIE_ON_ERR_CODE (0x20102008, - pool_set_hose_name (cmd->ph, - slaw_string_emit (hosename))); + OB_DIE_ON_ERR_CODE ( + 0x20102008, pool_set_hose_name (cmd->ph, slaw_string_emit (hosename))); slaw_free (hosename); prot = pool_cmd_create_test_protein ("first"); diff --git a/libPlasma/c/pool_mmap.c b/libPlasma/c/pool_mmap.c index 32ddc621..c593c929 100644 --- a/libPlasma/c/pool_mmap.c +++ b/libPlasma/c/pool_mmap.c @@ -851,13 +851,12 @@ static void check_oldest_newest_diff (const pool_mmap_data *d, ob_retort *errp) diff = (diff >= 0) ? diff : -diff; if (diff > d->mapped_size) { - OB_LOG_ERROR_CODE (0x20104008, "hose '%s' pool '%s': " - "Difference between newest (%" OB_FMT_64 - "u) and oldest (%" OB_FMT_64 - "u) greater than pool size (%" OB_FMT_64 - "u > %" OB_FMT_64 "u)\n", - hname (d), pname (d), newest_entry, oldest_entry, diff, - d->mapped_size); + OB_LOG_ERROR_CODE ( + 0x20104008, + "hose '%s' pool '%s': " + "Difference between newest (%" OB_FMT_64 "u) and oldest (%" OB_FMT_64 + "u) greater than pool size (%" OB_FMT_64 "u > %" OB_FMT_64 "u)\n", + hname (d), pname (d), newest_entry, oldest_entry, diff, d->mapped_size); *errp = POOL_CORRUPT; } } @@ -1002,9 +1001,10 @@ static byte *entry_to_address_internal (const pool_mmap_data *d, unt64 entry, unt64 offset = entry % d->mapped_size; if (offset < POOL_MMAP_PROTEINS_START_OFFSET (d)) { - snprintf (errmsg, errmsg_len, "Entry %" OB_FMT_64 "u was unexpectedly " - "in pool header\n" - "(%" OB_FMT_64 "u < %" OB_FMT_64 "u)\n", + snprintf (errmsg, errmsg_len, + "Entry %" OB_FMT_64 "u was unexpectedly " + "in pool header\n" + "(%" OB_FMT_64 "u < %" OB_FMT_64 "u)\n", entry, offset, POOL_MMAP_PROTEINS_START_OFFSET (d)); *errp = POOL_CORRUPT; return (byte *) ¬hing; @@ -1067,8 +1067,9 @@ static unt64 get_first_entry (const pool_mmap_data *d, ob_retort *errp) unt64 first_entry = newest_entry - offset; // Add back in the protein start offset first_entry += POOL_MMAP_PROTEINS_START_OFFSET (d); - OB_LOG_DEBUG_CODE (0x20104046, "newest = 0x%016" OB_FMT_64 "x\n" - "first = 0x%016" OB_FMT_64 "x\n", + OB_LOG_DEBUG_CODE (0x20104046, + "newest = 0x%016" OB_FMT_64 "x\n" + "first = 0x%016" OB_FMT_64 "x\n", newest_entry, first_entry); return first_entry; } @@ -1090,9 +1091,10 @@ static unt64 get_first_valid_entry (const pool_mmap_data *d, ob_retort *errp) if (already_failed (errp)) return 0; - OB_LOG_DEBUG_CODE (0x20104045, "mapped_size = 0x%016" OB_FMT_64 "x\n" - "oldest = 0x%016" OB_FMT_64 "x\n" - "first = 0x%016" OB_FMT_64 "x\n", + OB_LOG_DEBUG_CODE (0x20104045, + "mapped_size = 0x%016" OB_FMT_64 "x\n" + "oldest = 0x%016" OB_FMT_64 "x\n" + "first = 0x%016" OB_FMT_64 "x\n", d->mapped_size, oldest, first); if (oldest > first) return oldest; @@ -1408,9 +1410,8 @@ static int64 jumpback_size_from_entry_safe (const pool_mmap_data *d, { if (already_failed (errp)) return 0; - int64 jumpback = - *(volatile int64 *) entry_to_address (d, entry - POOL_MMAP_JUMPBACK_LEN, - errp); + int64 jumpback = *(volatile int64 *) entry_to_address ( + d, entry - POOL_MMAP_JUMPBACK_LEN, errp); if (is_entry_stompled (d, entry, errp) || already_failed (errp)) return -1; if (jumpback <= (POOL_MMAP_JUMPBACK_LEN + POOL_MMAP_PROTEIN_OFFSET (d))) @@ -1768,35 +1769,34 @@ static unt64 pool_prepare_write (pool_mmap_data *d, bprotein p, ob_retort *errp) if ((new_oldest_entry != write_entry) && (new_oldest_index >= (newest_index + 1))) { - OB_LOG_ERROR_CODE (0x20104018, "hose '%s' pool '%s': " - "new oldest index (%" OB_FMT_64 - "u) passed write index (%" OB_FMT_64 - "u) during wraparound\n", - hname (d), pname (d), new_oldest_index, - newest_index + 1); + OB_LOG_ERROR_CODE ( + 0x20104018, + "hose '%s' pool '%s': " + "new oldest index (%" OB_FMT_64 "u) passed write index (%" OB_FMT_64 + "u) during wraparound\n", + hname (d), pname (d), new_oldest_index, newest_index + 1); *errp = POOL_CORRUPT; return 0; } if (new_oldest_index < oldest_index) { - OB_LOG_ERROR_CODE (0x20104019, - "hose '%s' pool '%s': " - "new oldest index (%" OB_FMT_64 - "u) is before old oldest " - "index (%" OB_FMT_64 "u) during wraparound\n" - "Some additional info for debugging bug 2085:\n" - "newest_index = %" OB_FMT_64 "u\n" - "first_index = %" OB_FMT_64 "u\n" - "new_oldest_entry = 0x%016" OB_FMT_64 "x\n" - "newest_entry = 0x%016" OB_FMT_64 "x\n" - "oldest_entry = 0x%016" OB_FMT_64 "x\n" - "first_entry = 0x%016" OB_FMT_64 "x\n" - "sz = %" OB_FMT_64 "u\n" - "write_len = %" OB_FMT_64 "u\n", - hname (d), pname (d), new_oldest_index, - oldest_index, newest_index, first_index, - new_oldest_entry, newest_entry, oldest_entry, - first_entry, sz, write_len); + OB_LOG_ERROR_CODE ( + 0x20104019, + "hose '%s' pool '%s': " + "new oldest index (%" OB_FMT_64 "u) is before old oldest " + "index (%" OB_FMT_64 "u) during wraparound\n" + "Some additional info for debugging bug 2085:\n" + "newest_index = %" OB_FMT_64 "u\n" + "first_index = %" OB_FMT_64 "u\n" + "new_oldest_entry = 0x%016" OB_FMT_64 "x\n" + "newest_entry = 0x%016" OB_FMT_64 "x\n" + "oldest_entry = 0x%016" OB_FMT_64 "x\n" + "first_entry = 0x%016" OB_FMT_64 "x\n" + "sz = %" OB_FMT_64 "u\n" + "write_len = %" OB_FMT_64 "u\n", + hname (d), pname (d), new_oldest_index, oldest_index, newest_index, + first_index, new_oldest_entry, newest_entry, oldest_entry, + first_entry, sz, write_len); *errp = POOL_CORRUPT; return 0; } @@ -1824,11 +1824,11 @@ static unt64 pool_prepare_write (pool_mmap_data *d, bprotein p, ob_retort *errp) } if ((write_addr + write_len) > (d->mem + d->mapped_size)) { - OB_LOG_ERROR_CODE (0x2010401c, "hose '%s' pool '%s': " - "CORRUPTION!!! write %p - %" OB_FMT_64 - "u > pool size %p\n", - hname (d), pname (d), write_addr, write_len, - d->mem + d->mapped_size); + OB_LOG_ERROR_CODE ( + 0x2010401c, + "hose '%s' pool '%s': " + "CORRUPTION!!! write %p - %" OB_FMT_64 "u > pool size %p\n", + hname (d), pname (d), write_addr, write_len, d->mem + d->mapped_size); *errp = POOL_CORRUPT; return 0; } @@ -1956,9 +1956,10 @@ ob_retort pool_mmap_deposit (pool_hose ph, bprotein p, int64 *idx, unt64 write_entry = pool_prepare_write (d, p, &pret); if (former_newest_entry == write_entry && !already_failed (&pret)) { - OB_LOG_ERROR_CODE (0x2010401d, "hose '%s' pool '%s': " - "CORRUPTION!!! prepare write returned " - "newest entry %" OB_FMT_64 "u\n", + OB_LOG_ERROR_CODE (0x2010401d, + "hose '%s' pool '%s': " + "CORRUPTION!!! prepare write returned " + "newest entry %" OB_FMT_64 "u\n", hname (d), pname (d), write_entry); pret = POOL_CORRUPT; } @@ -2002,13 +2003,12 @@ ob_retort pool_mmap_deposit (pool_hose ph, bprotein p, int64 *idx, { pool_toc_entry e = {newest_index, newest_entry, timestamp}; if (!pool_toc_append (d->ptoc, e, get_oldest_entry (d))) - OB_LOG_ERROR_CODE (0x2010401e, - "hose '%s' pool '%s': " - "failure registering protein in pool index: " - "offset: %" OB_FMT_64 - "u, time: %lf, index: %" OB_FMT_64 "u\n", - hname (d), pname (d), write_entry, timestamp, - newest_index); + OB_LOG_ERROR_CODE ( + 0x2010401e, + "hose '%s' pool '%s': " + "failure registering protein in pool index: " + "offset: %" OB_FMT_64 "u, time: %lf, index: %" OB_FMT_64 "u\n", + hname (d), pname (d), write_entry, timestamp, newest_index); } if (!already_failed (&pret)) @@ -2229,10 +2229,11 @@ static bool find_starting_point (const pool_mmap_data *d, int64 target_index, *starting_index = entry_to_index (d, *starting_entry, errp); } - OB_LOG_DEBUG_CODE (0x20104043, "cached_okay = %s\n" - "target_index = %" OB_FMT_64 "d\n" - "first_index = %" OB_FMT_64 "d\n" - "first_entry = 0x%016" OB_FMT_64 "x\n", + OB_LOG_DEBUG_CODE (0x20104043, + "cached_okay = %s\n" + "target_index = %" OB_FMT_64 "d\n" + "first_index = %" OB_FMT_64 "d\n" + "first_entry = 0x%016" OB_FMT_64 "x\n", cached_okay ? "true" : "false", target_index, first_index, first_entry); @@ -2249,7 +2250,7 @@ static bool find_starting_point (const pool_mmap_data *d, int64 target_index, { *ending_entry = get_newest_entry (d); *ending_index = entry_to_index (d, *ending_entry, errp); - is_backwards_search_point_okay: +is_backwards_search_point_okay: if (entry_to_address (d, *ending_entry, errp) > entry_to_address (d, first_entry, errp) && !is_entry_stompled (d, first_entry, errp)) @@ -2320,9 +2321,10 @@ static bool find_next_index (const pool_mmap_data *d, int64 *idx, unt64 *entry, // Sanity check the new index - maybe we got garbage? if (*idx != last_index + 1) { - OB_LOG_ERROR_CODE (0x2010401f, "hose '%s' pool '%s': " - "Next search index %" OB_FMT_64 "u" - " but last search index %" OB_FMT_64 "u\n", + OB_LOG_ERROR_CODE (0x2010401f, + "hose '%s' pool '%s': " + "Next search index %" OB_FMT_64 "u" + " but last search index %" OB_FMT_64 "u\n", hname (d), pname (d), *idx, last_index); *errp = POOL_CORRUPT; return false; @@ -2376,8 +2378,9 @@ static bool find_in_range (pool_mmap_data *d, int64 idx, unt64 *ret_entry, unt64 success_count = 0, failure_count = 0, count = 0, step = 0; while (seeking && !already_failed (errp)) { - if (count++ == 0 || (count > TOO_SMALL_TO_MATTER && !refined && step != 0 - && count % step == 0)) + if (count++ == 0 + || (count > TOO_SMALL_TO_MATTER && !refined && step != 0 + && count % step == 0)) { bool approx_found = false; refined = @@ -2452,11 +2455,12 @@ static ob_retort find_entry (pool_mmap_data *d, int64 idx, unt64 *ret_entry) while (find_starting_point (d, idx, &search_index, &search_entry, &backwards_index, &backwards_entry, &tort)) { - OB_LOG_DEBUG_CODE (0x20104042, "idx = %" OB_FMT_64 "d\n" - "search_index = %" OB_FMT_64 "d\n" - "search_entry = 0x%016" OB_FMT_64 "x\n" - "backwards_index = %" OB_FMT_64 "d\n" - "backwards_entry = 0x%016" OB_FMT_64 "x\n", + OB_LOG_DEBUG_CODE (0x20104042, + "idx = %" OB_FMT_64 "d\n" + "search_index = %" OB_FMT_64 "d\n" + "search_entry = 0x%016" OB_FMT_64 "x\n" + "backwards_index = %" OB_FMT_64 "d\n" + "backwards_entry = 0x%016" OB_FMT_64 "x\n", idx, search_index, search_entry, backwards_index, backwards_entry); if (find_in_range (d, idx, ret_entry, &search_index, &search_entry, @@ -2836,10 +2840,11 @@ static OB_UNUSED ob_retort pool_mmap_nth_protein1 (pool_mmap_data *d, int64 idx, // Sanity check on protein size if (len <= 0 || len > MAX_SLAW_SIZE) { - OB_LOG_ERROR_CODE (0x20104051, "hose '%s' pool '%s':\n" - "protein length %" OB_FMT_64 "d is\n" - "greater than maximum %" OB_FMT_64 "u,\n" - "and therefore probably bogus.\n", + OB_LOG_ERROR_CODE (0x20104051, + "hose '%s' pool '%s':\n" + "protein length %" OB_FMT_64 "d is\n" + "greater than maximum %" OB_FMT_64 "u,\n" + "and therefore probably bogus.\n", hname (d), pname (d), len, MAX_SLAW_SIZE); return POOL_CORRUPT; } @@ -2971,7 +2976,12 @@ static void one_flag (bslaw options, unt64 *current, const char *name, *current &= ~flag; } -typedef enum { NEVER, RESIZABLE, ALWAYS } when_supported; +typedef enum +{ + NEVER, + RESIZABLE, + ALWAYS +} when_supported; typedef struct { @@ -2984,20 +2994,20 @@ typedef struct // names must be alphabetized, because we use bsearch() static const option_info pool_opts[] = { - {"auto-dispose", 'a', NEVER, RESIZABLE, POOL_FLAG_AUTO_DISPOSE}, - {"checksum", 'c', RESIZABLE, NEVER, POOL_FLAG_CHECKSUM}, - {"flock", 'l', RESIZABLE, NEVER, POOL_FLAG_FLOCK}, - {"frozen", 'f', RESIZABLE, RESIZABLE, POOL_FLAG_FROZEN}, - {"group", 0, ALWAYS, NEVER, 0}, - {"index-capacity", 0, ALWAYS, NEVER, 0}, - {"mode", 0, ALWAYS, NEVER, 0}, - {"owner", 0, ALWAYS, NEVER, 0}, - {"resizable", 0, ALWAYS, NEVER, 0}, - {"single-file", 0, ALWAYS, NEVER, 0}, - {"size", 0, ALWAYS, RESIZABLE, 0}, + {"auto-dispose", 'a', NEVER, RESIZABLE, POOL_FLAG_AUTO_DISPOSE}, + {"checksum", 'c', RESIZABLE, NEVER, POOL_FLAG_CHECKSUM}, + {"flock", 'l', RESIZABLE, NEVER, POOL_FLAG_FLOCK}, + {"frozen", 'f', RESIZABLE, RESIZABLE, POOL_FLAG_FROZEN}, + {"group", 0, ALWAYS, NEVER, 0}, + {"index-capacity", 0, ALWAYS, NEVER, 0}, + {"mode", 0, ALWAYS, NEVER, 0}, + {"owner", 0, ALWAYS, NEVER, 0}, + {"resizable", 0, ALWAYS, NEVER, 0}, + {"single-file", 0, ALWAYS, NEVER, 0}, + {"size", 0, ALWAYS, RESIZABLE, 0}, {"stop-when-full", 's', RESIZABLE, RESIZABLE, POOL_FLAG_STOP_WHEN_FULL}, - {"sync", 'S', RESIZABLE, RESIZABLE, POOL_FLAG_SYNC}, - {"toc-capacity", 0, ALWAYS, NEVER, 0}, + {"sync", 'S', RESIZABLE, RESIZABLE, POOL_FLAG_SYNC}, + {"toc-capacity", 0, ALWAYS, NEVER, 0}, }; #define NUM_OPTIONS (sizeof (pool_opts) / sizeof (pool_opts[0])) @@ -3031,8 +3041,9 @@ static void validate_option (const char *oname, const char *pnam, default: OB_FATAL_BUG_CODE (0x2010404d, "impossible\n"); } - OB_LOG_WARNING_CODE (0x2010404e, "For pool '%s':\n" - "'%s' is %s in %s\n", + OB_LOG_WARNING_CODE (0x2010404e, + "For pool '%s':\n" + "'%s' is %s in %s\n", pnam, oname, why, fname); } @@ -3049,9 +3060,8 @@ static void validate_options (const char *pnam, bslaw map, unt8 mmv, // XXX: passing strcmp for comparison is slightly evil and depends // on the fact that name is the first member of the structure // and is NUL-terminated. - option_info *found = - (option_info *) bsearch (oname, pool_opts, NUM_OPTIONS, sizeof (pool_opts[0]), - (bs_func) strcmp); + option_info *found = (option_info *) bsearch ( + oname, pool_opts, NUM_OPTIONS, sizeof (pool_opts[0]), (bs_func) strcmp); when_supported sup = NEVER; if (found) sup = (create ? found->create : found->change); @@ -3299,8 +3309,9 @@ ob_retort pool_mmap_participate (pool_hose ph) for (i = 0; i < 32; i++) { if (0 != (1 & (flags >> i))) - OB_LOG_ERROR_CODE (0x2010403b, "For pool '%s',\n" - "mmap flag %d is not supported\n", + OB_LOG_ERROR_CODE (0x2010403b, + "For pool '%s',\n" + "mmap flag %d is not supported\n", ph->name, i); } // Well, it's really more like "unsupported feature", but "wrong @@ -3494,22 +3505,17 @@ ob_retort pool_mmap_info (pool_hose ph, int64 hops, protein *return_prot) const unt64 toc_step = pool_toc_step (d->ptoc); const unt64 toc_count = pool_toc_count (d->ptoc); slaw flagslaw = map_from_flags (flags); - slaw ingests = - slaw_map_inline_cf ("type", slaw_string ("mmap"), - "terminal", slaw_boolean (true), - "size", slaw_unt64 (get_file_size (d)), - "size-used", slaw_unt64 (size_used), - "mmap-pool-version", slaw_unt32 (get_mmap_version (d)), - "slaw-version", slaw_unt32 (get_slaw_version (d)), - // for backwards compatibility - "index-capacity", slaw_unt64 (toc_capacity), - "index-step", slaw_unt64 (toc_step), - "index-count", slaw_unt64 (toc_count), - // these new names are preferred - "toc-capacity", slaw_unt64 (toc_capacity), - "toc-step", slaw_unt64 (toc_step), - "toc-count", slaw_unt64 (toc_count), - NULL); + slaw ingests = slaw_map_inline_cf ( + "type", slaw_string ("mmap"), "terminal", slaw_boolean (true), "size", + slaw_unt64 (get_file_size (d)), "size-used", slaw_unt64 (size_used), + "mmap-pool-version", slaw_unt32 (get_mmap_version (d)), "slaw-version", + slaw_unt32 (get_slaw_version (d)), + // for backwards compatibility + "index-capacity", slaw_unt64 (toc_capacity), "index-step", + slaw_unt64 (toc_step), "index-count", slaw_unt64 (toc_count), + // these new names are preferred + "toc-capacity", slaw_unt64 (toc_capacity), "toc-step", + slaw_unt64 (toc_step), "toc-count", slaw_unt64 (toc_count), NULL); if (!ingests || !flagslaw) { slaw_free (ingests); @@ -3562,13 +3568,14 @@ typedef struct static void print_how2 (how_to_resize_it how2) { - OB_LOG_DEBUG_CODE (0x2010403e, "new_oldest_entry = 0x%016" OB_FMT_64 "x\n" - "new_newest_entry = 0x%016" OB_FMT_64 "x\n" - "new_size = 0x%016" OB_FMT_64 "x\n" - "old_size = 0x%016" OB_FMT_64 "x\n" - "memmove_src = 0x%016" OB_FMT_64 "x\n" - "memmove_dst = 0x%016" OB_FMT_64 "x\n" - "memmove_size = 0x%016" OB_FMT_64 "x\n", + OB_LOG_DEBUG_CODE (0x2010403e, + "new_oldest_entry = 0x%016" OB_FMT_64 "x\n" + "new_newest_entry = 0x%016" OB_FMT_64 "x\n" + "new_size = 0x%016" OB_FMT_64 "x\n" + "old_size = 0x%016" OB_FMT_64 "x\n" + "memmove_src = 0x%016" OB_FMT_64 "x\n" + "memmove_dst = 0x%016" OB_FMT_64 "x\n" + "memmove_size = 0x%016" OB_FMT_64 "x\n", how2.new_oldest_entry, how2.new_newest_entry, how2.new_size, how2.old_size, how2.memmove_src, how2.memmove_dst, how2.memmove_size); @@ -3751,19 +3758,20 @@ static how_to_resize_it figure_out_how (pool_mmap_data *d, unt64 new_size, how2.old_size = get_file_size (d); const unt64 seg1_off = seg1_start % how2.old_size; const unt64 seg2_off = seg2_start % how2.old_size; - OB_LOG_DEBUG_CODE (0x20104044, "old_first = 0x%016" OB_FMT_64 "x\n" - "old_last = 0x%016" OB_FMT_64 "x\n" - "size_last = 0x%016" OB_FMT_64 "x\n" - "old_oldest = 0x%016" OB_FMT_64 "x\n" - "old_newest = 0x%016" OB_FMT_64 "x\n" - "size_newest = 0x%016" OB_FMT_64 "x\n" - "seg1_start = 0x%016" OB_FMT_64 "x\n" - "seg1_len = 0x%016" OB_FMT_64 "x\n" - "seg2_start = 0x%016" OB_FMT_64 "x\n" - "seg2_len = 0x%016" OB_FMT_64 "x\n" - "hdr_size = 0x%016" OB_FMT_64 "x\n" - "seg1_off = 0x%016" OB_FMT_64 "x\n" - "seg2_off = 0x%016" OB_FMT_64 "x\n", + OB_LOG_DEBUG_CODE (0x20104044, + "old_first = 0x%016" OB_FMT_64 "x\n" + "old_last = 0x%016" OB_FMT_64 "x\n" + "size_last = 0x%016" OB_FMT_64 "x\n" + "old_oldest = 0x%016" OB_FMT_64 "x\n" + "old_newest = 0x%016" OB_FMT_64 "x\n" + "size_newest = 0x%016" OB_FMT_64 "x\n" + "seg1_start = 0x%016" OB_FMT_64 "x\n" + "seg1_len = 0x%016" OB_FMT_64 "x\n" + "seg2_start = 0x%016" OB_FMT_64 "x\n" + "seg2_len = 0x%016" OB_FMT_64 "x\n" + "hdr_size = 0x%016" OB_FMT_64 "x\n" + "seg1_off = 0x%016" OB_FMT_64 "x\n" + "seg2_off = 0x%016" OB_FMT_64 "x\n", old_first, old_last, size_last, old_oldest, old_newest, size_newest, seg1_start, seg1_len, seg2_start, seg2_len, hdr_size, seg1_off, seg2_off); @@ -3806,9 +3814,10 @@ static how_to_resize_it figure_out_how (pool_mmap_data *d, unt64 new_size, return how2; } const unt64 new_available = new_size - hdr_size; - OB_LOG_DEBUG_CODE (0x20104041, "seg1_len = 0x%016" OB_FMT_64 "x\n" - "new_available = 0x%016" OB_FMT_64 "x\n" - "noseg2 = %s\n", + OB_LOG_DEBUG_CODE (0x20104041, + "seg1_len = 0x%016" OB_FMT_64 "x\n" + "new_available = 0x%016" OB_FMT_64 "x\n" + "noseg2 = %s\n", seg1_len, new_available, noseg2 ? "true" : "false"); if (seg1_len > new_available || noseg2) { @@ -3829,9 +3838,10 @@ static how_to_resize_it figure_out_how (pool_mmap_data *d, unt64 new_size, how2.new_newest_entry = 0; return how2; } - OB_LOG_DEBUG_CODE (0x2010403f, "seg1_src = 0x%016" OB_FMT_64 "x\n" - "new_seg1_off = 0x%016" OB_FMT_64 "x\n" - "new_seg1_len = 0x%016" OB_FMT_64 "x\n", + OB_LOG_DEBUG_CODE (0x2010403f, + "seg1_src = 0x%016" OB_FMT_64 "x\n" + "new_seg1_off = 0x%016" OB_FMT_64 "x\n" + "new_seg1_len = 0x%016" OB_FMT_64 "x\n", seg1_src, new_seg1_off, new_seg1_len); how2.memmove_src = seg1_src; how2.memmove_dst = new_seg1_off; @@ -3856,9 +3866,10 @@ static how_to_resize_it figure_out_how (pool_mmap_data *d, unt64 new_size, return how2; const unt64 seg2_src = seg2_off + seg2_len - new_seg2_len; const unt64 new_seg2_off = new_size - new_seg2_len; - OB_LOG_DEBUG_CODE (0x20104040, "seg2_src = 0x%016" OB_FMT_64 "x\n" - "new_seg2_off = 0x%016" OB_FMT_64 "x\n" - "new_seg2_len = 0x%016" OB_FMT_64 "x\n", + OB_LOG_DEBUG_CODE (0x20104040, + "seg2_src = 0x%016" OB_FMT_64 "x\n" + "new_seg2_off = 0x%016" OB_FMT_64 "x\n" + "new_seg2_len = 0x%016" OB_FMT_64 "x\n", seg2_src, new_seg2_off, new_seg2_len); how2.memmove_src = seg2_src; how2.memmove_dst = new_seg2_off; diff --git a/libPlasma/c/pool_multi.c b/libPlasma/c/pool_multi.c index ece4ab26..4a4e9752 100644 --- a/libPlasma/c/pool_multi.c +++ b/libPlasma/c/pool_multi.c @@ -139,11 +139,10 @@ static ob_retort gang_array_add (gang_array **ptr, pool_gang_member member, if ((*ptr)->nmembers > (*ptr)->capacity) { (*ptr)->capacity *= 2; - gang_array *re = - (gang_array *) realloc (*ptr, sizeof (gang_array) - + sizeof (gang_array_entry) - * ((*ptr)->capacity - - DEFAULT_CAPACITY (*ptr))); + gang_array *re = (gang_array *) realloc ( + *ptr, sizeof (gang_array) + + sizeof (gang_array_entry) + * ((*ptr)->capacity - DEFAULT_CAPACITY (*ptr))); if (!re) { free (*ptr); @@ -497,10 +496,9 @@ static gang_array *array_from_gang (pool_gang gang, do { search = pool_next_gang_member (gang, search); - pret = - gang_array_add (&ga, search, count++ | (is_a_winner (search->ph, winner) - ? 0 - : NON_WINNER_MASK)); + pret = gang_array_add ( + &ga, search, + count++ | (is_a_winner (search->ph, winner) ? 0 : NON_WINNER_MASK)); if (pret < OB_OK) return NULL; } @@ -789,8 +787,9 @@ static ob_retort pool_multi_select (pool_gang gang, pool_timestamp timeout, } // http://msdn.microsoft.com/en-us/library/ms687025(VS.85).aspx - OB_LOG_ERROR_CODE (0x20105015, "unexpected return value for " - "WaitForMultipleObjects = 0x%08x\n", + OB_LOG_ERROR_CODE (0x20105015, + "unexpected return value for " + "WaitForMultipleObjects = 0x%08x\n", wait_res); return POOL_FIFO_BADTH; @@ -911,9 +910,8 @@ ob_retort pool_await_next_multi (pool_gang gang, pool_timestamp timeout, return pret; // Sleep until we are woken by a protein deposit or the timeout. - pret = - pool_multi_select (gang, private_incremental_timeout (timeout, &target), - &winner); + pret = pool_multi_select ( + gang, private_incremental_timeout (timeout, &target), &winner); // Must do this before the pool_unawait_all(), which destroys // the notify handles, which we need to determine the winner. @@ -947,8 +945,9 @@ ob_retort pool_await_next_multi (pool_gang gang, pool_timestamp timeout, pret = pool_next_multi_internal2 (gang, ret_ph, ret_prot, ret_ts, ret_index, ga, pool_opportunistic_next); free (ga); - ob_log (OBLV_DBUG, 0x20105024, "%d: pool_next_multi() returned %s" - " in pool_await_next_multi()\n", + ob_log (OBLV_DBUG, 0x20105024, + "%d: pool_next_multi() returned %s" + " in pool_await_next_multi()\n", getpid (), ob_error_string (pret)); if (pret == OB_OK) @@ -1036,21 +1035,23 @@ ob_retort ob_insert_penultimate_directory (char **pathp, const char *insert) const char *src = path + slashpos; size_t len = 1 + pathlen - slashpos; if (0 != VALGRIND_CHECK_MEM_IS_ADDRESSABLE (dest, len)) - OB_LOG_ERROR_CODE (0x20105030, "dest not addressable in '%s'\n" - "pathlen = %" OB_FMT_SIZE "u\n" - "newlen = %" OB_FMT_SIZE "u\n" - "dest = %" OB_FMT_SIZE "u\n" - "src = %" OB_FMT_SIZE "u\n" - "len = %" OB_FMT_SIZE "u\n", + OB_LOG_ERROR_CODE (0x20105030, + "dest not addressable in '%s'\n" + "pathlen = %" OB_FMT_SIZE "u\n" + "newlen = %" OB_FMT_SIZE "u\n" + "dest = %" OB_FMT_SIZE "u\n" + "src = %" OB_FMT_SIZE "u\n" + "len = %" OB_FMT_SIZE "u\n", path, pathlen, newlen, (size_t) (dest - path), (size_t) (src - path), len); if (0 != VALGRIND_CHECK_MEM_IS_DEFINED (src, len)) - OB_LOG_ERROR_CODE (0x20105031, "src not defined in '%s'\n" - "pathlen = %" OB_FMT_SIZE "u\n" - "newlen = %" OB_FMT_SIZE "u\n" - "dest = %" OB_FMT_SIZE "u\n" - "src = %" OB_FMT_SIZE "u\n" - "len = %" OB_FMT_SIZE "u\n", + OB_LOG_ERROR_CODE (0x20105031, + "src not defined in '%s'\n" + "pathlen = %" OB_FMT_SIZE "u\n" + "newlen = %" OB_FMT_SIZE "u\n" + "dest = %" OB_FMT_SIZE "u\n" + "src = %" OB_FMT_SIZE "u\n" + "len = %" OB_FMT_SIZE "u\n", path, pathlen, newlen, (size_t) (dest - path), (size_t) (src - path), len); memmove (dest, src, len); diff --git a/libPlasma/c/pool_net.c b/libPlasma/c/pool_net.c index ed1a6168..b548d8ed 100644 --- a/libPlasma/c/pool_net.c +++ b/libPlasma/c/pool_net.c @@ -338,7 +338,8 @@ static ob_retort _pool_net_send_op (pool_net_data *net, int op_num, // Log large protein sends if (len > PLASMA_LARGE_TRANSFER_THRESHOLD) { - ob_log (OBLV_INFO, 0x20106002, "Sending large protein: %lld bytes (%.2f MB) for op %d\n", + ob_log (OBLV_INFO, 0x20106002, + "Sending large protein: %lld bytes (%.2f MB) for op %d\n", (long long) len, len / (1024.0 * 1024.0), op_num); } #endif @@ -379,7 +380,8 @@ ob_retort pool_net_recv_op (pool_net_data *net, int *op_num, protein *ret_prot) // Log large protein receives if (len > PLASMA_LARGE_TRANSFER_THRESHOLD) { - ob_log (OBLV_INFO, 0x20106003, "Receiving large protein: %llu bytes (%.2f MB)\n", + ob_log (OBLV_INFO, 0x20106003, + "Receiving large protein: %llu bytes (%.2f MB)\n", (unsigned long long) len, len / (1024.0 * 1024.0)); } #endif @@ -968,9 +970,8 @@ static ob_retort pool_net_next_internal (pool_hose ph, protein *ret_prot, } case OB_FANCY_PREPARING: assert (fancy); - pret = - pool_net_recv_unusual_result (ph->net, POOL_CMD_FANCY_RESULT_1, - "rti", &remote_pret, &ts, &idx); + pret = pool_net_recv_unusual_result ( + ph->net, POOL_CMD_FANCY_RESULT_1, "rti", &remote_pret, &ts, &idx); if (pret < OB_OK) continue; if (outstanding_compatible (&ph->net->outstanding, squished, @@ -1006,11 +1007,9 @@ static ob_retort pool_net_next_internal (pool_hose ph, protein *ret_prot, return pret; else if (gotit) { - pret = - pool_net_recv_unusual_result (ph->net, - POOL_CMD_FANCY_RESULT_2, - "rti", &remote_pret, &ts, - &idx); + pret = pool_net_recv_unusual_result ( + ph->net, POOL_CMD_FANCY_RESULT_2, "rti", &remote_pret, + &ts, &idx); if (pret < OB_OK) continue; if (remote_pret == OB_OK) @@ -1048,9 +1047,8 @@ static ob_retort pool_net_next_internal (pool_hose ph, protein *ret_prot, continue; } remote_pret = OB_OK; - pret = - pool_net_recv_unusual_result (ph->net, POOL_CMD_FANCY_RESULT_3, - "tip", &ts, &idx, ret_prot); + pret = pool_net_recv_unusual_result ( + ph->net, POOL_CMD_FANCY_RESULT_3, "tip", &ts, &idx, ret_prot); set_outstanding (&ph->net->outstanding, OB_NO_AWAIT, 0, NULL); break; default: @@ -1459,9 +1457,8 @@ static ob_retort pool_net_multi_add_awaiter_internal (pool_hose ph, continue; case OB_FANCY_PREPARING: assert (fancy); - pret = - pool_net_recv_unusual_result (ph->net, POOL_CMD_FANCY_RESULT_1, - "rti", &remote_pret, &ts, &idx); + pret = pool_net_recv_unusual_result ( + ph->net, POOL_CMD_FANCY_RESULT_1, "rti", &remote_pret, &ts, &idx); if (pret < OB_OK) continue; if (outstanding_compatible (&ph->net->outstanding, squished, @@ -1499,9 +1496,8 @@ static ob_retort pool_net_multi_add_awaiter_internal (pool_hose ph, } if (ret_prot == NULL && ret_index == NULL && ret_ts == NULL) return OB_OK; // leave as "arrived" if no info is needed - pret = - pool_net_recv_unusual_result (ph->net, POOL_CMD_FANCY_RESULT_3, - "tip", &ts, &idx, ret_prot); + pret = pool_net_recv_unusual_result ( + ph->net, POOL_CMD_FANCY_RESULT_3, "tip", &ts, &idx, ret_prot); set_outstanding (&ph->net->outstanding, OB_NO_AWAIT, 0, NULL); if (pret >= OB_OK) { @@ -1555,11 +1551,11 @@ static ob_retort pool_net_multi_add_awaiter_internal (pool_hose ph, void pool_net_multi_remove_awaiter (OB_UNUSED pool_hose ph) { -// Dummy awaiter removal, needed for the multi-pool code. At present, -// we never tear down await state explicitly - it always happens as a -// by-product of sending the next command. This keeps us from having -// to set up and tear down awaits for multi-pool awaits on every -// single call. + // Dummy awaiter removal, needed for the multi-pool code. At present, + // we never tear down await state explicitly - it always happens as a + // by-product of sending the next command. This keeps us from having + // to set up and tear down awaits for multi-pool awaits on every + // single call. #ifdef _MSC_VER //actually we do need this awaiter removal method! @@ -1575,12 +1571,10 @@ void pool_net_multi_remove_awaiter (OB_UNUSED pool_hose ph) static slaw convert_fetch_op_to_slaw (pool_fetch_op ops) { - return slaw_map_inline_cf ("idx", slaw_int64 (ops.idx), - "des", slaw_boolean (ops.want_descrips), - "ing", slaw_boolean (ops.want_ingests), - "roff", slaw_int64 (ops.rude_offset), - "rbytes", slaw_int64 (ops.rude_length), - NULL); + return slaw_map_inline_cf ( + "idx", slaw_int64 (ops.idx), "des", slaw_boolean (ops.want_descrips), "ing", + slaw_boolean (ops.want_ingests), "roff", slaw_int64 (ops.rude_offset), + "rbytes", slaw_int64 (ops.rude_length), NULL); } static slaw convert_fetch_ops_to_slaw (const pool_fetch_op *ops, int64 nops) @@ -1626,9 +1620,8 @@ static ob_retort convert_slaw_to_fetch_ops (bslaw s, pool_fetch_op *ops, bslaw el = NULL; ob_retort tort = OB_OK; for (i = 0; i < nops; i++) - ob_err_accum (&tort, - convert_slaw_to_fetch_op (el = slaw_list_emit_next (s, el), - &(ops[i]), clamp)); + ob_err_accum (&tort, convert_slaw_to_fetch_op ( + el = slaw_list_emit_next (s, el), &(ops[i]), clamp)); return tort; } diff --git a/libPlasma/c/pool_options.c b/libPlasma/c/pool_options.c index 3cd71b51..dafbe587 100644 --- a/libPlasma/c/pool_options.c +++ b/libPlasma/c/pool_options.c @@ -22,12 +22,11 @@ protein mmap_pool_options (unt64 size) protein toc_mmap_pool_options (unt64 size, unt64 cap) { slaw m = - slaw_map_inline_cf (FILE_SIZE_OPTION_NAME, slaw_unt64 (size), + slaw_map_inline_cf (FILE_SIZE_OPTION_NAME, slaw_unt64 (size), // for backwards compatibility INDEX_CAPACITY_OPTION_NAME, slaw_unt64 (cap), // the new name is preferred - TOC_CAPACITY_OPTION_NAME, slaw_unt64 (cap), - NULL); + TOC_CAPACITY_OPTION_NAME, slaw_unt64 (cap), NULL); return m ? protein_from_ff (NULL, m) : NULL; } diff --git a/libPlasma/c/pool_tcp.c b/libPlasma/c/pool_tcp.c index 45951b24..7434fac4 100644 --- a/libPlasma/c/pool_tcp.c +++ b/libPlasma/c/pool_tcp.c @@ -53,79 +53,86 @@ static void get_socket_info (ob_sock_t sock, char *buf, size_t buflen) { #ifndef _MSC_VER struct sockaddr_storage local_addr, peer_addr; - socklen_t addrlen = sizeof(local_addr); - + socklen_t addrlen = sizeof (local_addr); + buf[0] = '\0'; - + // Get local address - if (getsockname(sock, (struct sockaddr *)&local_addr, &addrlen) == 0) + if (getsockname (sock, (struct sockaddr *) &local_addr, &addrlen) == 0) { char local_str[INET6_ADDRSTRLEN + 16]; // IP + port char peer_str[INET6_ADDRSTRLEN + 16]; - + // Format local address if (local_addr.ss_family == AF_INET) { - struct sockaddr_in *addr4 = (struct sockaddr_in *)&local_addr; + struct sockaddr_in *addr4 = (struct sockaddr_in *) &local_addr; char ip[INET_ADDRSTRLEN]; - inet_ntop(AF_INET, &addr4->sin_addr, ip, sizeof(ip)); - snprintf(local_str, sizeof(local_str), "%s:%d", ip, ntohs(addr4->sin_port)); + inet_ntop (AF_INET, &addr4->sin_addr, ip, sizeof (ip)); + snprintf (local_str, sizeof (local_str), "%s:%d", ip, + ntohs (addr4->sin_port)); } else if (local_addr.ss_family == AF_INET6) { - struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&local_addr; + struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *) &local_addr; char ip[INET6_ADDRSTRLEN]; - inet_ntop(AF_INET6, &addr6->sin6_addr, ip, sizeof(ip)); - snprintf(local_str, sizeof(local_str), "[%s]:%d", ip, ntohs(addr6->sin6_port)); + inet_ntop (AF_INET6, &addr6->sin6_addr, ip, sizeof (ip)); + snprintf (local_str, sizeof (local_str), "[%s]:%d", ip, + ntohs (addr6->sin6_port)); } else { - snprintf(local_str, sizeof(local_str), "", local_addr.ss_family); + snprintf (local_str, sizeof (local_str), "", + local_addr.ss_family); } - + // Get peer address - addrlen = sizeof(peer_addr); - if (getpeername(sock, (struct sockaddr *)&peer_addr, &addrlen) == 0) + addrlen = sizeof (peer_addr); + if (getpeername (sock, (struct sockaddr *) &peer_addr, &addrlen) == 0) { // Format peer address if (peer_addr.ss_family == AF_INET) { - struct sockaddr_in *addr4 = (struct sockaddr_in *)&peer_addr; + struct sockaddr_in *addr4 = (struct sockaddr_in *) &peer_addr; char ip[INET_ADDRSTRLEN]; - inet_ntop(AF_INET, &addr4->sin_addr, ip, sizeof(ip)); - snprintf(peer_str, sizeof(peer_str), "%s:%d", ip, ntohs(addr4->sin_port)); + inet_ntop (AF_INET, &addr4->sin_addr, ip, sizeof (ip)); + snprintf (peer_str, sizeof (peer_str), "%s:%d", ip, + ntohs (addr4->sin_port)); } else if (peer_addr.ss_family == AF_INET6) { - struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&peer_addr; + struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *) &peer_addr; char ip[INET6_ADDRSTRLEN]; - inet_ntop(AF_INET6, &addr6->sin6_addr, ip, sizeof(ip)); - snprintf(peer_str, sizeof(peer_str), "[%s]:%d", ip, ntohs(addr6->sin6_port)); + inet_ntop (AF_INET6, &addr6->sin6_addr, ip, sizeof (ip)); + snprintf (peer_str, sizeof (peer_str), "[%s]:%d", ip, + ntohs (addr6->sin6_port)); } else { - snprintf(peer_str, sizeof(peer_str), "", peer_addr.ss_family); + snprintf (peer_str, sizeof (peer_str), "", + peer_addr.ss_family); } - - snprintf(buf, buflen, " (fd %d: %s -> %s)", - sock, local_str, peer_str); + + snprintf (buf, buflen, " (fd %d: %s -> %s)", sock, local_str, + peer_str); } else { // getpeername failed, socket might be disconnected int err = errno; - snprintf(buf, buflen, " (fd %d: %s -> )", - sock, local_str, strerror(err)); + snprintf (buf, buflen, " (fd %d: %s -> )", sock, + local_str, strerror (err)); } } else { // getsockname failed int err = errno; - snprintf(buf, buflen, " (fd %d: )", sock, strerror(err)); + snprintf (buf, buflen, " (fd %d: )", sock, + strerror (err)); } #else - snprintf(buf, buflen, " (fd %d)", sock); + snprintf (buf, buflen, " (fd %d)", sock); #endif } @@ -200,21 +207,23 @@ ob_retort pool_tcp_send_nbytes (ob_sock_t sock, const void *buf, size_t len, if (nwritten == -1 && erryes == EPIPE) { close_warning_count++; - float64 now = ob_current_time(); - + float64 now = ob_current_time (); + if (now - last_close_warning_time > WARNING_THROTTLE_SECS) { char sock_info[256]; - get_socket_info(sock, sock_info, sizeof(sock_info)); + get_socket_info (sock, sock_info, sizeof (sock_info)); unt64 count = close_warning_count; close_warning_count = 0; - + if (count > 1) { - OB_LOG_WARNING_CODE (0x20108027, - "socket was closed unexpectedly %s (occurred %llu times in last %.0f seconds)", - sock_info, (unsigned long long)count, - WARNING_THROTTLE_SECS); + OB_LOG_WARNING_CODE ( + 0x20108027, + "socket was closed unexpectedly %s (occurred %llu " + "times in last %.0f seconds)", + sock_info, (unsigned long long) count, + WARNING_THROTTLE_SECS); } else { @@ -229,12 +238,12 @@ ob_retort pool_tcp_send_nbytes (ob_sock_t sock, const void *buf, size_t len, else { char sock_info[256]; - get_socket_info(sock, sock_info, sizeof(sock_info)); - OB_LOG_WARNING_CODE (0x20108000, - "send() returned %" OB_FMT_SIZE "d with " - "errno '%s' with %" OB_FMT_SIZE - "d bytes left %s\n", - nwritten, strerror (erryes), nleft, sock_info); + get_socket_info (sock, sock_info, sizeof (sock_info)); + OB_LOG_WARNING_CODE ( + 0x20108000, + "send() returned %" OB_FMT_SIZE "d with " + "errno '%s' with %" OB_FMT_SIZE "d bytes left %s\n", + nwritten, strerror (erryes), nleft, sock_info); pret = POOL_SEND_BADTH; } errno = erryes; @@ -313,21 +322,23 @@ ob_retort pool_tcp_recv_nbytes (ob_sock_t sock, void *buf, size_t len, if (nread == 0) { close_warning_count++; - float64 now = ob_current_time(); - + float64 now = ob_current_time (); + if (now - last_close_warning_time > WARNING_THROTTLE_SECS) { char sock_info[256]; - get_socket_info(sock, sock_info, sizeof(sock_info)); + get_socket_info (sock, sock_info, sizeof (sock_info)); unt64 count = close_warning_count; close_warning_count = 0; - + if (count > 1) { - OB_LOG_WARNING_CODE (0x20108028, - "socket was closed unexpectedly %s (occurred %llu times in last %.0f seconds)", - sock_info, (unsigned long long)count, - WARNING_THROTTLE_SECS); + OB_LOG_WARNING_CODE ( + 0x20108028, + "socket was closed unexpectedly %s (occurred %llu " + "times in last %.0f seconds)", + sock_info, (unsigned long long) count, + WARNING_THROTTLE_SECS); } else { @@ -342,7 +353,7 @@ ob_retort pool_tcp_recv_nbytes (ob_sock_t sock, void *buf, size_t len, else { char sock_info[256]; - get_socket_info(sock, sock_info, sizeof(sock_info)); + get_socket_info (sock, sock_info, sizeof (sock_info)); OB_LOG_WARNING_CODE (0x20108001, "recv() returned %" OB_FMT_SIZE "d with " "errno '%s' with %" OB_FMT_SIZE @@ -389,7 +400,8 @@ static ob_retort pool_tcp_close (unt64 code, pool_net_data *net) } -typedef enum { +typedef enum +{ Ob_Insecure, /* don't use TLS */ Ob_Opportunistic, /* use TLS if available; allow anonymous */ Ob_Secure /* require TLS with certificate */ @@ -478,10 +490,11 @@ static ob_retort parse_pseudo_uri (const char *full_pool_name, } else { - unknown_proto: +unknown_proto: *hostname = 0; /* NUL-terminate protocol in "uri" for printing */ - OB_LOG_ERROR_CODE (0x20108026, "Didn't expect '%s' as a protocol\n" - "in '%s'\n", + OB_LOG_ERROR_CODE (0x20108026, + "Didn't expect '%s' as a protocol\n" + "in '%s'\n", uri, full_pool_name); free (uri); return POOL_POOLNAME_BADTH; @@ -711,14 +724,16 @@ static ob_retort negotiate_version (pool_net_data *net, else if (net->net_version > POOL_TCP_VERSION_CURRENT) { if (net->net_version == 'H' && net->slaw_version == 'T') - OB_LOG_ERROR_CODE (0x20108021, "%s:%s\n" - "looks like it might be an http\n" - "server, not a pool server!\n", + OB_LOG_ERROR_CODE (0x20108021, + "%s:%s\n" + "looks like it might be an http\n" + "server, not a pool server!\n", hostname, port_str); else - OB_LOG_ERROR_CODE (0x20108020, "%s:%s\n" - "server claims protocol %d/slaw %d,\n" - "but we only know protocol %d/slaw %d\n", + OB_LOG_ERROR_CODE (0x20108020, + "%s:%s\n" + "server claims protocol %d/slaw %d,\n" + "but we only know protocol %d/slaw %d\n", hostname, port_str, net->net_version, net->slaw_version, POOL_TCP_VERSION_CURRENT, SLAW_VERSION_CURRENT); @@ -833,39 +848,43 @@ ob_retort ob_common_sockopts (ob_sock_t fd) sizeof (bufsize)) != 0) { - OB_LOG_WARNING_CODE (0x20108026, "setsockopt/SO_RCVBUF: '%s' (continuing anyway)\n", + OB_LOG_WARNING_CODE (0x20108026, + "setsockopt/SO_RCVBUF: '%s' (continuing anyway)\n", ob_sockmsg ()); } - + if (setsockopt (fd, SOL_SOCKET, SO_SNDBUF, EVIL_SOCKOPT_CAST (&bufsize), sizeof (bufsize)) != 0) { - OB_LOG_WARNING_CODE (0x20108027, "setsockopt/SO_SNDBUF: '%s' (continuing anyway)\n", + OB_LOG_WARNING_CODE (0x20108027, + "setsockopt/SO_SNDBUF: '%s' (continuing anyway)\n", ob_sockmsg ()); } #ifdef HAVE_TCP_USER_TIMEOUT // Set TCP timeout for large transfers int timeout_ms = PLASMA_TCP_TIMEOUT_MS; - if (setsockopt (fd, IPPROTO_TCP, TCP_USER_TIMEOUT, EVIL_SOCKOPT_CAST (&timeout_ms), - sizeof (timeout_ms)) + if (setsockopt (fd, IPPROTO_TCP, TCP_USER_TIMEOUT, + EVIL_SOCKOPT_CAST (&timeout_ms), sizeof (timeout_ms)) != 0) { - OB_LOG_WARNING_CODE (0x20108028, "setsockopt/TCP_USER_TIMEOUT: '%s' (continuing anyway)\n", - ob_sockmsg ()); + OB_LOG_WARNING_CODE ( + 0x20108028, "setsockopt/TCP_USER_TIMEOUT: '%s' (continuing anyway)\n", + ob_sockmsg ()); } #endif #ifdef HAVE_TCP_KEEPINTVL // Reduce keepalive interval to 30 seconds int keepintvl = 30; - if (setsockopt (fd, IPPROTO_TCP, TCP_KEEPINTVL, EVIL_SOCKOPT_CAST (&keepintvl), - sizeof (keepintvl)) + if (setsockopt (fd, IPPROTO_TCP, TCP_KEEPINTVL, + EVIL_SOCKOPT_CAST (&keepintvl), sizeof (keepintvl)) != 0) { - OB_LOG_WARNING_CODE (0x20108029, "setsockopt/TCP_KEEPINTVL: '%s' (continuing anyway)\n", - ob_sockmsg ()); + OB_LOG_WARNING_CODE ( + 0x20108029, "setsockopt/TCP_KEEPINTVL: '%s' (continuing anyway)\n", + ob_sockmsg ()); } #endif @@ -876,12 +895,13 @@ ob_retort ob_common_sockopts (ob_sock_t fd) sizeof (keepidle)) != 0) { - OB_LOG_WARNING_CODE (0x2010802a, "setsockopt/TCP_KEEPIDLE: '%s' (continuing anyway)\n", - ob_sockmsg ()); + OB_LOG_WARNING_CODE ( + 0x2010802a, "setsockopt/TCP_KEEPIDLE: '%s' (continuing anyway)\n", + ob_sockmsg ()); } #endif -#endif // !_MSC_VER -#endif // PLASMA_ENABLE_TCP_OPTIMIZATIONS +#endif // !_MSC_VER +#endif // PLASMA_ENABLE_TCP_OPTIMIZATIONS return ob_nosigpipe_sockopt (fd); } @@ -926,8 +946,9 @@ static ob_retort my_connect1 (const struct addrinfo *ai, ob_sock_t *fd_out) { ob_retort ort = ob_close_socket (fd); if (ort < OB_OK) - OB_LOG_ERROR_CODE (0x20108007, "ob_close_socket on fail path " - "for ob_common_socketopts:\n%s\n", + OB_LOG_ERROR_CODE (0x20108007, + "ob_close_socket on fail path " + "for ob_common_socketopts:\n%s\n", ob_error_string (ort)); return tort; } @@ -941,8 +962,9 @@ static ob_retort my_connect1 (const struct addrinfo *ai, ob_sock_t *fd_out) ob_error_string (conntort), ai->ai_family); ob_retort ort = ob_close_socket (fd); if (ort < OB_OK) - OB_LOG_ERROR_CODE (0x20108009, "ob_close_socket on fail path " - "for connect:\n%s\n", + OB_LOG_ERROR_CODE (0x20108009, + "ob_close_socket on fail path " + "for connect:\n%s\n", ob_error_string (ort)); return POOL_SERVER_UNREACH; } @@ -1524,7 +1546,7 @@ static ob_retort pool_tcp_rename (pool_hose ph, const char *old_name, if (!d || !dn) { pret = OB_NO_MEM; - early_exit: +early_exit: free_parsed_pseudo_uri (d); free_parsed_pseudo_uri (dn); return pret; @@ -1544,8 +1566,9 @@ static ob_retort pool_tcp_rename (pool_hose ph, const char *old_name, pret = pool_tcp_make_connection (old_name, &net, &invalid_wait_obj, d, ph->ctx); - if (pret == OB_OK && (0 != strcmp (d->hostname, dn->hostname) - || 0 != strcmp (d->port_str, dn->port_str))) + if (pret == OB_OK + && (0 != strcmp (d->hostname, dn->hostname) + || 0 != strcmp (d->port_str, dn->port_str))) { OB_LOG_ERROR_CODE (0x2010801a, "Can't rename from %s:%s to %s:%s\n", d->hostname, d->port_str, dn->hostname, dn->port_str); @@ -1643,14 +1666,11 @@ static ob_retort pool_tcp_info (pool_hose ph, int64 hops, protein *return_prot) { parsed_pseudo_uri *d = get_parsed_pseudo_uri (ph); int32 port = atoi (d->port_str); - slaw ingests = - slaw_map_inline_cf ("type", slaw_string ("tcp"), - "terminal", slaw_boolean (false), - "host", slaw_string (d->hostname), - "port", slaw_int32 (port), - "net-pool-version", slaw_unt32 (ph->net->net_version), - "slaw-version", slaw_unt32 (ph->net->slaw_version), - NULL); + slaw ingests = slaw_map_inline_cf ( + "type", slaw_string ("tcp"), "terminal", slaw_boolean (false), "host", + slaw_string (d->hostname), "port", slaw_int32 (port), + "net-pool-version", slaw_unt32 (ph->net->net_version), "slaw-version", + slaw_unt32 (ph->net->slaw_version), NULL); if (!ingests) return OB_NO_MEM; *return_prot = protein_from_ff (NULL, ingests); diff --git a/libPlasma/c/pool_tcp_server.c b/libPlasma/c/pool_tcp_server.c index d72db60a..70c433a2 100644 --- a/libPlasma/c/pool_tcp_server.c +++ b/libPlasma/c/pool_tcp_server.c @@ -119,9 +119,8 @@ static slaw list_children (void) int64 i; for (i = 0; children_alive && i < slabu_count (children_alive); i++) slabu_list_add_x (sb, slaw_string_format ("%" OB_FMT_64 "d", - *slaw_int64_emit ( - slabu_list_nth (children_alive, - i)))); + *slaw_int64_emit (slabu_list_nth ( + children_alive, i)))); return slaw_strings_join_slabu_f (sb, ","); } @@ -177,11 +176,9 @@ static void initialize_logging (void) pname, ob_error_string (tort)); return; } - tort = - ob_log_to_pool (ph, true, OBLV_BUG, OBLV_ERROR, OBLV_DEPRECATION, - OBLV_WRNU, OBLV_INFO, - ob_log_is_level_enabled (OBLV_DBUG) ? OBLV_DBUG : NULL, - NULL); + tort = ob_log_to_pool ( + ph, true, OBLV_BUG, OBLV_ERROR, OBLV_DEPRECATION, OBLV_WRNU, OBLV_INFO, + ob_log_is_level_enabled (OBLV_DBUG) ? OBLV_DBUG : NULL, NULL); if (tort < OB_OK) OB_LOG_ERROR_CODE (0x2010903f, "Can't log to '%s' because '%s'\n", pname, ob_error_string (tort)); @@ -193,8 +190,9 @@ static void reap_children (void); static void print_pid (int pid) { - OB_LOG_DEBUG_CODE (0x2010902c, "pid = %d, port = %d\n" - "pools dir = '%s'\n", + OB_LOG_DEBUG_CODE (0x2010902c, + "pid = %d, port = %d\n" + "pools dir = '%s'\n", pid, actual_port, ob_get_standard_path (ob_pools_dir)); if (!pidfile) @@ -290,8 +288,9 @@ static ob_retort welcome_new_version (pool_net_data *net, if (advertise_starttls) cmds |= (OB_CONST_U64 (1) << POOL_CMD_STARTTLS); - OB_LOG_DEBUG_CODE (0x2010902f, "net version = %d, slaw version = %d, cmd " - "mask = 0x%" OB_FMT_64 "x\n", + OB_LOG_DEBUG_CODE (0x2010902f, + "net version = %d, slaw version = %d, cmd " + "mask = 0x%" OB_FMT_64 "x\n", net->net_version, net->slaw_version, cmds); byte welcome[12]; @@ -388,17 +387,13 @@ static void convert_slaw_to_fetch_ops (bslaw s, pool_fetch_op *ops, int64 nops) static slaw convert_fetch_op_to_slaw (pool_fetch_op ops) { // XXX: make some of these conditional as described in pool-tcp-protocol.txt? - return slaw_map_inline_cf ("idx", slaw_int64 (ops.idx), - "retort", slaw_int64 (ops.tort), - "time", slaw_float64 (ops.ts), - "tbytes", slaw_int64 (ops.total_bytes), - "dbytes", slaw_int64 (ops.descrip_bytes), - "ibytes", slaw_int64 (ops.ingest_bytes), - "rbytes", slaw_int64 (ops.rude_bytes), - "ndes", slaw_int64 (ops.num_descrips), - "ning", slaw_int64 (ops.num_ingests), - "prot", ops.p, - NULL); + return slaw_map_inline_cf ( + "idx", slaw_int64 (ops.idx), "retort", slaw_int64 (ops.tort), "time", + slaw_float64 (ops.ts), "tbytes", slaw_int64 (ops.total_bytes), "dbytes", + slaw_int64 (ops.descrip_bytes), "ibytes", slaw_int64 (ops.ingest_bytes), + "rbytes", slaw_int64 (ops.rude_bytes), "ndes", + slaw_int64 (ops.num_descrips), "ning", slaw_int64 (ops.num_ingests), "prot", + ops.p, NULL); } static slaw convert_fetch_ops_to_slaw (const pool_fetch_op *ops, int64 nops) @@ -554,9 +549,8 @@ static void tend_pool_hose (pool_net_data *net, const char *remote_host) OB_DIE_ON_ERROR ( ob_socketpair_cloexec (OB_SP_DOMAIN, SOCK_STREAM, 0, pair)); OB_DIE_ON_ERROR (ob_nosigpipe_sockopt_x2 (pair)); - OB_DIE_ON_ERROR ( - ob_tls_server_launch_thread (pair[0], net->connfd, &net->tls_thread, - !require_tls, client_auth)); + OB_DIE_ON_ERROR (ob_tls_server_launch_thread ( + pair[0], net->connfd, &net->tls_thread, !require_tls, client_auth)); net->connfd = pair[1]; send_pret = welcome_new_version_tls (net); const int e = errno; @@ -587,9 +581,8 @@ static void tend_pool_hose (pool_net_data *net, const char *remote_host) net->net_version = rude_ptr[0]; net->slaw_version = rude_ptr[1]; protein_free (op_protein); - send_pret = - welcome_new_version (net, (allow_tls && (tls_available >= OB_OK)), - !require_tls); + send_pret = welcome_new_version ( + net, (allow_tls && (tls_available >= OB_OK)), !require_tls); int e = errno; if (send_pret != OB_OK) SUPREME_BADNESS ("negotiating protocol version", send_pret, e); @@ -772,8 +765,8 @@ static void tend_pool_hose (pool_net_data *net, const char *remote_host) } else { - // No other commands are valid. - bad_start: +// No other commands are valid. +bad_start: OB_LOG_ERROR_CODE (0x20109029, "bad starting op %d\n", op_num); protein_free (op_protein); return; @@ -1030,16 +1023,18 @@ static void tend_pool_hose (pool_net_data *net, const char *remote_host) &ret_index); send_pret = pool_net_send_op (net, POOL_CMD_FANCY_RESULT_1, "rti", pret, ret_ts, ret_index); - OB_LOG_DEBUG_CODE (0x20109041, "POOL_CMD_FANCY_RESULT_1 (%s, " - "%f, %" OB_FMT_64 "d)\n", + OB_LOG_DEBUG_CODE (0x20109041, + "POOL_CMD_FANCY_RESULT_1 (%s, " + "%f, %" OB_FMT_64 "d)\n", ob_error_string (pret), ret_ts, ret_index); if (pret >= OB_OK && send_pret >= OB_OK) { send_pret = pool_net_send_op (net, POOL_CMD_FANCY_RESULT_3, "tip", ret_ts, ret_index, ret_prot); - OB_LOG_DEBUG_CODE (0x20109042, "POOL_CMD_FANCY_RESULT_3 " - "(%f, %" OB_FMT_64 "d)\n", + OB_LOG_DEBUG_CODE (0x20109042, + "POOL_CMD_FANCY_RESULT_3 " + "(%f, %" OB_FMT_64 "d)\n", ret_ts, ret_index); protein_free (ret_prot); } @@ -1049,17 +1044,15 @@ static void tend_pool_hose (pool_net_data *net, const char *remote_host) int64 thingy; func = (unconditional ? always_return_0 : protein_search); pool_seekto (ph, (thingy = (idx > newest ? idx : newest))); - OB_LOG_DEBUG_CODE (0x20109045, - "set index to %" OB_FMT_64 "d\n", - thingy); + OB_LOG_DEBUG_CODE ( + 0x20109045, "set index to %" OB_FMT_64 "d\n", thingy); do { protein_free (ret_prot); OB_LOG_DEBUG_CODE (0x2010903b, "starting await\n"); - pret = - pool_net_server_await (ph, net, POOL_WAIT_FOREVER, - &ret_prot, &ret_ts, - &ret_index); + pret = pool_net_server_await ( + ph, net, POOL_WAIT_FOREVER, &ret_prot, &ret_ts, + &ret_index); OB_LOG_DEBUG_CODE (0x2010903c, "finished await\n"); } while (pret == OB_OK && func (ret_prot, search) < 0); @@ -1335,9 +1328,8 @@ static void wait_for_connection (int listenfd) } //spawn a new thread to handle the connection - HANDLE new_handle = - (HANDLE) _beginthreadex (NULL, 0, connection_thread_entry, - (void *) connfd, 0, NULL); + HANDLE new_handle = (HANDLE) _beginthreadex ( + NULL, 0, connection_thread_entry, (void *) connfd, 0, NULL); if (new_handle != 0) { //thread creation was successful @@ -1810,8 +1802,9 @@ static int parse_port (const char *port_str) if (*port_str == 0) OB_LOG_DEBUG_CODE (0x20109057, "port was empty string\n"); else if (*endptr != 0) - OB_LOG_DEBUG_CODE (0x20109058, "invalid characters '%s' provided " - "after port number\n", + OB_LOG_DEBUG_CODE (0x20109058, + "invalid characters '%s' provided " + "after port number\n", endptr); else if (errno != 0) OB_LOG_DEBUG_CODE (0x20109059, "invalid port: strtol results in '%s'\n", @@ -1856,8 +1849,7 @@ static void print_usage (FILE *fp) fprintf (fp, " (but still exit with code %d)\n", EXIT_IN_USE); fprintf (fp, " -p specify port to listen on (default %u)\n", POOL_TCP_PORT); - fprintf (fp, - " -P choose an unused port automatically, and print\n"); + fprintf (fp, " -P choose an unused port automatically, and print\n"); fprintf (fp, " the port and PID to the specified file\n"); fprintf (fp, " -s number of seconds to wait (on exit) for child\n"); fprintf (fp, " processes to die before killing them\n"); @@ -1879,20 +1871,18 @@ static void print_usage (FILE *fp) if (have_tls) { fprintf (fp, " -S only allow secure connections (using TLS)\n"); - fprintf (fp, - " -I only allow insecure connections (forbid TLS)\n"); + fprintf (fp, " -I only allow insecure connections (forbid TLS)\n"); fprintf (fp, " (default is to allow both secure and " - "insecure connections)\n"); - fprintf (fp, - " -C require client authentication (implies -S)\n"); + "insecure connections)\n"); + fprintf (fp, " -C require client authentication (implies -S)\n"); fprintf (fp, "\n%s%s%s\n", secure_msg1, ob_get_standard_path (ob_etc_path), secure_msg2); fprintf (fp, "Clients will look for the file " - "'certificate-authorities.pem', to\n"); + "'certificate-authorities.pem', to\n"); fprintf (fp, "authenticate the server's certificate.\n"); fprintf (fp, "\n"); fprintf (fp, "If -C is specified, then the client also needs " - "'client-certificate-chain.pem'\n"); + "'client-certificate-chain.pem'\n"); fprintf (fp, "and 'client-private-key.pem', and the server needs\n"); fprintf (fp, "'certificate-authorities.pem'.\n"); } @@ -1900,9 +1890,9 @@ static void print_usage (FILE *fp) { fprintf (fp, " -I only allow insecure connections\n"); fprintf (fp, " (already the default, and thus is a nop in " - "this build)\n"); + "this build)\n"); fprintf (fp, " no TLS support in this build (-S and -C not " - "supported)\n"); + "supported)\n"); } fprintf (fp, "\n"); fprintf (fp, "exit codes:\n"); @@ -2004,8 +1994,9 @@ int main (int argc, char *argv[]) if (argc != optind) { - fprintf (stderr, "pool_tcp_server does not accept non-option arguments.\n" - "Non-option argument \"%s\" was provided.\n", + fprintf (stderr, + "pool_tcp_server does not accept non-option arguments.\n" + "Non-option argument \"%s\" was provided.\n", argv[optind]); usage (); } @@ -2028,10 +2019,11 @@ int main (int argc, char *argv[]) "Cannot operate in secure mode because: %s\n", ob_error_string (tls_available)); else - OB_LOG_WARNING_CODE (0x20109063, "Secure connections are not " - "available because: %s\n" - "So only insecure connections " - "will be allowed.\n", + OB_LOG_WARNING_CODE (0x20109063, + "Secure connections are not " + "available because: %s\n" + "So only insecure connections " + "will be allowed.\n", ob_error_string (tls_available)); } else if (tls_available == POOL_ANONYMOUS_ONLY) @@ -2042,11 +2034,9 @@ int main (int argc, char *argv[]) "locations checked.)\n"; if (require_tls) - OB_FATAL_ERROR_CODE (0x20109064, - "%sCannot operate securely.\n\n%s%s%s", - secure_msg0, secure_msg1, - ob_get_standard_path (ob_etc_path), - secure_msg2); + OB_FATAL_ERROR_CODE ( + 0x20109064, "%sCannot operate securely.\n\n%s%s%s", secure_msg0, + secure_msg1, ob_get_standard_path (ob_etc_path), secure_msg2); else OB_LOG_WARNING_CODE (0x20109065, "%sTherefore, only anonymous ciphersuites\n" diff --git a/libPlasma/c/protein.c b/libPlasma/c/protein.c index 9be46fcf..bc18d401 100644 --- a/libPlasma/c/protein.c +++ b/libPlasma/c/protein.c @@ -45,9 +45,9 @@ ob_retort protein_fix_endian (protein p) else /* not a protein-- this is bad */ { // this pops up in bug 882. - OB_LOG_WARNING_CODE (0x20006000, "header oct %016" OB_FMT_64 - "X does not represent a protein\n", - p->o); + OB_LOG_WARNING_CODE ( + 0x20006000, + "header oct %016" OB_FMT_64 "X does not represent a protein\n", p->o); return SLAW_CORRUPT_PROTEIN; } } @@ -270,7 +270,7 @@ const void *protein_rude (bprotein prot, int64 *len) if ((end - prot) * 8 < *len) { - bad: +bad: *len = 0; return NULL; } @@ -310,7 +310,6 @@ int64 protein_search_ex (bprotein haystack, bslaw needle, return OB_INVALID_ARGUMENT; } - return (slaw_is_list (needle) - ? func - : slaw_list_find) (protein_descrips (haystack), needle); + return (slaw_is_list (needle) ? func : slaw_list_find) ( + protein_descrips (haystack), needle); } diff --git a/libPlasma/c/sem_ops.c b/libPlasma/c/sem_ops.c index ec1d1188..968e6b08 100644 --- a/libPlasma/c/sem_ops.c +++ b/libPlasma/c/sem_ops.c @@ -165,9 +165,10 @@ static ob_retort pool_sem_destroy_semaphores (pool_hose ph, // then complain if the semaphore didn't exist. if (it_should_exist && dont_expect_sleep) { - OB_LOG_ERROR_CODE (0x2010a01e, "For pool '%s',\n" - "expected key 0x%08x to exist,\n" - "but got '%s'\n", + OB_LOG_ERROR_CODE (0x2010a01e, + "For pool '%s',\n" + "expected key 0x%08x to exist,\n" + "but got '%s'\n", ph->name, ph->sem_key, strerror (errno)); return POOL_SEMAPHORES_BADTH; } @@ -423,12 +424,12 @@ static void recreate_maliciously_deleted_semaphore (pool_hose ph) } if (errno != EINTR) { - /* Who knows what deep doo-doo we're in at this point, +/* Who knows what deep doo-doo we're in at this point, * and since the user in question feels they shouldn't * have to look at error codes returned by our API, * we will exit for them. */ - ugh: +ugh: ob_nop (); // what, you don't like declarations right after a label? const int erryes = errno; OB_FATAL_ERROR_CODE (0x2010a01f, @@ -533,8 +534,9 @@ static ob_retort pool_sem_lock (pool_hose ph, int idx) } // Count can legitimately be 1 if it's locked by someone else, but never 2 if (count > 1) - OB_FATAL_BUG_CODE (0x2010a00a, "hose '%s' pool '%s': '%s lock' count %d " - "(should be <= 1)\n", + OB_FATAL_BUG_CODE (0x2010a00a, + "hose '%s' pool '%s': '%s lock' count %d " + "(should be <= 1)\n", ph->hose_name, ph->name, idx_to_str (idx), count); gross: @@ -543,11 +545,12 @@ static ob_retort pool_sem_lock (pool_hose ph, int idx) { if ((errno == EINVAL) || (errno == EIDRM)) { - OB_LOG_ERROR_CODE (0x2010a00b, "hose '%s' pool '%s' sem_id %d:\n" - "'%s lock' semop failed " - "with '%s' (%d),\nwhich probably " - "means somebody deleted a pool you " - "were still using\n", + OB_LOG_ERROR_CODE (0x2010a00b, + "hose '%s' pool '%s' sem_id %d:\n" + "'%s lock' semop failed " + "with '%s' (%d),\nwhich probably " + "means somebody deleted a pool you " + "were still using\n", ph->hose_name, ph->name, ph->sem_id, idx_to_str (idx), strerror (errno), errno); return POOL_SEMAPHORES_BADTH; @@ -590,8 +593,9 @@ static ob_retort pool_sem_lock (pool_hose ph, int idx) return POOL_SEMAPHORES_BADTH; } if (count != 0) - OB_FATAL_BUG_CODE (0x2010a010, "hose '%s' pool '%s': '%s lock' locked but " - "count %d (should be 0)\n", + OB_FATAL_BUG_CODE (0x2010a010, + "hose '%s' pool '%s': '%s lock' locked but " + "count %d (should be 0)\n", ph->hose_name, ph->name, idx_to_str (idx), count); return OB_OK; } @@ -621,8 +625,9 @@ static ob_retort pool_sem_unlock (pool_hose ph, int idx) return POOL_SEMAPHORES_BADTH; } if (count != 0) - OB_FATAL_BUG_CODE (0x2010a013, "hose '%s' pool '%s': '%s lock' count %d " - "(should be 0)\n", + OB_FATAL_BUG_CODE (0x2010a013, + "hose '%s' pool '%s': '%s lock' count %d " + "(should be 0)\n", ph->hose_name, ph->name, idx_to_str (idx), count); // Actual unlock @@ -673,8 +678,9 @@ static ob_retort pool_sem_unlock (pool_hose ph, int idx) } // Count can legitimately be 1 if it's locked by someone else, but never 2 if (count > 1) - OB_FATAL_BUG_CODE (0x2010a019, "hose '%s' pool '%s': '%s lock' count %d " - "(should be <= 1)\n", + OB_FATAL_BUG_CODE (0x2010a019, + "hose '%s' pool '%s': '%s lock' count %d " + "(should be <= 1)\n", ph->hose_name, ph->name, idx_to_str (idx), count); return OB_OK; } diff --git a/libPlasma/c/simple_read.c b/libPlasma/c/simple_read.c index 21eb6426..8899b93c 100644 --- a/libPlasma/c/simple_read.c +++ b/libPlasma/c/simple_read.c @@ -43,7 +43,7 @@ int main (int argc, char *argv[]) unsigned long long i; int c; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "s:S:t:")) != -1) { switch (c) @@ -86,7 +86,7 @@ int main (int argc, char *argv[]) // Set an alarm to wake us after the time is up. struct itimerval iv; - memset(&iv, 0, sizeof(iv)); + memset (&iv, 0, sizeof (iv)); iv.it_value.tv_sec = test_secs; if (setitimer (ITIMER_REAL, &iv, NULL) < 0) { diff --git a/libPlasma/c/slaw-coerce.c b/libPlasma/c/slaw-coerce.c index 46111ba2..3b9eef1a 100644 --- a/libPlasma/c/slaw-coerce.c +++ b/libPlasma/c/slaw-coerce.c @@ -91,7 +91,8 @@ static ob_retort homemade_float64_to_unt64 (float64 src, unt64 *result) return homemade_float64bits_to_unt64 (bizarre.u, result); } -typedef enum { +typedef enum +{ NT_FINITE, NT_OVERFLOW, NT_INFINITY, @@ -888,21 +889,21 @@ private_handle_empty (OB_UNUSED void *cookie, OB_UNUSED int vecsize, return SLAW_WRONG_LENGTH; } -static const slaw_handler array_walk_handler = - {private_not_numeric, private_not_numeric, - private_not_numeric_length, private_not_numeric, - private_not_numeric_length, private_not_numeric, - private_nop_array, private_nop, - private_nop_length, private_nop, - private_nop_length, private_nop, - private_not_numeric, private_not_numeric, - private_not_numeric, private_not_numeric_string, - private_handle_int, private_handle_unt, - private_handle_float, private_handle_empty, - private_not_numeric, private_not_numeric, - private_not_numeric_ptr, private_not_numeric, - private_not_numeric, private_not_numeric, - private_not_numeric, private_not_numeric_ptr}; +static const slaw_handler array_walk_handler = { + private_not_numeric, private_not_numeric, + private_not_numeric_length, private_not_numeric, + private_not_numeric_length, private_not_numeric, + private_nop_array, private_nop, + private_nop_length, private_nop, + private_nop_length, private_nop, + private_not_numeric, private_not_numeric, + private_not_numeric, private_not_numeric_string, + private_handle_int, private_handle_unt, + private_handle_float, private_handle_empty, + private_not_numeric, private_not_numeric, + private_not_numeric_ptr, private_not_numeric, + private_not_numeric, private_not_numeric, + private_not_numeric, private_not_numeric_ptr}; ob_retort slaw_to_vn (bslaw src, float64 *dest, int capacity, int *len) { diff --git a/libPlasma/c/slaw-io.c b/libPlasma/c/slaw-io.c index 072899d8..3cffb18e 100644 --- a/libPlasma/c/slaw-io.c +++ b/libPlasma/c/slaw-io.c @@ -93,16 +93,17 @@ static ob_retort private_read_binary_header (slaw_read_handler h, unt8 *version, if (size_read < sizeof (buf)) { - OB_LOG_ERROR_CODE (0x20002000, "binary slaw file (%" OB_FMT_SIZE - "u bytes) is less than 8 bytes long!\n", + OB_LOG_ERROR_CODE (0x20002000, + "binary slaw file (%" OB_FMT_SIZE + "u bytes) is less than 8 bytes long!\n", size_read); return SLAW_WRONG_FORMAT; } else if (size_read > sizeof (buf)) { - OB_LOG_ERROR_CODE (0x20002005, "Didn't expect %" OB_FMT_SIZE - "u to be greater than 8\n", - size_read); + OB_LOG_ERROR_CODE ( + 0x20002005, "Didn't expect %" OB_FMT_SIZE "u to be greater than 8\n", + size_read); return OB_UNKNOWN_ERR; } @@ -183,12 +184,9 @@ ob_retort slaw_output_open_binary_handler (slaw_write_handler h, { ob_retort err; - err = - private_write_binary_header (h, CURRENT_VERSION, - PLASMA_BINARY_FILE_TYPE_SLAW, - (ob_i_am_big_endian () - ? PLASMA_BINARY_FILE_FLAG_BIG_ENDIAN_SLAW - : 0)); + err = private_write_binary_header ( + h, CURRENT_VERSION, PLASMA_BINARY_FILE_TYPE_SLAW, + (ob_i_am_big_endian () ? PLASMA_BINARY_FILE_FLAG_BIG_ENDIAN_SLAW : 0)); if (err != OB_OK) return err; @@ -257,8 +255,9 @@ static ob_retort binary_input_read (slaw_input f, slaw *s) return SLAW_END_OF_FILE; else if (size_read > sizeof (slawhead)) { - OB_LOG_ERROR_CODE (0x20002006, "Didn't expect %" OB_FMT_SIZE - "u to be greater than %" OB_FMT_SIZE "u\n", + OB_LOG_ERROR_CODE (0x20002006, + "Didn't expect %" OB_FMT_SIZE + "u to be greater than %" OB_FMT_SIZE "u\n", size_read, sizeof (slawhead)); return OB_UNKNOWN_ERR; } @@ -369,25 +368,24 @@ ob_retort slaw_input_open_binary_handler (slaw_read_handler h, slaw_input *f) if (version > CURRENT_VERSION) { - OB_LOG_ERROR_CODE (0x20002002, "binary slaw file is version %u but " - "expected version %u or earlier\n", + OB_LOG_ERROR_CODE (0x20002002, + "binary slaw file is version %u but " + "expected version %u or earlier\n", version, CURRENT_VERSION); return SLAW_WRONG_VERSION; } if (typ != PLASMA_BINARY_FILE_TYPE_SLAW) { - OB_LOG_ERROR_CODE (0x20002003, "binary slaw file has type %u but " - "expected type %u\n", + OB_LOG_ERROR_CODE (0x20002003, + "binary slaw file has type %u but " + "expected type %u\n", typ, PLASMA_BINARY_FILE_TYPE_SLAW); return SLAW_WRONG_FORMAT; } - return make_binary_input_file (h, f, - ((flags - & PLASMA_BINARY_FILE_FLAG_BIG_ENDIAN_SLAW) - != 0), - version); + return make_binary_input_file ( + h, f, ((flags & PLASMA_BINARY_FILE_FLAG_BIG_ENDIAN_SLAW) != 0), version); } slaw_input new_slaw_input (void) diff --git a/libPlasma/c/slaw-v1.c b/libPlasma/c/slaw-v1.c index b294f10c..78b35d6e 100644 --- a/libPlasma/c/slaw-v1.c +++ b/libPlasma/c/slaw-v1.c @@ -236,8 +236,9 @@ struct _slaw_bundle #define SLAW_NUMERIC_MAX_UNIT_BSIZE ((unt64) SLAW_NUMERIC_UNIT_BSIZE_MASK) #define SLAW_IS_N_ILK(s, ilky) \ - (SLAW_IS_NUMERIC (s) && ((SLAW_ILK (s) & SLAW_NUMERIC_PERSONALITY_BITS) \ - == (SLAW_##ilky & SLAW_NUMERIC_PERSONALITY_BITS))) + (SLAW_IS_NUMERIC (s) \ + && ((SLAW_ILK (s) & SLAW_NUMERIC_PERSONALITY_BITS) \ + == (SLAW_##ilky & SLAW_NUMERIC_PERSONALITY_BITS))) #define SLAW_IS_N_CORE_ILK(s, ilky) \ (SLAW_IS_NUMERIC (s) \ @@ -332,9 +333,10 @@ struct _slaw_bundle #define SLAW_IS_NUMERIC_SCALAR(s) (SLAW_IS_NUMERIC (s) && SLAW_IS_N_SCALAR (s)) #define SLAW_N_VECTOR_WIDTH(s) \ - (!SLAW_IS_NUMERIC (s) ? -1 : (1 + SLAW_IS_N_MVEC (s) \ - + ((SLAW_ILK (s) & SLAW_NUMERIC_VEC_BITS) \ - >> SLAW_NUMERIC_VEC_SHIFTY))) + (!SLAW_IS_NUMERIC (s) ? -1 \ + : (1 + SLAW_IS_N_MVEC (s) \ + + ((SLAW_ILK (s) & SLAW_NUMERIC_VEC_BITS) \ + >> SLAW_NUMERIC_VEC_SHIFTY))) #define SLAW_NUMERIC_UNIT_BSIZE(s) \ @@ -361,11 +363,12 @@ struct _slaw_bundle - 1) #define SLAW_N_ARRAY_BREADTH(s) \ - (SLAW_IS_N_SINGLETON (s) ? 0 : (SLAW_N_ARRAY_HAS_WEE_BREADTH (s) \ - ? SLAW_N_ARRAY_WEE_BREADTH (s) \ - : (SLAW_N_ARRAY_HAS_8_BYTE_BREADTH (s) \ - ? (*((unt64 *) (s + 1))) \ - : (*((unt32 *) (s + 1)))))) + (SLAW_IS_N_SINGLETON (s) \ + ? 0 \ + : (SLAW_N_ARRAY_HAS_WEE_BREADTH (s) \ + ? SLAW_N_ARRAY_WEE_BREADTH (s) \ + : (SLAW_N_ARRAY_HAS_8_BYTE_BREADTH (s) ? (*((unt64 *) (s + 1))) \ + : (*((unt32 *) (s + 1)))))) #define SLAW_N_ARRAY_FIRST_ELEM(s) \ ((void *) (SLAW_N_ARRAY_HAS_WEE_BREADTH (s) \ @@ -374,7 +377,7 @@ struct _slaw_bundle #define SLAW_N_ARRAY_NTH_ELEM(s, N) \ ((void *) (((unt8 *) SLAW_N_ARRAY_FIRST_ELEM (s)) \ - + (N) *SLAW_NUMERIC_UNIT_BSIZE (s))) + + (N) * SLAW_NUMERIC_UNIT_BSIZE (s))) // the basics, kid: @@ -776,7 +779,8 @@ static int v1tms_revert (const void *va, const void *vb) // https://bugs.oblong.com/show_bug.cgi?id=28#c3 // But I'll leave this enum here in case different behavior is needed in // the future. -typedef enum { +typedef enum +{ DUP_KEEP_FIRST, DUP_KEEP_LAST, DUP_KEEP_LAST_IN_POSITION_OF_FIRST @@ -1300,8 +1304,9 @@ static unt64 v1slaw_quadlen (bslaw s) return 1; if (SLAW_IS_WEE_PROTEIN (s)) { - return 1 + ((SLAW_ILK (s) & SLAW_PROTEIN_QUADLEN_BITS) - >> SLAW_PROTEIN_QUADLEN_SHIFTY); + return 1 + + ((SLAW_ILK (s) & SLAW_PROTEIN_QUADLEN_BITS) + >> SLAW_PROTEIN_QUADLEN_SHIFTY); } if (SLAW_LENGTH_FOLLOWS_FLAG_IS_SET (s)) { @@ -2031,7 +2036,8 @@ static ob_retort v1sf_begin_array (void *cookie) return v1sf_enter (sf, OB_ARRAY); } -static ob_retort v1sf_begin_array_hinted (void *cookie, OB_UNUSED int64 hint, OB_UNUSED int hint2) +static ob_retort v1sf_begin_array_hinted (void *cookie, OB_UNUSED int64 hint, + OB_UNUSED int hint2) { return v1sf_begin_array (cookie); } @@ -2262,8 +2268,9 @@ static ob_retort v1sf_handle_nonstd_protein (void *cookie, const void *pp, unt64 p_len = v1slaw_len (p); if (p_len != len) { - OB_LOG_ERROR_CODE (0x20003002, "nonstandard protein is %" OB_FMT_64 "u" - " but thought it was %" OB_FMT_64 "u\n", + OB_LOG_ERROR_CODE (0x20003002, + "nonstandard protein is %" OB_FMT_64 "u" + " but thought it was %" OB_FMT_64 "u\n", p_len, len); return SLAW_CORRUPT_SLAW; } @@ -2744,19 +2751,35 @@ static int v1slaw_numeric_unit_bsize (bslaw s) return (v1slaw_is_numeric (s) ? SLAW_NUMERIC_UNIT_BSIZE (s) : 0); } -static const slaw_handler v1slaw_fabrication_handler = - {v1sf_begin_cons, v1sf_end_cons, - v1sf_begin_list, /* same function to begin list or map */ - v1sf_end_map, - v1sf_begin_list, v1sf_end_list, - v1sf_begin_array_hinted, v1sf_end_array, - v1sf_begin_multivector, - v1sf_end_multivector, v1sf_begin_vector, - v1sf_end_vector, v1sf_begin_complex, v1sf_end_complex, v1sf_handle_nil, - v1sf_handle_string, v1sf_handle_int, v1sf_handle_unt, v1sf_handle_float, - v1sf_handle_empty_array, v1sf_begin_protein, v1sf_end_protein, - v1sf_handle_nonstd_protein, v1sf_begin_descrips, v1sf_end_descips, - v1sf_begin_ingests, v1sf_end_ingests, v1sf_handle_rude_data}; +static const slaw_handler v1slaw_fabrication_handler = { + v1sf_begin_cons, + v1sf_end_cons, + v1sf_begin_list, /* same function to begin list or map */ + v1sf_end_map, + v1sf_begin_list, + v1sf_end_list, + v1sf_begin_array_hinted, + v1sf_end_array, + v1sf_begin_multivector, + v1sf_end_multivector, + v1sf_begin_vector, + v1sf_end_vector, + v1sf_begin_complex, + v1sf_end_complex, + v1sf_handle_nil, + v1sf_handle_string, + v1sf_handle_int, + v1sf_handle_unt, + v1sf_handle_float, + v1sf_handle_empty_array, + v1sf_begin_protein, + v1sf_end_protein, + v1sf_handle_nonstd_protein, + v1sf_begin_descrips, + v1sf_end_descips, + v1sf_begin_ingests, + v1sf_end_ingests, + v1sf_handle_rude_data}; static ob_retort v1build (slaw *s, const slaw_vfuncs *v) { diff --git a/libPlasma/c/slaw-walk.c b/libPlasma/c/slaw-walk.c index 41da1b50..f53638e9 100644 --- a/libPlasma/c/slaw-walk.c +++ b/libPlasma/c/slaw-walk.c @@ -22,8 +22,9 @@ int k; \ if (sizeof (typ) != bsize) \ { \ - OB_LOG_ERROR_CODE (0x20004000, "For type %s, %" OB_FMT_SIZE \ - "d != %d unexpectedly!\n", \ + OB_LOG_ERROR_CODE (0x20004000, \ + "For type %s, %" OB_FMT_SIZE \ + "d != %d unexpectedly!\n", \ #typ, sizeof (typ), bsize); \ return SLAW_CORRUPT_SLAW; \ } \ @@ -44,8 +45,9 @@ int k; \ if (sizeof (typ) != bsize) \ { \ - OB_LOG_ERROR_CODE (0x20004001, "For type %s, %" OB_FMT_SIZE \ - "d != %d unexpectedly!\n", \ + OB_LOG_ERROR_CODE (0x20004001, \ + "For type %s, %" OB_FMT_SIZE \ + "d != %d unexpectedly!\n", \ #typ, sizeof (typ), bsize); \ return SLAW_CORRUPT_SLAW; \ } \ @@ -66,8 +68,9 @@ int k; \ if (sizeof (typ) != bsize) \ { \ - OB_LOG_ERROR_CODE (0x20004002, "For type %s, %" OB_FMT_SIZE \ - "d != %d unexpectedly!\n", \ + OB_LOG_ERROR_CODE (0x20004002, \ + "For type %s, %" OB_FMT_SIZE \ + "d != %d unexpectedly!\n", \ #typ, sizeof (typ), bsize); \ return SLAW_CORRUPT_SLAW; \ } \ @@ -114,9 +117,9 @@ {el->re, el->im}); \ HANDLE_COMPLEX_VECTOR (2, v2##typ##c, largetyp, hand, \ {el->x.re, el->y.re, el->x.im, el->y.im}); \ - HANDLE_COMPLEX_VECTOR (3, v3##typ##c, largetyp, hand, \ - {el->x.re, el->y.re, el->z.re, el->x.im, \ - el->y.im, el->z.im}); \ + HANDLE_COMPLEX_VECTOR ( \ + 3, v3##typ##c, largetyp, hand, \ + {el->x.re, el->y.re, el->z.re, el->x.im, el->y.im, el->z.im}); \ HANDLE_COMPLEX_VECTOR (4, v4##typ##c, largetyp, hand, \ {el->x.re, el->y.re, el->z.re, el->w.re, \ el->x.im, el->y.im, el->z.im, el->w.im}); \ @@ -247,10 +250,9 @@ ob_retort slaw_walk_versioned (void *cookie, const slaw_handler *handler, if (arrayLen == 0) { - return handler->handle_empty_array (cookie, vecLen, isMVec, isComplex, - isUnsigned, isFloat, - (isStumpy ? (isWide ? 16 : 8) - : (isWide ? 64 : 32))); + return handler->handle_empty_array ( + cookie, vecLen, isMVec, isComplex, isUnsigned, isFloat, + (isStumpy ? (isWide ? 16 : 8) : (isWide ? 64 : 32))); } if (isArray) @@ -1053,8 +1055,9 @@ static ob_retort sf_handle_nonstd_protein (void *cookie, const void *pp, unt64 p_len = protein_len (p); if (p_len != len) { - OB_LOG_ERROR_CODE (0x20004007, "nonstandard protein is %" OB_FMT_64 "u" - " but thought it was %" OB_FMT_64 "u\n", + OB_LOG_ERROR_CODE (0x20004007, + "nonstandard protein is %" OB_FMT_64 "u" + " but thought it was %" OB_FMT_64 "u\n", p_len, len); return SLAW_CORRUPT_SLAW; } @@ -1107,32 +1110,32 @@ static ob_retort sf_handle_rude_data (void *cookie, const void *d, int64 len) return OB_OK; } -const slaw_handler slaw_fabrication_handler = - {sf_begin_cons, - sf_end_cons, - sf_begin_list, /* same function to begin list or map */ - sf_end_map, - sf_begin_list, - sf_end_list, - sf_begin_array, - sf_end_array, - sf_begin_multivector, - sf_end_multivector, - sf_begin_vector, - sf_end_vector, - sf_begin_complex, - sf_end_complex, - sf_handle_nil, - sf_handle_string, - sf_handle_int, - sf_handle_unt, - sf_handle_float, - sf_handle_empty_array, - sf_begin_protein, - sf_end_protein, - sf_handle_nonstd_protein, - sf_begin_descrips, - sf_end_descips, - sf_begin_ingests, - sf_end_ingests, - sf_handle_rude_data}; +const slaw_handler slaw_fabrication_handler = { + sf_begin_cons, + sf_end_cons, + sf_begin_list, /* same function to begin list or map */ + sf_end_map, + sf_begin_list, + sf_end_list, + sf_begin_array, + sf_end_array, + sf_begin_multivector, + sf_end_multivector, + sf_begin_vector, + sf_end_vector, + sf_begin_complex, + sf_end_complex, + sf_handle_nil, + sf_handle_string, + sf_handle_int, + sf_handle_unt, + sf_handle_float, + sf_handle_empty_array, + sf_begin_protein, + sf_end_protein, + sf_handle_nonstd_protein, + sf_begin_descrips, + sf_end_descips, + sf_begin_ingests, + sf_end_ingests, + sf_handle_rude_data}; diff --git a/libPlasma/c/slaw-yaml-stub.c b/libPlasma/c/slaw-yaml-stub.c index 3873c8bb..22f4b365 100644 --- a/libPlasma/c/slaw-yaml-stub.c +++ b/libPlasma/c/slaw-yaml-stub.c @@ -14,6 +14,4 @@ ob_retort slaw_output_open_text_handler (slaw_write_handler h, bslaw options, return SLAW_NO_YAML; } -void private_test_yaml_hash (void) -{ -} +void private_test_yaml_hash (void) {} diff --git a/libPlasma/c/slaw-yaml.c b/libPlasma/c/slaw-yaml.c index e0e52d7d..4a4f8b49 100644 --- a/libPlasma/c/slaw-yaml.c +++ b/libPlasma/c/slaw-yaml.c @@ -26,21 +26,21 @@ #define SLAW_TAG_PREFIX "tag:oblong.com,2009:slaw/" #define YAML_TAG_PREFIX "tag:yaml.org,2002:" -#define SLAW_MAP_TAG (yaml_char_t *) YAML_TAG_PREFIX "map" -#define SLAW_OMAP_TAG (yaml_char_t *) YAML_TAG_PREFIX "omap" -#define SLAW_LIST_TAG (yaml_char_t *) YAML_TAG_PREFIX "seq" -#define SLAW_ARRAY_TAG (yaml_char_t *) SLAW_TAG_PREFIX "array" +#define SLAW_MAP_TAG (yaml_char_t *) YAML_TAG_PREFIX "map" +#define SLAW_OMAP_TAG (yaml_char_t *) YAML_TAG_PREFIX "omap" +#define SLAW_LIST_TAG (yaml_char_t *) YAML_TAG_PREFIX "seq" +#define SLAW_ARRAY_TAG (yaml_char_t *) SLAW_TAG_PREFIX "array" #define SLAW_MULTIVECTOR_TAG (yaml_char_t *) SLAW_TAG_PREFIX "multivector" -#define SLAW_VECTOR_TAG (yaml_char_t *) SLAW_TAG_PREFIX "vector" -#define SLAW_COMPLEX_TAG (yaml_char_t *) SLAW_TAG_PREFIX "complex" -#define SLAW_NULL_TAG (yaml_char_t *) YAML_TAG_PREFIX "null" -#define SLAW_STRING_TAG (yaml_char_t *) YAML_TAG_PREFIX "str" -#define SLAW_PROTEIN_TAG (yaml_char_t *) SLAW_TAG_PREFIX "protein" -#define SLAW_NONSTD_TAG (yaml_char_t *) SLAW_TAG_PREFIX "nonstd" -#define SLAW_CONS_TAG (yaml_char_t *) SLAW_TAG_PREFIX "cons" -#define SLAW_BOOL_TAG (yaml_char_t *) YAML_TAG_PREFIX "bool" -#define SLAW_BINARY_TAG (yaml_char_t *) YAML_TAG_PREFIX "binary" -#define SLAW_BADUTF8_TAG (yaml_char_t *) SLAW_TAG_PREFIX "badutf8" +#define SLAW_VECTOR_TAG (yaml_char_t *) SLAW_TAG_PREFIX "vector" +#define SLAW_COMPLEX_TAG (yaml_char_t *) SLAW_TAG_PREFIX "complex" +#define SLAW_NULL_TAG (yaml_char_t *) YAML_TAG_PREFIX "null" +#define SLAW_STRING_TAG (yaml_char_t *) YAML_TAG_PREFIX "str" +#define SLAW_PROTEIN_TAG (yaml_char_t *) SLAW_TAG_PREFIX "protein" +#define SLAW_NONSTD_TAG (yaml_char_t *) SLAW_TAG_PREFIX "nonstd" +#define SLAW_CONS_TAG (yaml_char_t *) SLAW_TAG_PREFIX "cons" +#define SLAW_BOOL_TAG (yaml_char_t *) YAML_TAG_PREFIX "bool" +#define SLAW_BINARY_TAG (yaml_char_t *) YAML_TAG_PREFIX "binary" +#define SLAW_BADUTF8_TAG (yaml_char_t *) SLAW_TAG_PREFIX "badutf8" /* If you were to read the YAML spec: * @@ -60,7 +60,8 @@ */ #define SLAW_BROKEN_STRING_TAG (yaml_char_t *) YAML_TAG_PREFIX "string" -typedef enum sly_plain_scalar_type { +typedef enum sly_plain_scalar_type +{ SLY_SCALAR_NULL, SLY_SCALAR_BOOL, SLY_SCALAR_10, @@ -388,10 +389,11 @@ static unt64 base64_to_bin_convert (unt64 base64_len, const char *base64, return idst; } -typedef enum { - NOT_IN_A_MAP = 10, +typedef enum +{ + NOT_IN_A_MAP = 10, INSIDE_UNORDERED_MAP = 20, - INSIDE_ORDERED_MAP = 30 + INSIDE_ORDERED_MAP = 30 } mappiness; typedef struct sly_emitter_info @@ -640,9 +642,8 @@ static ob_retort sly_begin_map (void *cookie, int64 unused) ob_retort err = info_push (info, INSIDE_ORDERED_MAP); if (err < OB_OK) return err; - if (yaml_sequence_start_event_initialize (&event, NULL, SLAW_OMAP_TAG, - false, - YAML_BLOCK_SEQUENCE_STYLE) + if (yaml_sequence_start_event_initialize ( + &event, NULL, SLAW_OMAP_TAG, false, YAML_BLOCK_SEQUENCE_STYLE) && yaml_emitter_emit (emitter, &event)) return OB_OK; else @@ -877,20 +878,18 @@ static ob_retort sly_handle_string (void *cookie, const char *utf8, int64 len) base64_len = bin_to_base64_convert (len, (byte *) utf8, buf_len, b64buf); - ysei = - yaml_scalar_event_initialize (&event, NULL, SLAW_BADUTF8_TAG, - (yaml_char_t *) b64buf, base64_len, false, - false, YAML_LITERAL_SCALAR_STYLE); + ysei = yaml_scalar_event_initialize ( + &event, NULL, SLAW_BADUTF8_TAG, (yaml_char_t *) b64buf, base64_len, + false, false, YAML_LITERAL_SCALAR_STYLE); } else { if (multiline) style = YAML_LITERAL_SCALAR_STYLE; - ysei = yaml_scalar_event_initialize (&event, NULL, SLAW_STRING_TAG, - (yaml_char_t *) utf8, len, - (style == YAML_PLAIN_SCALAR_STYLE), - true, style); + ysei = yaml_scalar_event_initialize ( + &event, NULL, SLAW_STRING_TAG, (yaml_char_t *) utf8, len, + (style == YAML_PLAIN_SCALAR_STYLE), true, style); } if (!ysei) @@ -930,10 +929,9 @@ static ob_retort sly_handle_int (void *cookie, int64 val, int bits) snprintf (tag, sizeof (tag), "%si%d", SLAW_TAG_PREFIX, bits); snprintf (buf, sizeof (buf), "%" OB_FMT_64 "d", val); - if (yaml_scalar_event_initialize (&event, NULL, (yaml_char_t *) tag, - (yaml_char_t *) buf, strlen (buf), - !info->tag_numbers, false, - YAML_PLAIN_SCALAR_STYLE) + if (yaml_scalar_event_initialize ( + &event, NULL, (yaml_char_t *) tag, (yaml_char_t *) buf, strlen (buf), + !info->tag_numbers, false, YAML_PLAIN_SCALAR_STYLE) && yaml_emitter_emit (emitter, &event)) return OB_OK; else @@ -960,10 +958,9 @@ static ob_retort sly_handle_unt (void *cookie, unt64 val, int bits) snprintf (tag, sizeof (tag), "%su%d", SLAW_TAG_PREFIX, bits); snprintf (buf, sizeof (buf), "%" OB_FMT_64 "u", val); } - if (yaml_scalar_event_initialize (&event, NULL, (yaml_char_t *) tag, - (yaml_char_t *) buf, strlen (buf), - (bits == 1 || !info->tag_numbers), false, - YAML_PLAIN_SCALAR_STYLE) + if (yaml_scalar_event_initialize ( + &event, NULL, (yaml_char_t *) tag, (yaml_char_t *) buf, strlen (buf), + (bits == 1 || !info->tag_numbers), false, YAML_PLAIN_SCALAR_STYLE) && yaml_emitter_emit (emitter, &event)) return OB_OK; else @@ -1001,10 +998,9 @@ static ob_retort sly_handle_float (void *cookie, float64 val, int bits) break; } - if (yaml_scalar_event_initialize (&event, NULL, (yaml_char_t *) tag, - (yaml_char_t *) buf, strlen (buf), - !info->tag_numbers, false, - YAML_PLAIN_SCALAR_STYLE) + if (yaml_scalar_event_initialize ( + &event, NULL, (yaml_char_t *) tag, (yaml_char_t *) buf, strlen (buf), + !info->tag_numbers, false, YAML_PLAIN_SCALAR_STYLE) && yaml_emitter_emit (emitter, &event)) return OB_OK; else @@ -1213,42 +1209,42 @@ static ob_retort sly_write_slaw_to_yaml (sly_emitter_info *emitter, bslaw s) // yaml => events -#define SE_ARRAY OB_CONST_U64 (0x32b9c7ec210c1a04) -#define SE_BADUTF8 OB_CONST_U64 (0xa71e08969f161fb7) -#define SE_BINARY OB_CONST_U64 (0x5cafcc4621b348fa) -#define SE_BOOL OB_CONST_U64 (0xb6492c832b82f189) -#define SE_COMPLEX OB_CONST_U64 (0x2195c54d76476112) -#define SE_CONS OB_CONST_U64 (0xf7b4a5d51438b792) -#define SE_DESCRIPS OB_CONST_U64 (0x3f8d4bbcea903711) -#define SE_F32 OB_CONST_U64 (0x479db3b52758c108) -#define SE_F64 OB_CONST_U64 (0xcd876fe462578c4f) -#define SE_I16 OB_CONST_U64 (0xa8024548a1ca2305) -#define SE_I32 OB_CONST_U64 (0xa489c4c31b630c5a) -#define SE_I64 OB_CONST_U64 (0xc940065b925d3a15) -#define SE_I8 OB_CONST_U64 (0xa266b0470338e398) -#define SE_INGESTS OB_CONST_U64 (0x16a60446ba1f5119) -#define SE_MAP OB_CONST_U64 (0xb17678ff2f939aa2) -#define SE_MULTIVECTOR OB_CONST_U64 (0x5b6eb1410fe7bd04) +#define SE_ARRAY OB_CONST_U64 (0x32b9c7ec210c1a04) +#define SE_BADUTF8 OB_CONST_U64 (0xa71e08969f161fb7) +#define SE_BINARY OB_CONST_U64 (0x5cafcc4621b348fa) +#define SE_BOOL OB_CONST_U64 (0xb6492c832b82f189) +#define SE_COMPLEX OB_CONST_U64 (0x2195c54d76476112) +#define SE_CONS OB_CONST_U64 (0xf7b4a5d51438b792) +#define SE_DESCRIPS OB_CONST_U64 (0x3f8d4bbcea903711) +#define SE_F32 OB_CONST_U64 (0x479db3b52758c108) +#define SE_F64 OB_CONST_U64 (0xcd876fe462578c4f) +#define SE_I16 OB_CONST_U64 (0xa8024548a1ca2305) +#define SE_I32 OB_CONST_U64 (0xa489c4c31b630c5a) +#define SE_I64 OB_CONST_U64 (0xc940065b925d3a15) +#define SE_I8 OB_CONST_U64 (0xa266b0470338e398) +#define SE_INGESTS OB_CONST_U64 (0x16a60446ba1f5119) +#define SE_MAP OB_CONST_U64 (0xb17678ff2f939aa2) +#define SE_MULTIVECTOR OB_CONST_U64 (0x5b6eb1410fe7bd04) #define SE_NON_SPECIFIC OB_CONST_U64 (0x095934e7f55b39ba) -#define SE_NONSTD OB_CONST_U64 (0xd70c69f2b823fb40) -#define SE_NULL OB_CONST_U64 (0x9e34c34e89b60f38) -#define SE_OMAP OB_CONST_U64 (0x42443404839a2550) -#define SE_PROTEIN OB_CONST_U64 (0xdf8a6b35e9acd602) -#define SE_RUDE_DATA OB_CONST_U64 (0xf5cb44dedc2dd3d4) -#define SE_SEQ OB_CONST_U64 (0xd7ec31d8a099ef3c) -#define SE_STRING OB_CONST_U64 (0x2e7062203251384f) -#define SE_STR OB_CONST_U64 (0x6e17023b1ba5ddbf) -#define SE_U16 OB_CONST_U64 (0x2cdc5570e3b4f4c0) -#define SE_U32 OB_CONST_U64 (0xa1d53e6f55db8ac8) -#define SE_U64 OB_CONST_U64 (0x2c67cbce14289d59) -#define SE_U8 OB_CONST_U64 (0x9cdaf818f6756e1a) -#define SE_VECTOR OB_CONST_U64 (0x64fdc5a5ca6cd3c6) +#define SE_NONSTD OB_CONST_U64 (0xd70c69f2b823fb40) +#define SE_NULL OB_CONST_U64 (0x9e34c34e89b60f38) +#define SE_OMAP OB_CONST_U64 (0x42443404839a2550) +#define SE_PROTEIN OB_CONST_U64 (0xdf8a6b35e9acd602) +#define SE_RUDE_DATA OB_CONST_U64 (0xf5cb44dedc2dd3d4) +#define SE_SEQ OB_CONST_U64 (0xd7ec31d8a099ef3c) +#define SE_STRING OB_CONST_U64 (0x2e7062203251384f) +#define SE_STR OB_CONST_U64 (0x6e17023b1ba5ddbf) +#define SE_U16 OB_CONST_U64 (0x2cdc5570e3b4f4c0) +#define SE_U32 OB_CONST_U64 (0xa1d53e6f55db8ac8) +#define SE_U64 OB_CONST_U64 (0x2c67cbce14289d59) +#define SE_U8 OB_CONST_U64 (0x9cdaf818f6756e1a) +#define SE_VECTOR OB_CONST_U64 (0x64fdc5a5ca6cd3c6) /* keep track of our element, position, and context * using a stack of v3unt64. */ -#define CURRENT_ELEMENT x +#define CURRENT_ELEMENT x #define CURRENT_POSITION y -#define CURRENT_CONTEXT z +#define CURRENT_CONTEXT z /* All this does is call ob_city_hash64 on a NUL-terminated string. */ static inline unt64 sly_hash (const yaml_char_t *s) @@ -1348,9 +1344,9 @@ static ob_retort sly_parse (void *cookie, const slaw_handler *handler, { if (event.data.scalar.style == YAML_PLAIN_SCALAR_STYLE) { - plainTyp = sly_classify_plain ((const char *) - event.data.scalar.value, - event.data.scalar.length); + plainTyp = sly_classify_plain ( + (const char *) event.data.scalar.value, + event.data.scalar.length); switch (plainTyp) { case SLY_SCALAR_NULL: @@ -1386,8 +1382,9 @@ static ob_retort sly_parse (void *cookie, const slaw_handler *handler, case SE_BINARY: if (!prev || prev->CURRENT_CONTEXT != SE_RUDE_DATA) { - OB_LOG_ERROR_CODE (0x2000500d, "slaw yaml: got %s in " - "unexpected place\n", + OB_LOG_ERROR_CODE (0x2000500d, + "slaw yaml: got %s in " + "unexpected place\n", event.data.scalar.tag); err = SLAW_PARSING_BADNESS; break; @@ -1401,10 +1398,9 @@ static ob_retort sly_parse (void *cookie, const slaw_handler *handler, unt64 len; unt8 *buf = (unt8 *) MAYBE_MALLOC (buflen); memset (buf, 0, buflen); - len = base64_to_bin_convert (event.data.scalar.length, - (const char *) - event.data.scalar.value, - buflen, buf); + len = base64_to_bin_convert ( + event.data.scalar.length, + (const char *) event.data.scalar.value, buflen, buf); if (h == SE_NONSTD) err = handler->handle_nonstd_protein (cookie, buf, len); else if (h == SE_BADUTF8) @@ -1435,9 +1431,9 @@ static ob_retort sly_parse (void *cookie, const slaw_handler *handler, buf[event.data.scalar.length] = 0; if (plainTyp == SLY_SCALAR_UNDECIDED) - plainTyp = sly_classify_plain ((const char *) - event.data.scalar.value, - event.data.scalar.length); + plainTyp = sly_classify_plain ( + (const char *) event.data.scalar.value, + event.data.scalar.length); switch (plainTyp) { @@ -1480,9 +1476,9 @@ static ob_retort sly_parse (void *cookie, const slaw_handler *handler, int bits = 8; if (plainTyp == SLY_SCALAR_UNDECIDED) - plainTyp = sly_classify_plain ((const char *) - event.data.scalar.value, - event.data.scalar.length); + plainTyp = sly_classify_plain ( + (const char *) event.data.scalar.value, + event.data.scalar.length); parse_integer ((const char *) event.data.scalar.value, event.data.scalar.length, &number, plainTyp); @@ -1499,14 +1495,11 @@ static ob_retort sly_parse (void *cookie, const slaw_handler *handler, /* fall through */ case SE_I8: if (number.negative) - err = - handler->handle_int (cookie, - -(int64) number.magnitude, - bits); + err = handler->handle_int ( + cookie, -(int64) number.magnitude, bits); else - err = handler->handle_int (cookie, - (int64) number.magnitude, - bits); + err = handler->handle_int ( + cookie, (int64) number.magnitude, bits); break; case SE_U64: bits *= 2; @@ -1543,11 +1536,9 @@ static ob_retort sly_parse (void *cookie, const slaw_handler *handler, } else { - slaw tmp = - slaw_string_from_substring ((const char *) event - .data.scalar.value, - event.data.scalar - .length); + slaw tmp = slaw_string_from_substring ( + (const char *) event.data.scalar.value, + event.data.scalar.length); OB_LOG_ERROR_CODE (0x2000500e, "slaw yaml: expected 'ingests', " "'descrips',\n" @@ -1559,10 +1550,9 @@ static ob_retort sly_parse (void *cookie, const slaw_handler *handler, } else { - err = handler->handle_string (cookie, - (const char *) - event.data.scalar.value, - event.data.scalar.length); + err = handler->handle_string ( + cookie, (const char *) event.data.scalar.value, + event.data.scalar.length); } } break; @@ -1648,10 +1638,9 @@ static ob_retort sly_parse (void *cookie, const slaw_handler *handler, tag++; bits = atoi (tag); - err = - handler->handle_empty_array (cookie, vecsize, isMVec, - isComplex, isUnsigned, - isFloat, bits); + err = handler->handle_empty_array ( + cookie, vecsize, isMVec, isComplex, isUnsigned, + isFloat, bits); break; } } @@ -1810,8 +1799,9 @@ static ob_retort sly_parse (void *cookie, const slaw_handler *handler, // I don't think it should be possible for this to occur, // so I'm going to call it a programming error, rather than // a user error. - OB_LOG_BUG_CODE (0x20005011, "slaw yaml: yaml parser produced " - "strange event %d\n", + OB_LOG_BUG_CODE (0x20005011, + "slaw yaml: yaml parser produced " + "strange event %d\n", event.type); err = SLAW_PARSING_BADNESS; break; @@ -1845,7 +1835,7 @@ static ob_retort sly_parse (void *cookie, const slaw_handler *handler, } } - badness: +badness: yaml_event_delete (&event); if (popped) @@ -1906,8 +1896,9 @@ static ob_retort write_comment_header (slaw_write_handler h) char *gsv = ob_get_version (OB_VERSION_OF_GSPEAK); char *cfg = ob_get_version (OB_BUILD_CONFIGURATION); slaw s = NULL; - if (gsv && cfg && (s = slaw_string_format ("%s (%s), libYaml %s", gsv, cfg, - yaml_get_version_string ()))) + if (gsv && cfg + && (s = slaw_string_format ("%s (%s), libYaml %s", gsv, cfg, + yaml_get_version_string ()))) { slaw str = slaw_string_format ("# %s - %s\n", ob_get_prog_name (), slaw_string_emit (s)); @@ -2019,11 +2010,9 @@ static ob_retort yaml_output_write_slaw (slaw_output f, bslaw s) bool directives = holder->emitter.directives; - if (!(yaml_document_start_event_initialize (&event, - (directives ? &yvers : NULL), - (directives ? &tdir : NULL), - (directives ? (1 + &tdir) : NULL), - false) + if (!(yaml_document_start_event_initialize ( + &event, (directives ? &yvers : NULL), (directives ? &tdir : NULL), + (directives ? (1 + &tdir) : NULL), false) && yaml_emitter_emit (&(holder->emitter.emitter), &event))) { return PRINT_YAML_EMIT_ERROR (&(holder->emitter.emitter)); @@ -2282,7 +2271,8 @@ void private_test_yaml_hash (void) return; fail: - OB_FATAL_BUG_CODE (0x2000500b, "for '%s', got %" OB_FMT_64 "u" - " but expected %" OB_FMT_64 "u\n", + OB_FATAL_BUG_CODE (0x2000500b, + "for '%s', got %" OB_FMT_64 "u" + " but expected %" OB_FMT_64 "u\n", str, got, expected); } diff --git a/libPlasma/c/slaw.c b/libPlasma/c/slaw.c index 56c8283d..943eb572 100644 --- a/libPlasma/c/slaw.c +++ b/libPlasma/c/slaw.c @@ -407,7 +407,8 @@ static int tms_revert (const void *va, const void *vb) // https://bugs.oblong.com/show_bug.cgi?id=28#c3 // But I'll leave this enum here in case different behavior is needed in // the future. -typedef enum { +typedef enum +{ DUP_KEEP_FIRST, DUP_KEEP_LAST, DUP_KEEP_LAST_IN_POSITION_OF_FIRST @@ -1387,8 +1388,8 @@ slaw slaw_list_inline_c (const char *first_str, ...) if (first_str && *first_str) { - ob_err_accum (&err, slabu_list_add_internal (sb, slaw_string (first_str), - true)); + ob_err_accum ( + &err, slabu_list_add_internal (sb, slaw_string (first_str), true)); const char *str; va_start (vargies, first_str); while ((str = va_arg (vargies, const char *))) @@ -2034,14 +2035,16 @@ unt64 slaw_octlen (bslaw s) case SLAW_NIB_SINGL_SINT: case SLAW_NIB_SINGL_UINT: case SLAW_NIB_SINGL_FLOAT: - bsize = (1 + ((ilk >> SLAW_NUMERIC_BSIZE_SHIFTY) - & SLAW_NUMERIC_UNIT_BSIZE_MASK)); + bsize = (1 + + ((ilk >> SLAW_NUMERIC_BSIZE_SHIFTY) + & SLAW_NUMERIC_UNIT_BSIZE_MASK)); return (bsize <= 4 ? 1 : 1 + ((bsize + 7) / 8)); case SLAW_NIB_ARRAY_SINT: case SLAW_NIB_ARRAY_UINT: case SLAW_NIB_ARRAY_FLOAT: - bsize = (1 + ((ilk >> SLAW_NUMERIC_BSIZE_SHIFTY) - & SLAW_NUMERIC_UNIT_BSIZE_MASK)); + bsize = (1 + + ((ilk >> SLAW_NUMERIC_BSIZE_SHIFTY) + & SLAW_NUMERIC_UNIT_BSIZE_MASK)); breadth = (ilk & SLAW_NUMERIC_ARRAY_BREADTH_MASK); asize = (bsize * breadth); return 1 + ((asize + 7) / 8); @@ -2247,11 +2250,12 @@ static void slaw_spew_numeric_ovewview (bslaw s, fwfunc func, void *whither) _FW ("V%d", vecWid); else if (isM) _FW ("M%d", vecWid); - _FW ("%s%d", (slaw_is_numeric_float (s) - ? "FLOAT" - : (slaw_is_numeric_int (s) - ? "INT" - : (slaw_is_numeric_unt (s) ? "UNT" : ""))), + _FW ("%s%d", + (slaw_is_numeric_float (s) + ? "FLOAT" + : (slaw_is_numeric_int (s) + ? "INT" + : (slaw_is_numeric_unt (s) ? "UNT" : ""))), 8 * slinc); if (isC) @@ -2353,7 +2357,7 @@ static void slaw_spew_internal (bslaw s, fwfunc func, void *whither, if (rudeLen > 0) { int64 i; - char rudeBuf[OB_HEX_LINE_LEN]; + char rudeBuf[OB_HEX_LINE_LEN]; _FW ("%srude data: %" OB_FMT_64 "d bytes\n", prolo, rudeLen); for (i = 0; i < rudeLen; i += 16) { @@ -2526,7 +2530,7 @@ ob_retort slaw_swap (slaw s, slaw stop) case SLAW_NIB_ARRAY_UINT: case SLAW_NIB_ARRAY_FLOAT: breadth = SLAW_N_ARRAY_BREADTH (s); - swap_numeric: +swap_numeric: primBytes = SLAW_NUMERIC_PRIM_BYTES (s); if (primBytes == 1) return OB_OK; /* 1-byte units don't need swapping */ diff --git a/libPlasma/c/t/MiscSlawTest.cpp b/libPlasma/c/t/MiscSlawTest.cpp index 23fdaf1c..a080f139 100644 --- a/libPlasma/c/t/MiscSlawTest.cpp +++ b/libPlasma/c/t/MiscSlawTest.cpp @@ -19,7 +19,7 @@ #include "libLoam/c/ob-file.h" #include "libLoam/c/ob-pthread.h" -static const char *ob_test_source_relative(const char *f) +static const char *ob_test_source_relative (const char *f) { return ob_test_source_relative2 (ABS_TOP_SRCDIR "/libPlasma/c/t", f); } @@ -200,10 +200,11 @@ TEST (MiscSlawTest, BadGenericOpen) TEST (MiscSlawTest, BadOutputTextOpen) { slaw_output f; - EXPECT_EQ (ob_errno_to_retort (dir_error), - slaw_output_open_text_options_f ( - ".", &f, slaw_map_inline_cf ("ordered_maps", - slaw_boolean (false), NULL))); + EXPECT_EQ ( + ob_errno_to_retort (dir_error), + slaw_output_open_text_options_f ( + ".", &f, + slaw_map_inline_cf ("ordered_maps", slaw_boolean (false), NULL))); } struct thingy @@ -415,28 +416,26 @@ MiscSlawTest1::MiscSlawTest1 () "natty narwhal", slaw_float64 (11.04), NULL); a_small_protein = protein_from_llr (descrips, a_slaw_map, &meaning, 1); a_large_protein = protein_from_llr (descrips, a_slaw_map, bin500, len500); - a_slaw_list = - slaw_list_inline_f (slaw_string ("\303\234nicode"), - slaw_string ("DwCDUZmdct XGVLUI\312\274NDEO " - "zHVPlmG\360\235\225\203wy" - " HubGdlLjVN XCGLDUJ\312\274NUE " - "yyUTesYmrw"), - slaw_unt32 (0xdeadbeef), slaw_nil (), - slaw_string (KATY_PERRYS_SPELLING), - slaw_unt64 (OB_CONST_U64 (12345678901234567890)), NULL); + a_slaw_list = slaw_list_inline_f ( + slaw_string ("\303\234nicode"), + slaw_string ("DwCDUZmdct XGVLUI\312\274NDEO " + "zHVPlmG\360\235\225\203wy" + " HubGdlLjVN XCGLDUJ\312\274NUE " + "yyUTesYmrw"), + slaw_unt32 (0xdeadbeef), slaw_nil (), slaw_string (KATY_PERRYS_SPELLING), + slaw_unt64 (OB_CONST_U64 (12345678901234567890)), NULL); byte *sorted = new byte[len500]; memcpy (sorted, bin500, len500); std::sort (sorted, sorted + len500); byte uniq[256]; // can't be more than 256 unique bytes, by definition byte *uend = std::unique_copy (sorted, sorted + len500, uniq); - a_large_map = slaw_map_inline_ff (slaw_string ("That's an error"), - slaw_unt8_array (bin500, len500), - slaw_string ("unique"), - slaw_unt8_array (uniq, uend - uniq), - slaw_unt8_array (sorted, len500), - slaw_string ("that was binary data " - "as a map key"), - NULL); + a_large_map = slaw_map_inline_ff ( + slaw_string ("That's an error"), slaw_unt8_array (bin500, len500), + slaw_string ("unique"), slaw_unt8_array (uniq, uend - uniq), + slaw_unt8_array (sorted, len500), + slaw_string ("that was binary data " + "as a map key"), + NULL); some_slawx[0] = a_slaw_string; some_slawx[1] = a_slaw_map; @@ -574,11 +573,9 @@ class ProteinSearchTest : public ::testing::Test }; ProteinSearchTest::ProteinSearchTest () - : haystack ( - protein_from_ff (slaw_list_f ( - slabu_of_strings_from_split (KATY_PERRYS_SPELLING, - " ")), - NULL)), + : haystack (protein_from_ff ( + slaw_list_f (slabu_of_strings_from_split (KATY_PERRYS_SPELLING, " ")), + NULL)), needle1 (slaw_string ("MIRROW")), needle2 (slaw_string ("MIRROR")), needle3 (slaw_list_inline_c ("STAIR", "REARVIEUW", NULL)), diff --git a/libPlasma/c/t/endian_test.c b/libPlasma/c/t/endian_test.c index 229a13a3..19c14959 100644 --- a/libPlasma/c/t/endian_test.c +++ b/libPlasma/c/t/endian_test.c @@ -15,426 +15,506 @@ #include "libPlasma/c/slaw-string.h" #include "libLoam/c/ob-log.h" -static const char *japanese[] = - {"There are three types of adjective:", "", - "1) \345\275\242\345\256\271\350\251\236 keiy\305\215shi, or i " - "adjectives, which have a conjugating ending i", - " (\343\201\204) (such as \343\201\202\343\201\244\343\201\204 atsui " - "\"to be hot\") which can become past (\343\201\202\343\201\244", - " \343\201\213\343\201\243 \343\201\237 atsukatta \"it was hot\"), or " - "negative (\343\201\202\343\201\244\343\201\217\343\201\252\343\201\204 " - "atsuku nai", - " \"it is not hot\"). Note that nai is also an i adjective, which can", - " become past (\343\201\202\343\201\244\343\201\217\343\201\252" - "\343\201\213\343\201\243\343\201\237 atsuku nakatta \"it was not hot\").", - "", " \346\232\221\343\201\204\346\227\245 atsui hi \"a hot day\".", "", - "2) \345\275\242\345\256\271\345\213\225\350\251\236 " - "keiy\305\215d\305\215shi, or na adjectives, which are followed by a form", - " of the copula, usually na. For example hen (strange)", "", - " \345\244\211\343\201\252\343\201\262\343\201\250 hen na hito \"a " - "strange person\".", - "", "3) \351\200\243\344\275\223\350\251\236 rentaishi, also called true " - "adjectives, such as ano \"that\"", - "", " \343\201\202\343\201\256\345\261\261 ano yama \"that mountain\".", - ""}; +static const char *japanese[] = { + "There are three types of adjective:", + "", + "1) \345\275\242\345\256\271\350\251\236 keiy\305\215shi, or i " + "adjectives, which have a conjugating ending i", + " (\343\201\204) (such as \343\201\202\343\201\244\343\201\204 atsui " + "\"to be hot\") which can become past (\343\201\202\343\201\244", + " \343\201\213\343\201\243 \343\201\237 atsukatta \"it was hot\"), or " + "negative (\343\201\202\343\201\244\343\201\217\343\201\252\343\201\204 " + "atsuku nai", + " \"it is not hot\"). Note that nai is also an i adjective, which can", + " become past (\343\201\202\343\201\244\343\201\217\343\201\252" + "\343\201\213\343\201\243\343\201\237 atsuku nakatta \"it was not hot\").", + "", + " \346\232\221\343\201\204\346\227\245 atsui hi \"a hot day\".", + "", + "2) \345\275\242\345\256\271\345\213\225\350\251\236 " + "keiy\305\215d\305\215shi, or na adjectives, which are followed by a form", + " of the copula, usually na. For example hen (strange)", + "", + " \345\244\211\343\201\252\343\201\262\343\201\250 hen na hito \"a " + "strange person\".", + "", + "3) \351\200\243\344\275\223\350\251\236 rentaishi, also called true " + "adjectives, such as ano \"that\"", + "", + " \343\201\202\343\201\256\345\261\261 ano yama \"that mountain\".", + ""}; -static const char *plasma[] = - {"-- Description: Proteins, Pools, & Slaw --", "", - "This text describes initial libPlasma components used for exchange of", - "data within and between computing processes.", "", - "A \"process,\" in our usage, means a computer program executing for a", - "period of time. This execution may be interrupted by pauses or", - "transfers between processors or machines, so that a process is", - "possibly suspended indefinitely and \"serialized\" or \"marshaled\" to", - "disk, across a memory bus, or over a network.", "", - "The present work's context is a new programming environment that", - "permits (indeed: encourages) large scale multi-process", - "interoperation. Existing programming environments do not fully support", - "multi-cpu and cross-network execution, or flexible sharing of data", - "between large numbers of computing processes.", "", - "In pursuit of this goal we have designed and implemented several", - "constructs that together enable", "", - " - Efficient exchange of data between large numbers of processes", - " - Flexible data \"typing\" and structure, so that widely varying kinds", - " and uses of data are supported", - " - Flexible mechanisms for data exchange (local memory, disk,", - " network, etc.), all driven by substantially similar APIs.", - " - Data exchange between processes written in different programming", - " languages", - " - Automatic maintenance of data caching and aggregate state", "", - "The principal constructs include slawx (plural of \"slaw\"), a mechanism", - "for efficient, platform-independent data representation and access;", - "proteins, a data encapsulation and transport scheme (whose payload is", - "generally and ideally slawx); and pools, which provide structured yet", - "flexible aggregation, ordering, filtering, and distribution of", - "proteins -- within a process, among local processes, across a network", - "between remote or distributed processes, and via 'longer term'", - "(e.g. on-disk) storage.", "", "", "- Proteins -", "", - "The \"protein\" is a new mechanism for encapsulating data that needs to", - "be shared between processes (or moved across a bus or network).", "", - "A protein is a structured record format and an associated set of", - "methods for manipulating records (putting data in, taking data out,", - "querying the format and existence of data). Proteins are designed to", - "be used via code written in a variety of computer languages; to be the", - "basic building block for \"pools\", described below; and to be natively", - "able to move between processors and across networks while maintaining", - "intact the data they contain.", "", - "One immediate -- and important -- use of proteins is as an improved", - "mechanism for transport and manipulation of user interface \"events.\"", - "Today's mainstream, user-facing computing platforms (OS X, Microsoft", - "Windows, X Windows) provide facilities for transmitting user interface", - "event data between processes. But these existing mechanisms all suffer", - "from several major design shortcomings that make it difficult to build", - "multi-process and multi-machine applications, and that force users", - "working in more than one programming language to jump through", - "frustrating hoops. Existing event frameworks are", "", - " - strongly typed, which makes them inflexible, privileges the", - " assumptions of the systems vendor over the application programmer,", - " and forms a mis-match with the facilities of increasingly popular", - " dynamic languages (such as Ruby, Python and Perl)", - " - point-to-point, which makes coordinating the activity of more than", - " a few distinct processes difficult or impossible", - " - strongly dependent on particular local, in-memory data structures,", - " which renders them unsuited for on-disk storage or transmission", - " across a network", "", - "In contrast, proteins are untyped (but provide a powerful and flexible", - "pattern-matching facility, on top of which \"type-like\" functionality", - "is implemented); are inherently multi-point (although point-to-point", - "forms are easily implemented as a subset of multi-point transmission);", - "and define a \"universal\" record format that does not differ (or", - "differs only in the types of optional optimizations that are", - "performed) between in-memory, on-disk, and on-the-wire (network)", - "formats.", "", - "A protein is a linear sequence of bytes. Within these bytes are", - "encapsulated a \"descrips\" list -- an arbitrarily elaborate but", - "efficiently filterable per-protein description -- and a set of", - "key-value pairs called \"ingests\" -- the actual \"contents\" of the", - "protein.", "", - "A minimal (and read-only) protein implementation might define the", - "following behaviors in one or more programming languages:", "", - " - query the length in bytes of a protein", - " - query the number of descrips entries", " - query the number of ingests", - " - retrieve a descrip entry by index number", - " - retrieve an ingest by index number", "", - "In addition, most implementations also define basic methods allowing", - "proteins to be constructed and filled with data, helper-methods that", - "make common tasks easier for programmers, and hooks for creating", - "optimizations:", "", " - create a new protein", - " - append a series of descrips entries", " - append an ingest", - " - query the presence of a matching descrip", - " - query the presence of a matching ingest key", - " - retrieve an ingest value given a key", - " - pattern match across descrips", " - delete one or more descrips", - " - delete one or more ingests", - " - embed non-structured metadata near the beginning of a protein", "", - "Proteins' concern with key-value pairs, as well as some core ideas", - "about network-friendly and multi-point data interchange, are shared", - "with earlier systems that privilege the concept of \"tuples\" (examples", - "include Linda and Jini). Proteins differ from tuple-oriented systems", - "in several major ways, including the use of the descrips list to", - "provide a standard, optimizable pattern matching substrate; and the", - "rigorous specification of a record format appropriate for a variety of", - "storage and language constructs (along with several particular", - "implementations of \"interfaces\" to that record format).", "", - "Following is a somewhat detailed account of proteins' present", - "specification. Note that the specification is still subject to", - "occasional adjustments and improvements; the account is presented here", - "merely by way of illustrating the system's character.", "", - "The first four or eight bytes of a protein specify the protein's", - "length, which must be a multiple of 16 bytes. This 16-byte", - "granularity ensures that byte- and bus-alignment efficiencies are", - "achievable on contemporary hardware. A protein that is not naturally", - "\"quad-word aligned\" must be padded with arbritrary bytes so that its", - "length is a multiple of 16 bytes.", "", - "The length portion of a protein has the following format: 32 bits", - "specifying length, in big-endian format, with the four lowest-order", - "bits serving as flags to indicate macro-level protein structure", - "characteristics; followed by 32 further bits if the protein's length", - "is greater than 2^32 bytes.", "", - "The 16-byte-alignment proviso means that the lowest order bits of the", - "first four bytes are available as flags. And so the first three", - "low-order bit flags indicate whether the protein's length can be", - "expressed in the first four bytes or requires eight; whether the", - "protein uses big-endian or little-endian byte ordering; and whether", - "the protein employs standard or non-standard structure. The fourth", - "flag bit is reserved for future use.", "", - "If the eight-byte length flag bit is set, the length of the protein is", - "calculated by reading the next four bytes and using them as the", - "high-order bytes of a big-endian, eight-byte integer (with the four", - "bytes already read supplying the low-order portion).", "", - "If the little-endian flag is set, all binary numerical data in the", - "protein is to be interpreted as little-endian (otherwise,", - "big-endian). If the non-standard flag bit is set, the remainder of the", - "protein does not conform to the standard structure to be described", - "below.", "", - "We will not further discuss non-standard protein structures, except to", - "say that there are various methods for describing and synchronizing on", - "non-standard protein formats available to a systems programmer using", - "proteins and pools, and that these methods can be useful when space or", - "compute cycles are constrained. For example, the shortest protein is", - "-- by definition -- sixteen bytes. A standard-format protein cannot", - "fit any actual payload data into those sixteen bytes (the lion's share", - "of which is already relegated to describing the location of the", - "protein's component parts). But a non-standard format protein could", - "conceivably use 12 of its 16 bytes for data. And two applications", - "exchanging proteins could mutually decide that any 16-byte-long", - "proteins that they emit always contain 12 bytes representing, for", - "example, 12 8-bit sensor values from a real-time analog-to-digital", - "convertor.", "", - "The remainder of this section describes a standard protein's layout.", "", - "Immediately following the length header, two more variable-length", - "integer numbers appear. These numbers specify offsets to,", - "respectively, the first element in the descrips list and the first", - "key-value pair. The byte order of each quad of these numbers is", - "specified by the protein's endianness flag bit. For each, the most", - "significant bit of the first four bytes determines whether the number", - "is four or eight bytes wide. If the msb is set, the first four bytes", - "are the most significant bytes of a double-word (eight byte)", - "number. We will refer to this as \"offset form\".", "", - "The presence of these two offsets at the beginning of a protein allows", - "for several useful optimizations.", "", - "Most proteins will not be so large as to require eight-byte lengths or", - "pointers, so in general the length (with flags) and two offset numbers", - "will occupy only the first three bytes of a protein. " - "On many hardware", - "architectures, a fetch or read of a certain number of bytes beyond the", - "first is \"free\" (16 bytes, for example, take exactly the same number", - "of clock cycles to pull across the Cell processor's main bus as a", - "single byte).", "", - "In many instances it is useful to allow implementation- or", - "context-specific caching or metadata inside a protein. The use of", - "offsets allows for a flexibly-sized \"hole\" to be created near the", - "beginning of the protein, into which such metadata may be slotted. An", - "implementation that can make use of eight bytes of metadata gets those", - "bytes for free on many architectures with every fetch of the length", - "header for a protein.", "", - "Use of separate offsets pointing to descrips and pairs allows descrips", - "and pairs to be handled by different code paths, making possible", - "particular optimizations relating to, for example, descrips", - "pattern-matching and protein assembly.", "", - "The descrips offset specifies the number of bytes between the", - "beginning of the protein and the first descrip entry. Each descrip", - "entry consists of an offset (in offset form, of course) to the next", - "descrip entry, followed by a variable-width length field (again in", - "offset format), followed by a \"slaw\" (discussed separately, below). If", - "there are no further descrips, the offset is, by rule, four bytes of", - "zeros. Otherwise, the offset specifies the number of bytes between the", - "beginning of this descrip entry and the next one. The length field", - "specifies the length of the slaw, in bytes.", "", - "In most proteins, each descrip is a string, formatted in the slaw", - "string fashion: a four-byte length/type header with the most", - "significant bit set and only the lower 30 bits used to specify length,", - "followed by the header's indicated number of data bytes. As usual, the", - "length header takes its endianness from the protein. Bytes are assumed", - "to encode UTF-8 characters (and thus -- nota bene -- the number of", - "characters is not necessarily the same as the number of bytes).", "", - "The duplication of length data in both the protein descrip entry", - "length field and the slaw string header is a candidate for", - "optimization.", "", - "The ingests offset specifies the number of bytes between the beginning", - "of the protein and the first ingest entry. Each ingest entry consists", - "of an offset (in offset form) to the next ingest entry, followed again", - "by a length field and a slaw. The ingest offset is functionally", - "identical to the descrip offset, except that it points to the next", - "ingest entry rather than to the next descrip entry.", "", - "In most proteins, every ingest is of the slaw cons type (a two-value", - "list, generally used as a key/value pair). The slaw cons record", - "consists of a four-byte length/type header with the second most", - "significant bit set and only the lower 30 bits used to specify length;", - "a four-byte offset to the start of the value (second) element; the", - "four-byte length of the key element; the slaw record for the key", - "element; the four-byte length of the value element; and finally the", - "slaw record for the value element.", "", - "Generally, the cons key is a slaw string. The duplication of data", - "across the several protein and slaw cons length and offsets field", - "provides yet more opportunity for refinement and optimization.", "", "", - "- Slawx -", "", - "The construct used to embed typed data inside proteins, as described", - "above, is a tagged byte-sequence specification and abstraction called", - "a \"slaw.\" (Plural: slawx.)", "", - "A slaw is a linear sequence of bytes representing a piece of (possibly", - "aggregate) typed data, and is associated with", - "programming-language-specific APIs that allow slawx to be created,", - "modified and moved around between memory spaces, storage media, and", - "machines. The slaw type scheme is intended to be extensible and as", - "lightweight as possible, and to be a common substrate that can be", - "used from any programming language.", "", - "The desire to build an efficient, large-scale inter-process", - "communication mechanism is the driver of the slaw design. Modern", - "programming languages provide sophisticated data structures and type", - "facilities that work beautifully in process-specific memory layouts,", - "but these data representations invariably break down when data needs", - "to be moved between processes or stored on disk. The slaw architecture", - "is, first, a substantially efficient, multi-platform friendly,", - "low-level data model for inter-process communication.", "", - "But even more importantly, slawx are designed to influence -- together", - "with proteins -- the development of future computing hardware", - "(microprocessors, memory controllers, disk controllers). A few", - "specific additions to, say, the instruction sets of commonly available", - "microprocessors would make it possible for slawx to become as", - "efficient even for single-process, in-memory data layout as the schema", - "used in most programming languages.", "", - "Every slaw consists of a variable-length type header followed by a", - "type-specific data layout. In the current implementation, which", - "supports full slaw functionality in C, C++ and Ruby, types are", - "indicated by a universal integer defined in system header files", - "accessible from each language. More sophisticated and flexible type", - "resolution functionality is anticipated: for example, indirect typing", - "via universal object IDs and network lookup.", "", - "Basic slaw functionality includes API facilities to", "", - " - create a new slaw of a specific type", - " - \"create\" (build a language-specific reference to) a slaw from", - " bytes on disk or in memory", - " - embed data within a slaw in type-specific fashion", - " - retrieve data from within a slaw", " - clone (shallow-copy) a slaw", - " - copy (deep-copy) a slaw", - " - translate the endianness of all data within a slaw", "", - "Every species of slaw is required to implement the above behaviors.", "", - "Our slaw implementation allows slaw records to be used as objects in", - "language-friendly fashion from both Ruby and C++. A suite of utilities", - "external to the C++ compiler sanity-check slaw byte layout, create", - "header files and macros specific to individual slaw types, and", - "auto-generate bindings for Ruby. As a result, well-designed slaw types", - "are quite efficient even when used from within a single process. Any", - "slaw anywhere in a process's accessible memory can be addressed", - "without a copy or \"deserialization\" step.", "", "", "- Pools -", "", - "A \"pool\" is a repository for proteins, providing linear sequencing and", - "state caching; multi-process access; and a set of common, optimizable", - "filtering and pattern-matching behaviors.", "", - "Slawx provide the lowest-level of data definition for inter-process", - "exchange; proteins provide mid-level structure and hooks for querying", - "and filtering; and pools provide for high-level organization and", - "access semantics.", "", - "The pools API is designed to allow pools to be implemented in a", - "variety of ways, in order to account both for system-specific goals", - "and for the available capabilities of given hardware and network", - "architectures. The two fundamental system provisions upon which pools", - "depend are a storage facility and a means of inter-process", - "communication. In our extant systems we use a flexible combination of", - "shared memory, virtual memory, and disk for the former, and IPC queues", - "and TCP/IP sockets for the latter.", "", - "The most basic pool functionality is as follows:", "", - " - \"participate in\" a pool", " - put a protein in a pool", - " - retrieve the next unseen protein from a pool", - " - \"rewind\" or \"fast-forward\" within a pool", "", - "A very simple pool implementation might provide only those four", - "methods. However, most real-world pools would also support (and", - "encourage):", "", - " - setting up a \"streaming\" pool call-back for a process", - " - selectively retrieving proteins that match particular patterns of", - " descrips or ingests keys", - " - scanning backward and forwards for proteins that match particular", - " patterns of descrips or ingests keys", "", - "Critical to the design of the pools architecture is the conception of", - "pools as maintaining state, so that individual processes can offload", - "much of the tedious bookkeeping common to multi-process program", - "code. A pool attempts to keep a large buffer of past proteins", - "available -- the Platonic pool is explicitly infinite -- so that", - "participating processes can scan both backwards and forwards in a pool", - "at will. The size of the buffer is implentation dependent, of course,", - "but in common usage it is often possible to keep proteins in a pool", - "for hours or days.", "", - "With so much data available to potentially legion pool participants,", - "pool behavior optimization becomes important. We have implemented a", - "number of optimized caching and storage schemes that make it possible", - "to accomodate tens of thousands of proteins in a pool and, and we use", - "careful connection pooling on the unix operating system to handle", - "hundreds of concurrent connections with relatively low overhead. As", - "with slawx, we expect eventually to implement many of these algorithms", - "in hardware, leading to further efficiency and scalability.", "", - "The most common \"style\" of pool usage in our programs hews to a", - "biological metaphor, in contrast to the mechanistic, point-to-point", - "approach taken by existing inter-process communication frameworks. The", - "name \"protein\" alludes to bilological inspiration: data proteins in", - "pools are available for flexible querying and pattern matching by a", - "large number of computational processes, as chemical proteins in a", - "living organism are available for pattern matching and filtering by", - "large numbers of cellular agents.", "", - "Two additional abstractions (currently implemented in both", - "C++ and Ruby) lean on the biological metaphor.", "", - "A process that participates in a pool generally creates a number of", - "\"handlers,\" small bundles of code that associate \"match conditions\"", - "with \"handle behaviors.\" By tying one or more handlers to a pool, a", - "process sets up flexible call-back triggers that are trivially able to", - "encapsulate state and react to new proteins.", "", - "A process that participates in several pools generally inherits from", - "an abstract \"Golgi\" class. The Golgi framework provides a number of", - "useful routines for managing multiple pools and handlers. The Golgi", - "class also encapsualates parent-child relationships, providing a", - "mechanism for \"local\" protein exchange that does not use a", "pool.", ""}; +static const char *plasma[] = { + "-- Description: Proteins, Pools, & Slaw --", + "", + "This text describes initial libPlasma components used for exchange of", + "data within and between computing processes.", + "", + "A \"process,\" in our usage, means a computer program executing for a", + "period of time. This execution may be interrupted by pauses or", + "transfers between processors or machines, so that a process is", + "possibly suspended indefinitely and \"serialized\" or \"marshaled\" to", + "disk, across a memory bus, or over a network.", + "", + "The present work's context is a new programming environment that", + "permits (indeed: encourages) large scale multi-process", + "interoperation. Existing programming environments do not fully support", + "multi-cpu and cross-network execution, or flexible sharing of data", + "between large numbers of computing processes.", + "", + "In pursuit of this goal we have designed and implemented several", + "constructs that together enable", + "", + " - Efficient exchange of data between large numbers of processes", + " - Flexible data \"typing\" and structure, so that widely varying kinds", + " and uses of data are supported", + " - Flexible mechanisms for data exchange (local memory, disk,", + " network, etc.), all driven by substantially similar APIs.", + " - Data exchange between processes written in different programming", + " languages", + " - Automatic maintenance of data caching and aggregate state", + "", + "The principal constructs include slawx (plural of \"slaw\"), a mechanism", + "for efficient, platform-independent data representation and access;", + "proteins, a data encapsulation and transport scheme (whose payload is", + "generally and ideally slawx); and pools, which provide structured yet", + "flexible aggregation, ordering, filtering, and distribution of", + "proteins -- within a process, among local processes, across a network", + "between remote or distributed processes, and via 'longer term'", + "(e.g. on-disk) storage.", + "", + "", + "- Proteins -", + "", + "The \"protein\" is a new mechanism for encapsulating data that needs to", + "be shared between processes (or moved across a bus or network).", + "", + "A protein is a structured record format and an associated set of", + "methods for manipulating records (putting data in, taking data out,", + "querying the format and existence of data). Proteins are designed to", + "be used via code written in a variety of computer languages; to be the", + "basic building block for \"pools\", described below; and to be natively", + "able to move between processors and across networks while maintaining", + "intact the data they contain.", + "", + "One immediate -- and important -- use of proteins is as an improved", + "mechanism for transport and manipulation of user interface \"events.\"", + "Today's mainstream, user-facing computing platforms (OS X, Microsoft", + "Windows, X Windows) provide facilities for transmitting user interface", + "event data between processes. But these existing mechanisms all suffer", + "from several major design shortcomings that make it difficult to build", + "multi-process and multi-machine applications, and that force users", + "working in more than one programming language to jump through", + "frustrating hoops. Existing event frameworks are", + "", + " - strongly typed, which makes them inflexible, privileges the", + " assumptions of the systems vendor over the application programmer,", + " and forms a mis-match with the facilities of increasingly popular", + " dynamic languages (such as Ruby, Python and Perl)", + " - point-to-point, which makes coordinating the activity of more than", + " a few distinct processes difficult or impossible", + " - strongly dependent on particular local, in-memory data structures,", + " which renders them unsuited for on-disk storage or transmission", + " across a network", + "", + "In contrast, proteins are untyped (but provide a powerful and flexible", + "pattern-matching facility, on top of which \"type-like\" functionality", + "is implemented); are inherently multi-point (although point-to-point", + "forms are easily implemented as a subset of multi-point transmission);", + "and define a \"universal\" record format that does not differ (or", + "differs only in the types of optional optimizations that are", + "performed) between in-memory, on-disk, and on-the-wire (network)", + "formats.", + "", + "A protein is a linear sequence of bytes. Within these bytes are", + "encapsulated a \"descrips\" list -- an arbitrarily elaborate but", + "efficiently filterable per-protein description -- and a set of", + "key-value pairs called \"ingests\" -- the actual \"contents\" of the", + "protein.", + "", + "A minimal (and read-only) protein implementation might define the", + "following behaviors in one or more programming languages:", + "", + " - query the length in bytes of a protein", + " - query the number of descrips entries", + " - query the number of ingests", + " - retrieve a descrip entry by index number", + " - retrieve an ingest by index number", + "", + "In addition, most implementations also define basic methods allowing", + "proteins to be constructed and filled with data, helper-methods that", + "make common tasks easier for programmers, and hooks for creating", + "optimizations:", + "", + " - create a new protein", + " - append a series of descrips entries", + " - append an ingest", + " - query the presence of a matching descrip", + " - query the presence of a matching ingest key", + " - retrieve an ingest value given a key", + " - pattern match across descrips", + " - delete one or more descrips", + " - delete one or more ingests", + " - embed non-structured metadata near the beginning of a protein", + "", + "Proteins' concern with key-value pairs, as well as some core ideas", + "about network-friendly and multi-point data interchange, are shared", + "with earlier systems that privilege the concept of \"tuples\" (examples", + "include Linda and Jini). Proteins differ from tuple-oriented systems", + "in several major ways, including the use of the descrips list to", + "provide a standard, optimizable pattern matching substrate; and the", + "rigorous specification of a record format appropriate for a variety of", + "storage and language constructs (along with several particular", + "implementations of \"interfaces\" to that record format).", + "", + "Following is a somewhat detailed account of proteins' present", + "specification. Note that the specification is still subject to", + "occasional adjustments and improvements; the account is presented here", + "merely by way of illustrating the system's character.", + "", + "The first four or eight bytes of a protein specify the protein's", + "length, which must be a multiple of 16 bytes. This 16-byte", + "granularity ensures that byte- and bus-alignment efficiencies are", + "achievable on contemporary hardware. A protein that is not naturally", + "\"quad-word aligned\" must be padded with arbritrary bytes so that its", + "length is a multiple of 16 bytes.", + "", + "The length portion of a protein has the following format: 32 bits", + "specifying length, in big-endian format, with the four lowest-order", + "bits serving as flags to indicate macro-level protein structure", + "characteristics; followed by 32 further bits if the protein's length", + "is greater than 2^32 bytes.", + "", + "The 16-byte-alignment proviso means that the lowest order bits of the", + "first four bytes are available as flags. And so the first three", + "low-order bit flags indicate whether the protein's length can be", + "expressed in the first four bytes or requires eight; whether the", + "protein uses big-endian or little-endian byte ordering; and whether", + "the protein employs standard or non-standard structure. The fourth", + "flag bit is reserved for future use.", + "", + "If the eight-byte length flag bit is set, the length of the protein is", + "calculated by reading the next four bytes and using them as the", + "high-order bytes of a big-endian, eight-byte integer (with the four", + "bytes already read supplying the low-order portion).", + "", + "If the little-endian flag is set, all binary numerical data in the", + "protein is to be interpreted as little-endian (otherwise,", + "big-endian). If the non-standard flag bit is set, the remainder of the", + "protein does not conform to the standard structure to be described", + "below.", + "", + "We will not further discuss non-standard protein structures, except to", + "say that there are various methods for describing and synchronizing on", + "non-standard protein formats available to a systems programmer using", + "proteins and pools, and that these methods can be useful when space or", + "compute cycles are constrained. For example, the shortest protein is", + "-- by definition -- sixteen bytes. A standard-format protein cannot", + "fit any actual payload data into those sixteen bytes (the lion's share", + "of which is already relegated to describing the location of the", + "protein's component parts). But a non-standard format protein could", + "conceivably use 12 of its 16 bytes for data. And two applications", + "exchanging proteins could mutually decide that any 16-byte-long", + "proteins that they emit always contain 12 bytes representing, for", + "example, 12 8-bit sensor values from a real-time analog-to-digital", + "convertor.", + "", + "The remainder of this section describes a standard protein's layout.", + "", + "Immediately following the length header, two more variable-length", + "integer numbers appear. These numbers specify offsets to,", + "respectively, the first element in the descrips list and the first", + "key-value pair. The byte order of each quad of these numbers is", + "specified by the protein's endianness flag bit. For each, the most", + "significant bit of the first four bytes determines whether the number", + "is four or eight bytes wide. If the msb is set, the first four bytes", + "are the most significant bytes of a double-word (eight byte)", + "number. We will refer to this as \"offset form\".", + "", + "The presence of these two offsets at the beginning of a protein allows", + "for several useful optimizations.", + "", + "Most proteins will not be so large as to require eight-byte lengths or", + "pointers, so in general the length (with flags) and two offset numbers", + "will occupy only the first three bytes of a protein. " + "On many hardware", + "architectures, a fetch or read of a certain number of bytes beyond the", + "first is \"free\" (16 bytes, for example, take exactly the same number", + "of clock cycles to pull across the Cell processor's main bus as a", + "single byte).", + "", + "In many instances it is useful to allow implementation- or", + "context-specific caching or metadata inside a protein. The use of", + "offsets allows for a flexibly-sized \"hole\" to be created near the", + "beginning of the protein, into which such metadata may be slotted. An", + "implementation that can make use of eight bytes of metadata gets those", + "bytes for free on many architectures with every fetch of the length", + "header for a protein.", + "", + "Use of separate offsets pointing to descrips and pairs allows descrips", + "and pairs to be handled by different code paths, making possible", + "particular optimizations relating to, for example, descrips", + "pattern-matching and protein assembly.", + "", + "The descrips offset specifies the number of bytes between the", + "beginning of the protein and the first descrip entry. Each descrip", + "entry consists of an offset (in offset form, of course) to the next", + "descrip entry, followed by a variable-width length field (again in", + "offset format), followed by a \"slaw\" (discussed separately, below). If", + "there are no further descrips, the offset is, by rule, four bytes of", + "zeros. Otherwise, the offset specifies the number of bytes between the", + "beginning of this descrip entry and the next one. The length field", + "specifies the length of the slaw, in bytes.", + "", + "In most proteins, each descrip is a string, formatted in the slaw", + "string fashion: a four-byte length/type header with the most", + "significant bit set and only the lower 30 bits used to specify length,", + "followed by the header's indicated number of data bytes. As usual, the", + "length header takes its endianness from the protein. Bytes are assumed", + "to encode UTF-8 characters (and thus -- nota bene -- the number of", + "characters is not necessarily the same as the number of bytes).", + "", + "The duplication of length data in both the protein descrip entry", + "length field and the slaw string header is a candidate for", + "optimization.", + "", + "The ingests offset specifies the number of bytes between the beginning", + "of the protein and the first ingest entry. Each ingest entry consists", + "of an offset (in offset form) to the next ingest entry, followed again", + "by a length field and a slaw. The ingest offset is functionally", + "identical to the descrip offset, except that it points to the next", + "ingest entry rather than to the next descrip entry.", + "", + "In most proteins, every ingest is of the slaw cons type (a two-value", + "list, generally used as a key/value pair). The slaw cons record", + "consists of a four-byte length/type header with the second most", + "significant bit set and only the lower 30 bits used to specify length;", + "a four-byte offset to the start of the value (second) element; the", + "four-byte length of the key element; the slaw record for the key", + "element; the four-byte length of the value element; and finally the", + "slaw record for the value element.", + "", + "Generally, the cons key is a slaw string. The duplication of data", + "across the several protein and slaw cons length and offsets field", + "provides yet more opportunity for refinement and optimization.", + "", + "", + "- Slawx -", + "", + "The construct used to embed typed data inside proteins, as described", + "above, is a tagged byte-sequence specification and abstraction called", + "a \"slaw.\" (Plural: slawx.)", + "", + "A slaw is a linear sequence of bytes representing a piece of (possibly", + "aggregate) typed data, and is associated with", + "programming-language-specific APIs that allow slawx to be created,", + "modified and moved around between memory spaces, storage media, and", + "machines. The slaw type scheme is intended to be extensible and as", + "lightweight as possible, and to be a common substrate that can be", + "used from any programming language.", + "", + "The desire to build an efficient, large-scale inter-process", + "communication mechanism is the driver of the slaw design. Modern", + "programming languages provide sophisticated data structures and type", + "facilities that work beautifully in process-specific memory layouts,", + "but these data representations invariably break down when data needs", + "to be moved between processes or stored on disk. The slaw architecture", + "is, first, a substantially efficient, multi-platform friendly,", + "low-level data model for inter-process communication.", + "", + "But even more importantly, slawx are designed to influence -- together", + "with proteins -- the development of future computing hardware", + "(microprocessors, memory controllers, disk controllers). A few", + "specific additions to, say, the instruction sets of commonly available", + "microprocessors would make it possible for slawx to become as", + "efficient even for single-process, in-memory data layout as the schema", + "used in most programming languages.", + "", + "Every slaw consists of a variable-length type header followed by a", + "type-specific data layout. In the current implementation, which", + "supports full slaw functionality in C, C++ and Ruby, types are", + "indicated by a universal integer defined in system header files", + "accessible from each language. More sophisticated and flexible type", + "resolution functionality is anticipated: for example, indirect typing", + "via universal object IDs and network lookup.", + "", + "Basic slaw functionality includes API facilities to", + "", + " - create a new slaw of a specific type", + " - \"create\" (build a language-specific reference to) a slaw from", + " bytes on disk or in memory", + " - embed data within a slaw in type-specific fashion", + " - retrieve data from within a slaw", + " - clone (shallow-copy) a slaw", + " - copy (deep-copy) a slaw", + " - translate the endianness of all data within a slaw", + "", + "Every species of slaw is required to implement the above behaviors.", + "", + "Our slaw implementation allows slaw records to be used as objects in", + "language-friendly fashion from both Ruby and C++. A suite of utilities", + "external to the C++ compiler sanity-check slaw byte layout, create", + "header files and macros specific to individual slaw types, and", + "auto-generate bindings for Ruby. As a result, well-designed slaw types", + "are quite efficient even when used from within a single process. Any", + "slaw anywhere in a process's accessible memory can be addressed", + "without a copy or \"deserialization\" step.", + "", + "", + "- Pools -", + "", + "A \"pool\" is a repository for proteins, providing linear sequencing and", + "state caching; multi-process access; and a set of common, optimizable", + "filtering and pattern-matching behaviors.", + "", + "Slawx provide the lowest-level of data definition for inter-process", + "exchange; proteins provide mid-level structure and hooks for querying", + "and filtering; and pools provide for high-level organization and", + "access semantics.", + "", + "The pools API is designed to allow pools to be implemented in a", + "variety of ways, in order to account both for system-specific goals", + "and for the available capabilities of given hardware and network", + "architectures. The two fundamental system provisions upon which pools", + "depend are a storage facility and a means of inter-process", + "communication. In our extant systems we use a flexible combination of", + "shared memory, virtual memory, and disk for the former, and IPC queues", + "and TCP/IP sockets for the latter.", + "", + "The most basic pool functionality is as follows:", + "", + " - \"participate in\" a pool", + " - put a protein in a pool", + " - retrieve the next unseen protein from a pool", + " - \"rewind\" or \"fast-forward\" within a pool", + "", + "A very simple pool implementation might provide only those four", + "methods. However, most real-world pools would also support (and", + "encourage):", + "", + " - setting up a \"streaming\" pool call-back for a process", + " - selectively retrieving proteins that match particular patterns of", + " descrips or ingests keys", + " - scanning backward and forwards for proteins that match particular", + " patterns of descrips or ingests keys", + "", + "Critical to the design of the pools architecture is the conception of", + "pools as maintaining state, so that individual processes can offload", + "much of the tedious bookkeeping common to multi-process program", + "code. A pool attempts to keep a large buffer of past proteins", + "available -- the Platonic pool is explicitly infinite -- so that", + "participating processes can scan both backwards and forwards in a pool", + "at will. The size of the buffer is implentation dependent, of course,", + "but in common usage it is often possible to keep proteins in a pool", + "for hours or days.", + "", + "With so much data available to potentially legion pool participants,", + "pool behavior optimization becomes important. We have implemented a", + "number of optimized caching and storage schemes that make it possible", + "to accomodate tens of thousands of proteins in a pool and, and we use", + "careful connection pooling on the unix operating system to handle", + "hundreds of concurrent connections with relatively low overhead. As", + "with slawx, we expect eventually to implement many of these algorithms", + "in hardware, leading to further efficiency and scalability.", + "", + "The most common \"style\" of pool usage in our programs hews to a", + "biological metaphor, in contrast to the mechanistic, point-to-point", + "approach taken by existing inter-process communication frameworks. The", + "name \"protein\" alludes to bilological inspiration: data proteins in", + "pools are available for flexible querying and pattern matching by a", + "large number of computational processes, as chemical proteins in a", + "living organism are available for pattern matching and filtering by", + "large numbers of cellular agents.", + "", + "Two additional abstractions (currently implemented in both", + "C++ and Ruby) lean on the biological metaphor.", + "", + "A process that participates in a pool generally creates a number of", + "\"handlers,\" small bundles of code that associate \"match conditions\"", + "with \"handle behaviors.\" By tying one or more handlers to a pool, a", + "process sets up flexible call-back triggers that are trivially able to", + "encapsulate state and react to new proteins.", + "", + "A process that participates in several pools generally inherits from", + "an abstract \"Golgi\" class. The Golgi framework provides a number of", + "useful routines for managing multiple pools and handlers. The Golgi", + "class also encapsualates parent-child relationships, providing a", + "mechanism for \"local\" protein exchange that does not use a", + "pool.", + ""}; -static const byte bz2_data[] = - {0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x58, 0x1f, 0x5a, - 0x35, 0x00, 0x00, 0x4f, 0xff, 0x80, 0x7f, 0xfe, 0xc2, 0x00, 0x40, 0xf7, 0x7f, - 0xd8, 0x10, 0x02, 0x08, 0x00, 0x3f, 0xff, 0xff, 0xf0, 0x50, 0x03, 0xb8, 0x33, - 0x3d, 0x77, 0x5d, 0x57, 0x4e, 0xb6, 0xb0, 0x34, 0xd2, 0x13, 0x4c, 0x29, 0x9a, - 0x46, 0x93, 0x4d, 0xa8, 0xf5, 0x06, 0x80, 0x06, 0x83, 0x43, 0x40, 0x00, 0xd0, - 0x99, 0x04, 0xc8, 0x05, 0x32, 0x1a, 0x68, 0x06, 0x80, 0x1a, 0x68, 0x01, 0xa6, - 0x40, 0x24, 0x44, 0x4d, 0x29, 0xe9, 0x31, 0x3d, 0x32, 0x21, 0x32, 0x34, 0xd0, - 0x0d, 0x06, 0x26, 0x83, 0x35, 0x1a, 0x68, 0x1c, 0xc0, 0x26, 0x00, 0x4c, 0x00, - 0x02, 0x60, 0x00, 0x26, 0x00, 0x02, 0x53, 0x4a, 0x34, 0xa7, 0xa0, 0x4f, 0x4d, - 0x41, 0xb4, 0x43, 0x43, 0x04, 0x62, 0x1e, 0x80, 0x98, 0x4c, 0x09, 0xdf, 0xe5, - 0x97, 0x32, 0x4b, 0x56, 0xf8, 0x0a, 0xd5, 0x43, 0x1d, 0x66, 0x54, 0x94, 0xa4, - 0x92, 0x88, 0x83, 0xf2, 0xea, 0xc6, 0xd0, 0x9b, 0x1d, 0x00, 0x88, 0x02, 0x61, - 0x24, 0xa8, 0x92, 0xb9, 0x72, 0xf0, 0xf9, 0x5f, 0x0b, 0xa1, 0xc3, 0xf7, 0x95, - 0x82, 0x8e, 0xe0, 0xb7, 0xa2, 0x3b, 0x69, 0x15, 0xbe, 0x0e, 0xda, 0xc3, 0x75, - 0x63, 0x6d, 0x36, 0x0f, 0xc6, 0xd3, 0x2d, 0x36, 0x5e, 0x00, 0x2c, 0x04, 0x29, - 0x6d, 0x9d, 0xd7, 0xdb, 0xfb, 0x4b, 0x8b, 0x2d, 0x0d, 0x8c, 0x32, 0x0d, 0x7a, - 0x55, 0x69, 0xc5, 0x04, 0x01, 0x8e, 0x56, 0xce, 0xb7, 0x81, 0x72, 0x11, 0x48, - 0x80, 0x60, 0xe9, 0xb6, 0x05, 0x32, 0xc9, 0x66, 0x13, 0x69, 0xbb, 0x67, 0xf3, - 0x5e, 0x02, 0x08, 0x7f, 0x72, 0x33, 0x8e, 0x39, 0xa2, 0x72, 0xfc, 0x9c, 0xed, - 0x2e, 0xfd, 0xf7, 0x6e, 0xd1, 0x5e, 0xe8, 0xaa, 0xce, 0x1b, 0x11, 0xba, 0xec, - 0xf1, 0xd3, 0xa6, 0xf7, 0x86, 0x15, 0xb9, 0xd4, 0x3a, 0x5d, 0x3f, 0x74, 0x88, - 0x73, 0x43, 0x68, 0x3d, 0x76, 0xc7, 0x92, 0x97, 0x8f, 0x2c, 0x6e, 0xa3, 0xe9, - 0x23, 0xaa, 0x28, 0x24, 0x8d, 0x62, 0x82, 0xb8, 0xd0, 0xde, 0x99, 0x05, 0x74, - 0x9b, 0xef, 0x6d, 0x0e, 0x0b, 0x85, 0x11, 0xf8, 0x34, 0x8c, 0x50, 0xe4, 0x40, - 0xad, 0xd7, 0x5c, 0xe2, 0xa7, 0xf3, 0x7b, 0xe6, 0xe9, 0x08, 0x83, 0x7c, 0x43, - 0x26, 0x68, 0x32, 0xc5, 0xd9, 0xa1, 0x12, 0xc5, 0x21, 0xd7, 0x58, 0x56, 0x1a, - 0xaa, 0xd5, 0x11, 0x65, 0x4b, 0x05, 0xb9, 0x94, 0x01, 0x11, 0x26, 0xec, 0xe2, - 0x20, 0x36, 0x4f, 0x1c, 0xc3, 0xf3, 0x0d, 0x40, 0x7b, 0xc3, 0xd9, 0xf8, 0x09, - 0xde, 0xb8, 0xb2, 0xdd, 0x22, 0xd1, 0x84, 0xa0, 0x1d, 0x2a, 0x56, 0x4e, 0xe4, - 0x76, 0xd9, 0x8a, 0x05, 0x53, 0x1b, 0x0c, 0x13, 0xb0, 0x81, 0x81, 0x20, 0x60, - 0xfc, 0xfb, 0xcb, 0x4d, 0x2e, 0x1d, 0xd9, 0x51, 0xa4, 0xa8, 0x0f, 0x9d, 0x0d, - 0xe6, 0x40, 0x1b, 0x27, 0x8e, 0xb5, 0x0c, 0xd7, 0x58, 0xf0, 0x40, 0xeb, 0x36, - 0x09, 0x68, 0xf1, 0x29, 0x5e, 0xd0, 0x1e, 0xd6, 0x51, 0x90, 0xc9, 0x64, 0xda, - 0xea, 0x98, 0x54, 0x20, 0x5d, 0x50, 0x9d, 0x1b, 0x98, 0xae, 0xce, 0x52, 0x18, - 0x35, 0xca, 0x1e, 0xa2, 0x3c, 0x02, 0x02, 0xd2, 0x6f, 0x08, 0x85, 0xe0, 0xd7, - 0x3f, 0xb7, 0xd3, 0xd2, 0x3e, 0xa1, 0xca, 0x4e, 0x17, 0x74, 0xf3, 0xe8, 0x93, - 0x0d, 0x41, 0x54, 0x1f, 0x68, 0xd4, 0x9f, 0x83, 0x06, 0x7a, 0xf6, 0x6c, 0xee, - 0xd9, 0x89, 0x40, 0xc8, 0x7c, 0x81, 0x61, 0x1b, 0xab, 0x52, 0x1c, 0x6c, 0x8a, - 0xc0, 0x75, 0xbe, 0xc3, 0x8b, 0x8f, 0x76, 0xe5, 0x4e, 0xcb, 0x91, 0xda, 0xc3, - 0x58, 0xd9, 0x2b, 0xbc, 0x68, 0x6d, 0xb0, 0x93, 0x43, 0x46, 0x43, 0x83, 0xd0, - 0xe8, 0x1d, 0x39, 0x34, 0x18, 0x8c, 0x94, 0x2a, 0xa0, 0xf2, 0xae, 0x88, 0x9e, - 0x59, 0x67, 0x44, 0xd1, 0xc6, 0x74, 0xec, 0x24, 0x69, 0x0e, 0xb2, 0xca, 0xc4, - 0x8c, 0x65, 0xe5, 0x2d, 0xbc, 0xd5, 0x14, 0x58, 0xce, 0x0a, 0x78, 0x08, 0xde, - 0x83, 0x51, 0x8e, 0x3a, 0x95, 0xd4, 0xd7, 0xad, 0xa0, 0xd1, 0x39, 0xf4, 0x50, - 0x68, 0xc1, 0xac, 0x9d, 0xb0, 0xa9, 0x31, 0x24, 0xc5, 0x0f, 0x58, 0xad, 0x5d, - 0x5a, 0xf1, 0x17, 0x37, 0x78, 0xa8, 0x53, 0xa6, 0x41, 0x20, 0x40, 0x10, 0x9a, - 0x38, 0x52, 0x46, 0x4f, 0x9c, 0x1d, 0xcd, 0x9a, 0x50, 0xab, 0x54, 0x4a, 0xe3, - 0x0c, 0x5c, 0x1c, 0x18, 0x49, 0xc9, 0x7a, 0xb8, 0xcf, 0x02, 0x76, 0xdf, 0x00, - 0x2e, 0x29, 0x72, 0x64, 0xbd, 0x82, 0x6a, 0x90, 0x90, 0x0d, 0x20, 0xcd, 0xe8, - 0x16, 0xd7, 0xde, 0x03, 0x12, 0x45, 0xb3, 0x54, 0xbd, 0x06, 0x61, 0xf1, 0x16, - 0xc4, 0x8a, 0xe2, 0xae, 0x80, 0xa8, 0xde, 0x88, 0x05, 0xb2, 0xa7, 0x53, 0x2a, - 0x5d, 0x54, 0x5a, 0xd3, 0xb4, 0x6c, 0xac, 0x44, 0x83, 0x22, 0x88, 0x61, 0x1c, - 0x35, 0xd3, 0x2a, 0x8c, 0xb9, 0x11, 0x6b, 0x61, 0x68, 0xa2, 0xa3, 0xab, 0x76, - 0x6c, 0x2a, 0xc1, 0xb4, 0x7c, 0x5d, 0xf6, 0xc6, 0xbb, 0x77, 0x46, 0x2e, 0x3b, - 0x9d, 0x13, 0xbc, 0x36, 0x7a, 0x84, 0x91, 0xa1, 0x6a, 0x26, 0x55, 0x20, 0xcb, - 0x10, 0x60, 0x2b, 0x8a, 0x67, 0x37, 0x54, 0x59, 0x60, 0x72, 0x17, 0x48, 0x57, - 0x1c, 0xbd, 0x74, 0x5a, 0xe5, 0x1b, 0xc0, 0x25, 0xa4, 0xba, 0xda, 0x4b, 0x2d, - 0x25, 0x04, 0x0c, 0xc1, 0x43, 0xcd, 0x9b, 0x66, 0x49, 0x1b, 0x54, 0x43, 0x8c, - 0x5b, 0x6a, 0x36, 0xad, 0x39, 0xdc, 0x02, 0x5e, 0x8a, 0xa3, 0x33, 0x52, 0x20, - 0x68, 0x43, 0xb4, 0x8a, 0x2e, 0xb9, 0x3a, 0xb8, 0xe4, 0xd0, 0x52, 0xd2, 0x2c, - 0x6d, 0x1c, 0xa1, 0x60, 0xf8, 0x64, 0x6c, 0xfd, 0x4b, 0x2c, 0xd5, 0x03, 0x9a, - 0x94, 0xcd, 0x50, 0x6e, 0x19, 0x50, 0x66, 0x40, 0xac, 0xb3, 0x91, 0x87, 0x31, - 0x17, 0x01, 0xe2, 0x70, 0xe2, 0x79, 0x36, 0xef, 0x10, 0xa3, 0x2b, 0x44, 0x9a, - 0x2b, 0x57, 0xd0, 0x0a, 0x90, 0xdd, 0x89, 0x62, 0xa2, 0x99, 0x04, 0xfd, 0x29, - 0x64, 0xd4, 0x0a, 0x4f, 0x76, 0x4d, 0xa8, 0xe0, 0xaa, 0x16, 0x4d, 0x13, 0x0f, - 0x9c, 0x5c, 0xc1, 0x64, 0x83, 0x72, 0x28, 0x6a, 0xd9, 0x4f, 0xf4, 0xed, 0x59, - 0xdc, 0xba, 0x00, 0x66, 0x2e, 0x8f, 0x83, 0x2b, 0x1b, 0x84, 0x20, 0xf9, 0x31, - 0x36, 0x86, 0xeb, 0xb1, 0x42, 0x04, 0x12, 0xd0, 0xc6, 0xd9, 0x2d, 0x24, 0x94, - 0x24, 0x74, 0xb5, 0x29, 0xa6, 0x9a, 0x1a, 0x10, 0xb3, 0x5a, 0xb9, 0x30, 0x98, - 0x6f, 0xcc, 0x8c, 0xc2, 0xe3, 0xfe, 0x2e, 0xe4, 0x8a, 0x70, 0xa1, 0x20, 0xb0, - 0x3e, 0xb4, 0x6a}; +static const byte bz2_data[] = { + 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x58, 0x1f, 0x5a, + 0x35, 0x00, 0x00, 0x4f, 0xff, 0x80, 0x7f, 0xfe, 0xc2, 0x00, 0x40, 0xf7, 0x7f, + 0xd8, 0x10, 0x02, 0x08, 0x00, 0x3f, 0xff, 0xff, 0xf0, 0x50, 0x03, 0xb8, 0x33, + 0x3d, 0x77, 0x5d, 0x57, 0x4e, 0xb6, 0xb0, 0x34, 0xd2, 0x13, 0x4c, 0x29, 0x9a, + 0x46, 0x93, 0x4d, 0xa8, 0xf5, 0x06, 0x80, 0x06, 0x83, 0x43, 0x40, 0x00, 0xd0, + 0x99, 0x04, 0xc8, 0x05, 0x32, 0x1a, 0x68, 0x06, 0x80, 0x1a, 0x68, 0x01, 0xa6, + 0x40, 0x24, 0x44, 0x4d, 0x29, 0xe9, 0x31, 0x3d, 0x32, 0x21, 0x32, 0x34, 0xd0, + 0x0d, 0x06, 0x26, 0x83, 0x35, 0x1a, 0x68, 0x1c, 0xc0, 0x26, 0x00, 0x4c, 0x00, + 0x02, 0x60, 0x00, 0x26, 0x00, 0x02, 0x53, 0x4a, 0x34, 0xa7, 0xa0, 0x4f, 0x4d, + 0x41, 0xb4, 0x43, 0x43, 0x04, 0x62, 0x1e, 0x80, 0x98, 0x4c, 0x09, 0xdf, 0xe5, + 0x97, 0x32, 0x4b, 0x56, 0xf8, 0x0a, 0xd5, 0x43, 0x1d, 0x66, 0x54, 0x94, 0xa4, + 0x92, 0x88, 0x83, 0xf2, 0xea, 0xc6, 0xd0, 0x9b, 0x1d, 0x00, 0x88, 0x02, 0x61, + 0x24, 0xa8, 0x92, 0xb9, 0x72, 0xf0, 0xf9, 0x5f, 0x0b, 0xa1, 0xc3, 0xf7, 0x95, + 0x82, 0x8e, 0xe0, 0xb7, 0xa2, 0x3b, 0x69, 0x15, 0xbe, 0x0e, 0xda, 0xc3, 0x75, + 0x63, 0x6d, 0x36, 0x0f, 0xc6, 0xd3, 0x2d, 0x36, 0x5e, 0x00, 0x2c, 0x04, 0x29, + 0x6d, 0x9d, 0xd7, 0xdb, 0xfb, 0x4b, 0x8b, 0x2d, 0x0d, 0x8c, 0x32, 0x0d, 0x7a, + 0x55, 0x69, 0xc5, 0x04, 0x01, 0x8e, 0x56, 0xce, 0xb7, 0x81, 0x72, 0x11, 0x48, + 0x80, 0x60, 0xe9, 0xb6, 0x05, 0x32, 0xc9, 0x66, 0x13, 0x69, 0xbb, 0x67, 0xf3, + 0x5e, 0x02, 0x08, 0x7f, 0x72, 0x33, 0x8e, 0x39, 0xa2, 0x72, 0xfc, 0x9c, 0xed, + 0x2e, 0xfd, 0xf7, 0x6e, 0xd1, 0x5e, 0xe8, 0xaa, 0xce, 0x1b, 0x11, 0xba, 0xec, + 0xf1, 0xd3, 0xa6, 0xf7, 0x86, 0x15, 0xb9, 0xd4, 0x3a, 0x5d, 0x3f, 0x74, 0x88, + 0x73, 0x43, 0x68, 0x3d, 0x76, 0xc7, 0x92, 0x97, 0x8f, 0x2c, 0x6e, 0xa3, 0xe9, + 0x23, 0xaa, 0x28, 0x24, 0x8d, 0x62, 0x82, 0xb8, 0xd0, 0xde, 0x99, 0x05, 0x74, + 0x9b, 0xef, 0x6d, 0x0e, 0x0b, 0x85, 0x11, 0xf8, 0x34, 0x8c, 0x50, 0xe4, 0x40, + 0xad, 0xd7, 0x5c, 0xe2, 0xa7, 0xf3, 0x7b, 0xe6, 0xe9, 0x08, 0x83, 0x7c, 0x43, + 0x26, 0x68, 0x32, 0xc5, 0xd9, 0xa1, 0x12, 0xc5, 0x21, 0xd7, 0x58, 0x56, 0x1a, + 0xaa, 0xd5, 0x11, 0x65, 0x4b, 0x05, 0xb9, 0x94, 0x01, 0x11, 0x26, 0xec, 0xe2, + 0x20, 0x36, 0x4f, 0x1c, 0xc3, 0xf3, 0x0d, 0x40, 0x7b, 0xc3, 0xd9, 0xf8, 0x09, + 0xde, 0xb8, 0xb2, 0xdd, 0x22, 0xd1, 0x84, 0xa0, 0x1d, 0x2a, 0x56, 0x4e, 0xe4, + 0x76, 0xd9, 0x8a, 0x05, 0x53, 0x1b, 0x0c, 0x13, 0xb0, 0x81, 0x81, 0x20, 0x60, + 0xfc, 0xfb, 0xcb, 0x4d, 0x2e, 0x1d, 0xd9, 0x51, 0xa4, 0xa8, 0x0f, 0x9d, 0x0d, + 0xe6, 0x40, 0x1b, 0x27, 0x8e, 0xb5, 0x0c, 0xd7, 0x58, 0xf0, 0x40, 0xeb, 0x36, + 0x09, 0x68, 0xf1, 0x29, 0x5e, 0xd0, 0x1e, 0xd6, 0x51, 0x90, 0xc9, 0x64, 0xda, + 0xea, 0x98, 0x54, 0x20, 0x5d, 0x50, 0x9d, 0x1b, 0x98, 0xae, 0xce, 0x52, 0x18, + 0x35, 0xca, 0x1e, 0xa2, 0x3c, 0x02, 0x02, 0xd2, 0x6f, 0x08, 0x85, 0xe0, 0xd7, + 0x3f, 0xb7, 0xd3, 0xd2, 0x3e, 0xa1, 0xca, 0x4e, 0x17, 0x74, 0xf3, 0xe8, 0x93, + 0x0d, 0x41, 0x54, 0x1f, 0x68, 0xd4, 0x9f, 0x83, 0x06, 0x7a, 0xf6, 0x6c, 0xee, + 0xd9, 0x89, 0x40, 0xc8, 0x7c, 0x81, 0x61, 0x1b, 0xab, 0x52, 0x1c, 0x6c, 0x8a, + 0xc0, 0x75, 0xbe, 0xc3, 0x8b, 0x8f, 0x76, 0xe5, 0x4e, 0xcb, 0x91, 0xda, 0xc3, + 0x58, 0xd9, 0x2b, 0xbc, 0x68, 0x6d, 0xb0, 0x93, 0x43, 0x46, 0x43, 0x83, 0xd0, + 0xe8, 0x1d, 0x39, 0x34, 0x18, 0x8c, 0x94, 0x2a, 0xa0, 0xf2, 0xae, 0x88, 0x9e, + 0x59, 0x67, 0x44, 0xd1, 0xc6, 0x74, 0xec, 0x24, 0x69, 0x0e, 0xb2, 0xca, 0xc4, + 0x8c, 0x65, 0xe5, 0x2d, 0xbc, 0xd5, 0x14, 0x58, 0xce, 0x0a, 0x78, 0x08, 0xde, + 0x83, 0x51, 0x8e, 0x3a, 0x95, 0xd4, 0xd7, 0xad, 0xa0, 0xd1, 0x39, 0xf4, 0x50, + 0x68, 0xc1, 0xac, 0x9d, 0xb0, 0xa9, 0x31, 0x24, 0xc5, 0x0f, 0x58, 0xad, 0x5d, + 0x5a, 0xf1, 0x17, 0x37, 0x78, 0xa8, 0x53, 0xa6, 0x41, 0x20, 0x40, 0x10, 0x9a, + 0x38, 0x52, 0x46, 0x4f, 0x9c, 0x1d, 0xcd, 0x9a, 0x50, 0xab, 0x54, 0x4a, 0xe3, + 0x0c, 0x5c, 0x1c, 0x18, 0x49, 0xc9, 0x7a, 0xb8, 0xcf, 0x02, 0x76, 0xdf, 0x00, + 0x2e, 0x29, 0x72, 0x64, 0xbd, 0x82, 0x6a, 0x90, 0x90, 0x0d, 0x20, 0xcd, 0xe8, + 0x16, 0xd7, 0xde, 0x03, 0x12, 0x45, 0xb3, 0x54, 0xbd, 0x06, 0x61, 0xf1, 0x16, + 0xc4, 0x8a, 0xe2, 0xae, 0x80, 0xa8, 0xde, 0x88, 0x05, 0xb2, 0xa7, 0x53, 0x2a, + 0x5d, 0x54, 0x5a, 0xd3, 0xb4, 0x6c, 0xac, 0x44, 0x83, 0x22, 0x88, 0x61, 0x1c, + 0x35, 0xd3, 0x2a, 0x8c, 0xb9, 0x11, 0x6b, 0x61, 0x68, 0xa2, 0xa3, 0xab, 0x76, + 0x6c, 0x2a, 0xc1, 0xb4, 0x7c, 0x5d, 0xf6, 0xc6, 0xbb, 0x77, 0x46, 0x2e, 0x3b, + 0x9d, 0x13, 0xbc, 0x36, 0x7a, 0x84, 0x91, 0xa1, 0x6a, 0x26, 0x55, 0x20, 0xcb, + 0x10, 0x60, 0x2b, 0x8a, 0x67, 0x37, 0x54, 0x59, 0x60, 0x72, 0x17, 0x48, 0x57, + 0x1c, 0xbd, 0x74, 0x5a, 0xe5, 0x1b, 0xc0, 0x25, 0xa4, 0xba, 0xda, 0x4b, 0x2d, + 0x25, 0x04, 0x0c, 0xc1, 0x43, 0xcd, 0x9b, 0x66, 0x49, 0x1b, 0x54, 0x43, 0x8c, + 0x5b, 0x6a, 0x36, 0xad, 0x39, 0xdc, 0x02, 0x5e, 0x8a, 0xa3, 0x33, 0x52, 0x20, + 0x68, 0x43, 0xb4, 0x8a, 0x2e, 0xb9, 0x3a, 0xb8, 0xe4, 0xd0, 0x52, 0xd2, 0x2c, + 0x6d, 0x1c, 0xa1, 0x60, 0xf8, 0x64, 0x6c, 0xfd, 0x4b, 0x2c, 0xd5, 0x03, 0x9a, + 0x94, 0xcd, 0x50, 0x6e, 0x19, 0x50, 0x66, 0x40, 0xac, 0xb3, 0x91, 0x87, 0x31, + 0x17, 0x01, 0xe2, 0x70, 0xe2, 0x79, 0x36, 0xef, 0x10, 0xa3, 0x2b, 0x44, 0x9a, + 0x2b, 0x57, 0xd0, 0x0a, 0x90, 0xdd, 0x89, 0x62, 0xa2, 0x99, 0x04, 0xfd, 0x29, + 0x64, 0xd4, 0x0a, 0x4f, 0x76, 0x4d, 0xa8, 0xe0, 0xaa, 0x16, 0x4d, 0x13, 0x0f, + 0x9c, 0x5c, 0xc1, 0x64, 0x83, 0x72, 0x28, 0x6a, 0xd9, 0x4f, 0xf4, 0xed, 0x59, + 0xdc, 0xba, 0x00, 0x66, 0x2e, 0x8f, 0x83, 0x2b, 0x1b, 0x84, 0x20, 0xf9, 0x31, + 0x36, 0x86, 0xeb, 0xb1, 0x42, 0x04, 0x12, 0xd0, 0xc6, 0xd9, 0x2d, 0x24, 0x94, + 0x24, 0x74, 0xb5, 0x29, 0xa6, 0x9a, 0x1a, 0x10, 0xb3, 0x5a, 0xb9, 0x30, 0x98, + 0x6f, 0xcc, 0x8c, 0xc2, 0xe3, 0xfe, 0x2e, 0xe4, 0x8a, 0x70, 0xa1, 0x20, 0xb0, + 0x3e, 0xb4, 0x6a}; static const float64 square_roots[] = {2, 1.4142135623730951, @@ -529,9 +609,8 @@ static protein make_an_interesting_protein (void) OB_DIE_ON_ERROR (slabu_list_add_x (sb, slaw_unt8 (3))); OB_DIE_ON_ERROR (slabu_list_add_x (sb, slaw_string ("rd St. Unit"))); OB_DIE_ON_ERROR (slabu_list_add_x (sb, slaw_unt8 (111))); - OB_DIE_ON_ERROR ( - slabu_list_add_x (sb, slaw_cons_ff (slaw_string ("Los Angeles"), - slaw_string ("CA")))); + OB_DIE_ON_ERROR (slabu_list_add_x ( + sb, slaw_cons_ff (slaw_string ("Los Angeles"), slaw_string ("CA")))); OB_DIE_ON_ERROR (slabu_list_add_x (sb, slaw_unt32 (90013))); OB_DIE_ON_ERROR (slabu_list_add_x (sb, slaw_unt16_array (phone, 3))); slabu_map_put_cf (ingests, "Address", slaw_list_f (sb)); @@ -571,44 +650,42 @@ static protein make_an_interesting_protein (void) sb = slabu_new (); for (i = 0; i < 5; i++) OB_DIE_ON_ERROR (slabu_list_add_x (sb, slaw_nil ())); - slabu_map_put_cf (ingests, "some strange consing", - slaw_cons_ff (slaw_list_f (sb), - slaw_cons_ff (slaw_cons_ff (slaw_string ("a"), - slaw_string ( - "b")), - slaw_cons_ff (slaw_string ("c"), - slaw_string ( - "d"))))); + slabu_map_put_cf ( + ingests, "some strange consing", + slaw_cons_ff ( + slaw_list_f (sb), + slaw_cons_ff (slaw_cons_ff (slaw_string ("a"), slaw_string ("b")), + slaw_cons_ff (slaw_string ("c"), slaw_string ("d"))))); sb = slabu_new (); slabu_map_put_cf (ingests, "an empty list", slaw_list_f (sb)); - slabu_map_put_cf (ingests, - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - slaw_string ( - "This key is longer than 1024 characters, to test out " - "the fact that implicit keys cannot exceed 1024 " - "characters, even if the key could otherwise be " - "implicit. See http://yaml.org/spec/1.2/#id2597711 for " - "more information. So that means that we should see a " - "'?' in front of this key. It looks like libYaml adds " - "the '?' for any key longer than 128 characters, even " - "though the spec says 1024.")); + slabu_map_put_cf ( + ingests, + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + slaw_string ("This key is longer than 1024 characters, to test out " + "the fact that implicit keys cannot exceed 1024 " + "characters, even if the key could otherwise be " + "implicit. See http://yaml.org/spec/1.2/#id2597711 for " + "more information. So that means that we should see a " + "'?' in front of this key. It looks like libYaml adds " + "the '?' for any key longer than 128 characters, even " + "though the spec says 1024.")); slabu_map_put_cf (ingests, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" @@ -632,8 +709,9 @@ static protein make_an_interesting_protein (void) slabu_map_put_cf (ingests, "\360\245\205\275 is outside the Basic Multilingual Plane.", slaw_nil ()); - slabu_map_put_cf (ingests, "$ \302\242 \342\202\245 \302\243 \302\245 " - "\342\202\254 \342\202\251", + slabu_map_put_cf (ingests, + "$ \302\242 \342\202\245 \302\243 \302\245 " + "\342\202\254 \342\202\251", slaw_string ("money")); slabu_map_put_cf (ingests, "0-length array of int8", @@ -666,21 +744,17 @@ static protein make_an_interesting_protein (void) slabu_map_put_cf (ingests, "1-length array of complex vectors", slaw_v4int16c_array_empty (1)); - slabu_map_put_cf (ingests, "a map of stuff", - slaw_map_inline_ff (slaw_string ("false"), - slaw_boolean (false), - slaw_string ("protein with neither " - "descrips nor ingests"), - protein_from_ff (NULL, NULL), - slaw_string ( - "protein with no descrips"), - protein_from_ff (NULL, slaw_float64 ( - 3.14159)), - slaw_string ("protein with no ingests"), - protein_from_ff (slaw_unt32 (0x4ffe874), - NULL), - slaw_string ("true"), - slaw_boolean (true), NULL)); + slabu_map_put_cf ( + ingests, "a map of stuff", + slaw_map_inline_ff (slaw_string ("false"), slaw_boolean (false), + slaw_string ("protein with neither " + "descrips nor ingests"), + protein_from_ff (NULL, NULL), + slaw_string ("protein with no descrips"), + protein_from_ff (NULL, slaw_float64 (3.14159)), + slaw_string ("protein with no ingests"), + protein_from_ff (slaw_unt32 (0x4ffe874), NULL), + slaw_string ("true"), slaw_boolean (true), NULL)); n = 0; f = 0; @@ -790,9 +864,9 @@ int main (int argc, char **argv) else // Use this (once on x86 and once on PPC) to make the files for the test if (argc == 3 && strcmp (argv[1], "--write") == 0) - rval = write_protein (argv[2]); - else - fprintf (stderr, "Usage: %s binary-protein-file-to-compare\n", argv[0]); + rval = write_protein (argv[2]); + else + fprintf (stderr, "Usage: %s binary-protein-file-to-compare\n", argv[0]); return rval; } diff --git a/libPlasma/c/t/ilk-begotten-helper.c b/libPlasma/c/t/ilk-begotten-helper.c index 49ecb7c2..1ec6c172 100644 --- a/libPlasma/c/t/ilk-begotten-helper.c +++ b/libPlasma/c/t/ilk-begotten-helper.c @@ -12,257 +12,257 @@ typedef struct const char *slawTypeName; } SlawTypePredicateAndName; -const SlawTypePredicateAndName gSlawTypePredicateAndNames[] = - {{&slaw_is_int32, "int32"}, - {&slaw_is_int32_array, "int32_array"}, - {&slaw_is_unt32, "unt32"}, - {&slaw_is_unt32_array, "unt32_array"}, - {&slaw_is_int64, "int64"}, - {&slaw_is_int64_array, "int64_array"}, - {&slaw_is_unt64, "unt64"}, - {&slaw_is_unt64_array, "unt64_array"}, - {&slaw_is_float32, "float32"}, - {&slaw_is_float32_array, "float32_array"}, - {&slaw_is_float64, "float64"}, - {&slaw_is_float64_array, "float64_array"}, - {&slaw_is_int8, "int8"}, - {&slaw_is_int8_array, "int8_array"}, - {&slaw_is_unt8, "unt8"}, - {&slaw_is_unt8_array, "unt8_array"}, - {&slaw_is_int16, "int16"}, - {&slaw_is_int16_array, "int16_array"}, - {&slaw_is_unt16, "unt16"}, - {&slaw_is_unt16_array, "unt16_array"}, - {&slaw_is_int32c, "int32c"}, - {&slaw_is_int32c_array, "int32c_array"}, - {&slaw_is_unt32c, "unt32c"}, - {&slaw_is_unt32c_array, "unt32c_array"}, - {&slaw_is_int64c, "int64c"}, - {&slaw_is_int64c_array, "int64c_array"}, - {&slaw_is_unt64c, "unt64c"}, - {&slaw_is_unt64c_array, "unt64c_array"}, - {&slaw_is_float32c, "float32c"}, - {&slaw_is_float32c_array, "float32c_array"}, - {&slaw_is_float64c, "float64c"}, - {&slaw_is_float64c_array, "float64c_array"}, - {&slaw_is_int8c, "int8c"}, - {&slaw_is_int8c_array, "int8c_array"}, - {&slaw_is_unt8c, "unt8c"}, - {&slaw_is_unt8c_array, "unt8c_array"}, - {&slaw_is_int16c, "int16c"}, - {&slaw_is_int16c_array, "int16c_array"}, - {&slaw_is_unt16c, "unt16c"}, - {&slaw_is_unt16c_array, "unt16c_array"}, - {&slaw_is_v2int32, "v2int32"}, - {&slaw_is_v2int32_array, "v2int32_array"}, - {&slaw_is_v2unt32, "v2unt32"}, - {&slaw_is_v2unt32_array, "v2unt32_array"}, - {&slaw_is_v2int64, "v2int64"}, - {&slaw_is_v2int64_array, "v2int64_array"}, - {&slaw_is_v2unt64, "v2unt64"}, - {&slaw_is_v2unt64_array, "v2unt64_array"}, - {&slaw_is_v2float32, "v2float32"}, - {&slaw_is_v2float32_array, "v2float32_array"}, - {&slaw_is_v2float64, "v2float64"}, - {&slaw_is_v2float64_array, "v2float64_array"}, - {&slaw_is_v2int8, "v2int8"}, - {&slaw_is_v2int8_array, "v2int8_array"}, - {&slaw_is_v2unt8, "v2unt8"}, - {&slaw_is_v2unt8_array, "v2unt8_array"}, - {&slaw_is_v2int16, "v2int16"}, - {&slaw_is_v2int16_array, "v2int16_array"}, - {&slaw_is_v2unt16, "v2unt16"}, - {&slaw_is_v2unt16_array, "v2unt16_array"}, - {&slaw_is_v3int32, "v3int32"}, - {&slaw_is_v3int32_array, "v3int32_array"}, - {&slaw_is_v3unt32, "v3unt32"}, - {&slaw_is_v3unt32_array, "v3unt32_array"}, - {&slaw_is_v3int64, "v3int64"}, - {&slaw_is_v3int64_array, "v3int64_array"}, - {&slaw_is_v3unt64, "v3unt64"}, - {&slaw_is_v3unt64_array, "v3unt64_array"}, - {&slaw_is_v3float32, "v3float32"}, - {&slaw_is_v3float32_array, "v3float32_array"}, - {&slaw_is_v3float64, "v3float64"}, - {&slaw_is_v3float64_array, "v3float64_array"}, - {&slaw_is_v3int8, "v3int8"}, - {&slaw_is_v3int8_array, "v3int8_array"}, - {&slaw_is_v3unt8, "v3unt8"}, - {&slaw_is_v3unt8_array, "v3unt8_array"}, - {&slaw_is_v3int16, "v3int16"}, - {&slaw_is_v3int16_array, "v3int16_array"}, - {&slaw_is_v3unt16, "v3unt16"}, - {&slaw_is_v3unt16_array, "v3unt16_array"}, - {&slaw_is_v4int32, "v4int32"}, - {&slaw_is_v4int32_array, "v4int32_array"}, - {&slaw_is_v4unt32, "v4unt32"}, - {&slaw_is_v4unt32_array, "v4unt32_array"}, - {&slaw_is_v4int64, "v4int64"}, - {&slaw_is_v4int64_array, "v4int64_array"}, - {&slaw_is_v4unt64, "v4unt64"}, - {&slaw_is_v4unt64_array, "v4unt64_array"}, - {&slaw_is_v4float32, "v4float32"}, - {&slaw_is_v4float32_array, "v4float32_array"}, - {&slaw_is_v4float64, "v4float64"}, - {&slaw_is_v4float64_array, "v4float64_array"}, - {&slaw_is_v4int8, "v4int8"}, - {&slaw_is_v4int8_array, "v4int8_array"}, - {&slaw_is_v4unt8, "v4unt8"}, - {&slaw_is_v4unt8_array, "v4unt8_array"}, - {&slaw_is_v4int16, "v4int16"}, - {&slaw_is_v4int16_array, "v4int16_array"}, - {&slaw_is_v4unt16, "v4unt16"}, - {&slaw_is_v4unt16_array, "v4unt16_array"}, - {&slaw_is_v2int32c, "v2int32c"}, - {&slaw_is_v2int32c_array, "v2int32c_array"}, - {&slaw_is_v2unt32c, "v2unt32c"}, - {&slaw_is_v2unt32c_array, "v2unt32c_array"}, - {&slaw_is_v2int64c, "v2int64c"}, - {&slaw_is_v2int64c_array, "v2int64c_array"}, - {&slaw_is_v2unt64c, "v2unt64c"}, - {&slaw_is_v2unt64c_array, "v2unt64c_array"}, - {&slaw_is_v2float32c, "v2float32c"}, - {&slaw_is_v2float32c_array, "v2float32c_array"}, - {&slaw_is_v2float64c, "v2float64c"}, - {&slaw_is_v2float64c_array, "v2float64c_array"}, - {&slaw_is_v2int8c, "v2int8c"}, - {&slaw_is_v2int8c_array, "v2int8c_array"}, - {&slaw_is_v2unt8c, "v2unt8c"}, - {&slaw_is_v2unt8c_array, "v2unt8c_array"}, - {&slaw_is_v2int16c, "v2int16c"}, - {&slaw_is_v2int16c_array, "v2int16c_array"}, - {&slaw_is_v2unt16c, "v2unt16c"}, - {&slaw_is_v2unt16c_array, "v2unt16c_array"}, - {&slaw_is_v3int32c, "v3int32c"}, - {&slaw_is_v3int32c_array, "v3int32c_array"}, - {&slaw_is_v3unt32c, "v3unt32c"}, - {&slaw_is_v3unt32c_array, "v3unt32c_array"}, - {&slaw_is_v3int64c, "v3int64c"}, - {&slaw_is_v3int64c_array, "v3int64c_array"}, - {&slaw_is_v3unt64c, "v3unt64c"}, - {&slaw_is_v3unt64c_array, "v3unt64c_array"}, - {&slaw_is_v3float32c, "v3float32c"}, - {&slaw_is_v3float32c_array, "v3float32c_array"}, - {&slaw_is_v3float64c, "v3float64c"}, - {&slaw_is_v3float64c_array, "v3float64c_array"}, - {&slaw_is_v3int8c, "v3int8c"}, - {&slaw_is_v3int8c_array, "v3int8c_array"}, - {&slaw_is_v3unt8c, "v3unt8c"}, - {&slaw_is_v3unt8c_array, "v3unt8c_array"}, - {&slaw_is_v3int16c, "v3int16c"}, - {&slaw_is_v3int16c_array, "v3int16c_array"}, - {&slaw_is_v3unt16c, "v3unt16c"}, - {&slaw_is_v3unt16c_array, "v3unt16c_array"}, - {&slaw_is_v4int32c, "v4int32c"}, - {&slaw_is_v4int32c_array, "v4int32c_array"}, - {&slaw_is_v4unt32c, "v4unt32c"}, - {&slaw_is_v4unt32c_array, "v4unt32c_array"}, - {&slaw_is_v4int64c, "v4int64c"}, - {&slaw_is_v4int64c_array, "v4int64c_array"}, - {&slaw_is_v4unt64c, "v4unt64c"}, - {&slaw_is_v4unt64c_array, "v4unt64c_array"}, - {&slaw_is_v4float32c, "v4float32c"}, - {&slaw_is_v4float32c_array, "v4float32c_array"}, - {&slaw_is_v4float64c, "v4float64c"}, - {&slaw_is_v4float64c_array, "v4float64c_array"}, - {&slaw_is_v4int8c, "v4int8c"}, - {&slaw_is_v4int8c_array, "v4int8c_array"}, - {&slaw_is_v4unt8c, "v4unt8c"}, - {&slaw_is_v4unt8c_array, "v4unt8c_array"}, - {&slaw_is_v4int16c, "v4int16c"}, - {&slaw_is_v4int16c_array, "v4int16c_array"}, - {&slaw_is_v4unt16c, "v4unt16c"}, - {&slaw_is_v4unt16c_array, "v4unt16c_array"}, - {&slaw_is_m2int32, "m2int32"}, - {&slaw_is_m2int32_array, "m2int32_array"}, - {&slaw_is_m2unt32, "m2unt32"}, - {&slaw_is_m2unt32_array, "m2unt32_array"}, - {&slaw_is_m2int64, "m2int64"}, - {&slaw_is_m2int64_array, "m2int64_array"}, - {&slaw_is_m2unt64, "m2unt64"}, - {&slaw_is_m2unt64_array, "m2unt64_array"}, - {&slaw_is_m2float32, "m2float32"}, - {&slaw_is_m2float32_array, "m2float32_array"}, - {&slaw_is_m2float64, "m2float64"}, - {&slaw_is_m2float64_array, "m2float64_array"}, - {&slaw_is_m2int8, "m2int8"}, - {&slaw_is_m2int8_array, "m2int8_array"}, - {&slaw_is_m2unt8, "m2unt8"}, - {&slaw_is_m2unt8_array, "m2unt8_array"}, - {&slaw_is_m2int16, "m2int16"}, - {&slaw_is_m2int16_array, "m2int16_array"}, - {&slaw_is_m2unt16, "m2unt16"}, - {&slaw_is_m2unt16_array, "m2unt16_array"}, - {&slaw_is_m3int32, "m3int32"}, - {&slaw_is_m3int32_array, "m3int32_array"}, - {&slaw_is_m3unt32, "m3unt32"}, - {&slaw_is_m3unt32_array, "m3unt32_array"}, - {&slaw_is_m3int64, "m3int64"}, - {&slaw_is_m3int64_array, "m3int64_array"}, - {&slaw_is_m3unt64, "m3unt64"}, - {&slaw_is_m3unt64_array, "m3unt64_array"}, - {&slaw_is_m3float32, "m3float32"}, - {&slaw_is_m3float32_array, "m3float32_array"}, - {&slaw_is_m3float64, "m3float64"}, - {&slaw_is_m3float64_array, "m3float64_array"}, - {&slaw_is_m3int8, "m3int8"}, - {&slaw_is_m3int8_array, "m3int8_array"}, - {&slaw_is_m3unt8, "m3unt8"}, - {&slaw_is_m3unt8_array, "m3unt8_array"}, - {&slaw_is_m3int16, "m3int16"}, - {&slaw_is_m3int16_array, "m3int16_array"}, - {&slaw_is_m3unt16, "m3unt16"}, - {&slaw_is_m3unt16_array, "m3unt16_array"}, - {&slaw_is_m4int32, "m4int32"}, - {&slaw_is_m4int32_array, "m4int32_array"}, - {&slaw_is_m4unt32, "m4unt32"}, - {&slaw_is_m4unt32_array, "m4unt32_array"}, - {&slaw_is_m4int64, "m4int64"}, - {&slaw_is_m4int64_array, "m4int64_array"}, - {&slaw_is_m4unt64, "m4unt64"}, - {&slaw_is_m4unt64_array, "m4unt64_array"}, - {&slaw_is_m4float32, "m4float32"}, - {&slaw_is_m4float32_array, "m4float32_array"}, - {&slaw_is_m4float64, "m4float64"}, - {&slaw_is_m4float64_array, "m4float64_array"}, - {&slaw_is_m4int8, "m4int8"}, - {&slaw_is_m4int8_array, "m4int8_array"}, - {&slaw_is_m4unt8, "m4unt8"}, - {&slaw_is_m4unt8_array, "m4unt8_array"}, - {&slaw_is_m4int16, "m4int16"}, - {&slaw_is_m4int16_array, "m4int16_array"}, - {&slaw_is_m4unt16, "m4unt16"}, - {&slaw_is_m4unt16_array, "m4unt16_array"}, - {&slaw_is_m5int32, "m5int32"}, - {&slaw_is_m5int32_array, "m5int32_array"}, - {&slaw_is_m5unt32, "m5unt32"}, - {&slaw_is_m5unt32_array, "m5unt32_array"}, - {&slaw_is_m5int64, "m5int64"}, - {&slaw_is_m5int64_array, "m5int64_array"}, - {&slaw_is_m5unt64, "m5unt64"}, - {&slaw_is_m5unt64_array, "m5unt64_array"}, - {&slaw_is_m5float32, "m5float32"}, - {&slaw_is_m5float32_array, "m5float32_array"}, - {&slaw_is_m5float64, "m5float64"}, - {&slaw_is_m5float64_array, "m5float64_array"}, - {&slaw_is_m5int8, "m5int8"}, - {&slaw_is_m5int8_array, "m5int8_array"}, - {&slaw_is_m5unt8, "m5unt8"}, - {&slaw_is_m5unt8_array, "m5unt8_array"}, - {&slaw_is_m5int16, "m5int16"}, - {&slaw_is_m5int16_array, "m5int16_array"}, - {&slaw_is_m5unt16, "m5unt16"}, - {&slaw_is_m5unt16_array, "m5unt16_array"}, - {&slaw_is_nil, "nil"}, - {&slaw_is_string, "string"}, - {&slaw_is_cons, "cons"}, - {&slaw_is_list, "list"}, - {&slaw_is_map, "map"}, - {&slaw_is_list_or_map, "list_or_map"}, - {&slaw_is_protein, "protein"}, - {&slaw_is_swapped_protein, "swapped_protein"}, - {&slaw_is_boolean, "boolean"}, - {0, 0}}; +const SlawTypePredicateAndName gSlawTypePredicateAndNames[] = { + {&slaw_is_int32, "int32"}, + {&slaw_is_int32_array, "int32_array"}, + {&slaw_is_unt32, "unt32"}, + {&slaw_is_unt32_array, "unt32_array"}, + {&slaw_is_int64, "int64"}, + {&slaw_is_int64_array, "int64_array"}, + {&slaw_is_unt64, "unt64"}, + {&slaw_is_unt64_array, "unt64_array"}, + {&slaw_is_float32, "float32"}, + {&slaw_is_float32_array, "float32_array"}, + {&slaw_is_float64, "float64"}, + {&slaw_is_float64_array, "float64_array"}, + {&slaw_is_int8, "int8"}, + {&slaw_is_int8_array, "int8_array"}, + {&slaw_is_unt8, "unt8"}, + {&slaw_is_unt8_array, "unt8_array"}, + {&slaw_is_int16, "int16"}, + {&slaw_is_int16_array, "int16_array"}, + {&slaw_is_unt16, "unt16"}, + {&slaw_is_unt16_array, "unt16_array"}, + {&slaw_is_int32c, "int32c"}, + {&slaw_is_int32c_array, "int32c_array"}, + {&slaw_is_unt32c, "unt32c"}, + {&slaw_is_unt32c_array, "unt32c_array"}, + {&slaw_is_int64c, "int64c"}, + {&slaw_is_int64c_array, "int64c_array"}, + {&slaw_is_unt64c, "unt64c"}, + {&slaw_is_unt64c_array, "unt64c_array"}, + {&slaw_is_float32c, "float32c"}, + {&slaw_is_float32c_array, "float32c_array"}, + {&slaw_is_float64c, "float64c"}, + {&slaw_is_float64c_array, "float64c_array"}, + {&slaw_is_int8c, "int8c"}, + {&slaw_is_int8c_array, "int8c_array"}, + {&slaw_is_unt8c, "unt8c"}, + {&slaw_is_unt8c_array, "unt8c_array"}, + {&slaw_is_int16c, "int16c"}, + {&slaw_is_int16c_array, "int16c_array"}, + {&slaw_is_unt16c, "unt16c"}, + {&slaw_is_unt16c_array, "unt16c_array"}, + {&slaw_is_v2int32, "v2int32"}, + {&slaw_is_v2int32_array, "v2int32_array"}, + {&slaw_is_v2unt32, "v2unt32"}, + {&slaw_is_v2unt32_array, "v2unt32_array"}, + {&slaw_is_v2int64, "v2int64"}, + {&slaw_is_v2int64_array, "v2int64_array"}, + {&slaw_is_v2unt64, "v2unt64"}, + {&slaw_is_v2unt64_array, "v2unt64_array"}, + {&slaw_is_v2float32, "v2float32"}, + {&slaw_is_v2float32_array, "v2float32_array"}, + {&slaw_is_v2float64, "v2float64"}, + {&slaw_is_v2float64_array, "v2float64_array"}, + {&slaw_is_v2int8, "v2int8"}, + {&slaw_is_v2int8_array, "v2int8_array"}, + {&slaw_is_v2unt8, "v2unt8"}, + {&slaw_is_v2unt8_array, "v2unt8_array"}, + {&slaw_is_v2int16, "v2int16"}, + {&slaw_is_v2int16_array, "v2int16_array"}, + {&slaw_is_v2unt16, "v2unt16"}, + {&slaw_is_v2unt16_array, "v2unt16_array"}, + {&slaw_is_v3int32, "v3int32"}, + {&slaw_is_v3int32_array, "v3int32_array"}, + {&slaw_is_v3unt32, "v3unt32"}, + {&slaw_is_v3unt32_array, "v3unt32_array"}, + {&slaw_is_v3int64, "v3int64"}, + {&slaw_is_v3int64_array, "v3int64_array"}, + {&slaw_is_v3unt64, "v3unt64"}, + {&slaw_is_v3unt64_array, "v3unt64_array"}, + {&slaw_is_v3float32, "v3float32"}, + {&slaw_is_v3float32_array, "v3float32_array"}, + {&slaw_is_v3float64, "v3float64"}, + {&slaw_is_v3float64_array, "v3float64_array"}, + {&slaw_is_v3int8, "v3int8"}, + {&slaw_is_v3int8_array, "v3int8_array"}, + {&slaw_is_v3unt8, "v3unt8"}, + {&slaw_is_v3unt8_array, "v3unt8_array"}, + {&slaw_is_v3int16, "v3int16"}, + {&slaw_is_v3int16_array, "v3int16_array"}, + {&slaw_is_v3unt16, "v3unt16"}, + {&slaw_is_v3unt16_array, "v3unt16_array"}, + {&slaw_is_v4int32, "v4int32"}, + {&slaw_is_v4int32_array, "v4int32_array"}, + {&slaw_is_v4unt32, "v4unt32"}, + {&slaw_is_v4unt32_array, "v4unt32_array"}, + {&slaw_is_v4int64, "v4int64"}, + {&slaw_is_v4int64_array, "v4int64_array"}, + {&slaw_is_v4unt64, "v4unt64"}, + {&slaw_is_v4unt64_array, "v4unt64_array"}, + {&slaw_is_v4float32, "v4float32"}, + {&slaw_is_v4float32_array, "v4float32_array"}, + {&slaw_is_v4float64, "v4float64"}, + {&slaw_is_v4float64_array, "v4float64_array"}, + {&slaw_is_v4int8, "v4int8"}, + {&slaw_is_v4int8_array, "v4int8_array"}, + {&slaw_is_v4unt8, "v4unt8"}, + {&slaw_is_v4unt8_array, "v4unt8_array"}, + {&slaw_is_v4int16, "v4int16"}, + {&slaw_is_v4int16_array, "v4int16_array"}, + {&slaw_is_v4unt16, "v4unt16"}, + {&slaw_is_v4unt16_array, "v4unt16_array"}, + {&slaw_is_v2int32c, "v2int32c"}, + {&slaw_is_v2int32c_array, "v2int32c_array"}, + {&slaw_is_v2unt32c, "v2unt32c"}, + {&slaw_is_v2unt32c_array, "v2unt32c_array"}, + {&slaw_is_v2int64c, "v2int64c"}, + {&slaw_is_v2int64c_array, "v2int64c_array"}, + {&slaw_is_v2unt64c, "v2unt64c"}, + {&slaw_is_v2unt64c_array, "v2unt64c_array"}, + {&slaw_is_v2float32c, "v2float32c"}, + {&slaw_is_v2float32c_array, "v2float32c_array"}, + {&slaw_is_v2float64c, "v2float64c"}, + {&slaw_is_v2float64c_array, "v2float64c_array"}, + {&slaw_is_v2int8c, "v2int8c"}, + {&slaw_is_v2int8c_array, "v2int8c_array"}, + {&slaw_is_v2unt8c, "v2unt8c"}, + {&slaw_is_v2unt8c_array, "v2unt8c_array"}, + {&slaw_is_v2int16c, "v2int16c"}, + {&slaw_is_v2int16c_array, "v2int16c_array"}, + {&slaw_is_v2unt16c, "v2unt16c"}, + {&slaw_is_v2unt16c_array, "v2unt16c_array"}, + {&slaw_is_v3int32c, "v3int32c"}, + {&slaw_is_v3int32c_array, "v3int32c_array"}, + {&slaw_is_v3unt32c, "v3unt32c"}, + {&slaw_is_v3unt32c_array, "v3unt32c_array"}, + {&slaw_is_v3int64c, "v3int64c"}, + {&slaw_is_v3int64c_array, "v3int64c_array"}, + {&slaw_is_v3unt64c, "v3unt64c"}, + {&slaw_is_v3unt64c_array, "v3unt64c_array"}, + {&slaw_is_v3float32c, "v3float32c"}, + {&slaw_is_v3float32c_array, "v3float32c_array"}, + {&slaw_is_v3float64c, "v3float64c"}, + {&slaw_is_v3float64c_array, "v3float64c_array"}, + {&slaw_is_v3int8c, "v3int8c"}, + {&slaw_is_v3int8c_array, "v3int8c_array"}, + {&slaw_is_v3unt8c, "v3unt8c"}, + {&slaw_is_v3unt8c_array, "v3unt8c_array"}, + {&slaw_is_v3int16c, "v3int16c"}, + {&slaw_is_v3int16c_array, "v3int16c_array"}, + {&slaw_is_v3unt16c, "v3unt16c"}, + {&slaw_is_v3unt16c_array, "v3unt16c_array"}, + {&slaw_is_v4int32c, "v4int32c"}, + {&slaw_is_v4int32c_array, "v4int32c_array"}, + {&slaw_is_v4unt32c, "v4unt32c"}, + {&slaw_is_v4unt32c_array, "v4unt32c_array"}, + {&slaw_is_v4int64c, "v4int64c"}, + {&slaw_is_v4int64c_array, "v4int64c_array"}, + {&slaw_is_v4unt64c, "v4unt64c"}, + {&slaw_is_v4unt64c_array, "v4unt64c_array"}, + {&slaw_is_v4float32c, "v4float32c"}, + {&slaw_is_v4float32c_array, "v4float32c_array"}, + {&slaw_is_v4float64c, "v4float64c"}, + {&slaw_is_v4float64c_array, "v4float64c_array"}, + {&slaw_is_v4int8c, "v4int8c"}, + {&slaw_is_v4int8c_array, "v4int8c_array"}, + {&slaw_is_v4unt8c, "v4unt8c"}, + {&slaw_is_v4unt8c_array, "v4unt8c_array"}, + {&slaw_is_v4int16c, "v4int16c"}, + {&slaw_is_v4int16c_array, "v4int16c_array"}, + {&slaw_is_v4unt16c, "v4unt16c"}, + {&slaw_is_v4unt16c_array, "v4unt16c_array"}, + {&slaw_is_m2int32, "m2int32"}, + {&slaw_is_m2int32_array, "m2int32_array"}, + {&slaw_is_m2unt32, "m2unt32"}, + {&slaw_is_m2unt32_array, "m2unt32_array"}, + {&slaw_is_m2int64, "m2int64"}, + {&slaw_is_m2int64_array, "m2int64_array"}, + {&slaw_is_m2unt64, "m2unt64"}, + {&slaw_is_m2unt64_array, "m2unt64_array"}, + {&slaw_is_m2float32, "m2float32"}, + {&slaw_is_m2float32_array, "m2float32_array"}, + {&slaw_is_m2float64, "m2float64"}, + {&slaw_is_m2float64_array, "m2float64_array"}, + {&slaw_is_m2int8, "m2int8"}, + {&slaw_is_m2int8_array, "m2int8_array"}, + {&slaw_is_m2unt8, "m2unt8"}, + {&slaw_is_m2unt8_array, "m2unt8_array"}, + {&slaw_is_m2int16, "m2int16"}, + {&slaw_is_m2int16_array, "m2int16_array"}, + {&slaw_is_m2unt16, "m2unt16"}, + {&slaw_is_m2unt16_array, "m2unt16_array"}, + {&slaw_is_m3int32, "m3int32"}, + {&slaw_is_m3int32_array, "m3int32_array"}, + {&slaw_is_m3unt32, "m3unt32"}, + {&slaw_is_m3unt32_array, "m3unt32_array"}, + {&slaw_is_m3int64, "m3int64"}, + {&slaw_is_m3int64_array, "m3int64_array"}, + {&slaw_is_m3unt64, "m3unt64"}, + {&slaw_is_m3unt64_array, "m3unt64_array"}, + {&slaw_is_m3float32, "m3float32"}, + {&slaw_is_m3float32_array, "m3float32_array"}, + {&slaw_is_m3float64, "m3float64"}, + {&slaw_is_m3float64_array, "m3float64_array"}, + {&slaw_is_m3int8, "m3int8"}, + {&slaw_is_m3int8_array, "m3int8_array"}, + {&slaw_is_m3unt8, "m3unt8"}, + {&slaw_is_m3unt8_array, "m3unt8_array"}, + {&slaw_is_m3int16, "m3int16"}, + {&slaw_is_m3int16_array, "m3int16_array"}, + {&slaw_is_m3unt16, "m3unt16"}, + {&slaw_is_m3unt16_array, "m3unt16_array"}, + {&slaw_is_m4int32, "m4int32"}, + {&slaw_is_m4int32_array, "m4int32_array"}, + {&slaw_is_m4unt32, "m4unt32"}, + {&slaw_is_m4unt32_array, "m4unt32_array"}, + {&slaw_is_m4int64, "m4int64"}, + {&slaw_is_m4int64_array, "m4int64_array"}, + {&slaw_is_m4unt64, "m4unt64"}, + {&slaw_is_m4unt64_array, "m4unt64_array"}, + {&slaw_is_m4float32, "m4float32"}, + {&slaw_is_m4float32_array, "m4float32_array"}, + {&slaw_is_m4float64, "m4float64"}, + {&slaw_is_m4float64_array, "m4float64_array"}, + {&slaw_is_m4int8, "m4int8"}, + {&slaw_is_m4int8_array, "m4int8_array"}, + {&slaw_is_m4unt8, "m4unt8"}, + {&slaw_is_m4unt8_array, "m4unt8_array"}, + {&slaw_is_m4int16, "m4int16"}, + {&slaw_is_m4int16_array, "m4int16_array"}, + {&slaw_is_m4unt16, "m4unt16"}, + {&slaw_is_m4unt16_array, "m4unt16_array"}, + {&slaw_is_m5int32, "m5int32"}, + {&slaw_is_m5int32_array, "m5int32_array"}, + {&slaw_is_m5unt32, "m5unt32"}, + {&slaw_is_m5unt32_array, "m5unt32_array"}, + {&slaw_is_m5int64, "m5int64"}, + {&slaw_is_m5int64_array, "m5int64_array"}, + {&slaw_is_m5unt64, "m5unt64"}, + {&slaw_is_m5unt64_array, "m5unt64_array"}, + {&slaw_is_m5float32, "m5float32"}, + {&slaw_is_m5float32_array, "m5float32_array"}, + {&slaw_is_m5float64, "m5float64"}, + {&slaw_is_m5float64_array, "m5float64_array"}, + {&slaw_is_m5int8, "m5int8"}, + {&slaw_is_m5int8_array, "m5int8_array"}, + {&slaw_is_m5unt8, "m5unt8"}, + {&slaw_is_m5unt8_array, "m5unt8_array"}, + {&slaw_is_m5int16, "m5int16"}, + {&slaw_is_m5int16_array, "m5int16_array"}, + {&slaw_is_m5unt16, "m5unt16"}, + {&slaw_is_m5unt16_array, "m5unt16_array"}, + {&slaw_is_nil, "nil"}, + {&slaw_is_string, "string"}, + {&slaw_is_cons, "cons"}, + {&slaw_is_list, "list"}, + {&slaw_is_map, "map"}, + {&slaw_is_list_or_map, "list_or_map"}, + {&slaw_is_protein, "protein"}, + {&slaw_is_swapped_protein, "swapped_protein"}, + {&slaw_is_boolean, "boolean"}, + {0, 0}}; void TestAgainstPredicates (ESlawType t, bslaw s) { diff --git a/libPlasma/c/t/list-search.c b/libPlasma/c/t/list-search.c index 0dd34e3b..b2c0d584 100644 --- a/libPlasma/c/t/list-search.c +++ b/libPlasma/c/t/list-search.c @@ -93,18 +93,16 @@ int main (int argc, char **argv) "got %" OB_FMT_64 "d but expected %" OB_FMT_64 "d\n", got, expected); - got = slaw_list_contigsearch_inline_f (lst, slaw_string ("man"), - slaw_string ("a"), - slaw_string ("plan"), NULL); + got = slaw_list_contigsearch_inline_f ( + lst, slaw_string ("man"), slaw_string ("a"), slaw_string ("plan"), NULL); expected = 1; if (got != expected) OB_FATAL_ERROR_CODE (0x2030500a, "got %" OB_FMT_64 "d but expected %" OB_FMT_64 "d\n", got, expected); - got = - slaw_list_gapsearch_inline_f (lst, slaw_string ("plan"), slaw_string ("a"), - slaw_string ("panama"), NULL); + got = slaw_list_gapsearch_inline_f ( + lst, slaw_string ("plan"), slaw_string ("a"), slaw_string ("panama"), NULL); expected = 3; if (got != expected) OB_FATAL_ERROR_CODE (0x2030500b, diff --git a/libPlasma/c/t/listcat_test.c b/libPlasma/c/t/listcat_test.c index 98afe9e0..269c8db2 100644 --- a/libPlasma/c/t/listcat_test.c +++ b/libPlasma/c/t/listcat_test.c @@ -108,8 +108,9 @@ static void *thread_main (void *ignored) if (j != SIZE) { - fprintf (stderr, "On iteration %d, expected list length to be %d " - "but it was %d\n", + fprintf (stderr, + "On iteration %d, expected list length to be %d " + "but it was %d\n", i, SIZE, j); exit (EXIT_FAILURE); } diff --git a/libPlasma/c/t/nonconformist.c b/libPlasma/c/t/nonconformist.c index bca42b59..45873654 100644 --- a/libPlasma/c/t/nonconformist.c +++ b/libPlasma/c/t/nonconformist.c @@ -14,12 +14,12 @@ #include -static const char *const words[] = - {"mortals", "foolish", "pallor", "cadaverous", "aura", - "foreboding", "metamorphosis", "disquieting", "observation", "dismaying", - "no", "windows", "no", "doors", "challenge", - "chilling", "way", "out", "way", "my", - "frighten", "prematurely"}; +static const char *const words[] = { + "mortals", "foolish", "pallor", "cadaverous", "aura", + "foreboding", "metamorphosis", "disquieting", "observation", "dismaying", + "no", "windows", "no", "doors", "challenge", + "chilling", "way", "out", "way", "my", + "frighten", "prematurely"}; static const int nwords = sizeof (words) / sizeof (words[0]); #define NPAIRS ((sizeof (words) / sizeof (words[0])) / 2) @@ -48,9 +48,8 @@ static void verify (const char *id, bool (*func) (bslaw s), slaw x, int n, id); if ((c = slaw_list_count (x)) != n) - OB_FATAL_ERROR_CODE (0x20307004, - "%s: expected count %d but got %" OB_FMT_64 "d\n", id, - n, c); + OB_FATAL_ERROR_CODE ( + 0x20307004, "%s: expected count %d but got %" OB_FMT_64 "d\n", id, n, c); DO_CHECK ("mortals", "foolish"); DO_CHECK ("pallor", "cadaverous"); diff --git a/libPlasma/c/t/protein-saratoga.c b/libPlasma/c/t/protein-saratoga.c index ea2cbb1c..03128517 100644 --- a/libPlasma/c/t/protein-saratoga.c +++ b/libPlasma/c/t/protein-saratoga.c @@ -89,9 +89,9 @@ int main (int ac, char **av) protein_from_ff (empty_list (), slaw_map_inline (s[6], s[7], s[8], s[9], s[10], s[11], NULL)); - protein p5 = protein_from_ff (slaw_list_inline (s[12], s[13], s[14], NULL), - slaw_map_inline (s[15], s[16], s[17], s[18], - s[19], s[20], NULL)); + protein p5 = protein_from_ff ( + slaw_list_inline (s[12], s[13], s[14], NULL), + slaw_map_inline (s[15], s[16], s[17], s[18], s[19], s[20], NULL)); OBSERT (1 == slaw_list_count (protein_descrips (p1))); @@ -165,8 +165,8 @@ int main (int ac, char **av) OBSERT (protein_has_descrip_string (p3, "erg")); OBSERT (protein_has_descrip_string (p3, "furze")); OBSERT (!protein_has_descrip_string (p3, "gorse")); - OBSERT (0 <= protein_search (p3, f (slaw_list_inline_c ("dirge", "erg", - "furze", NULL)))); + OBSERT (0 <= protein_search ( + p3, f (slaw_list_inline_c ("dirge", "erg", "furze", NULL)))); OBSERT ( 0 <= protein_search (p3, f (slaw_list_inline_c ("erg", "furze", NULL)))); OBSERT ( @@ -267,8 +267,8 @@ int main (int ac, char **av) OBSERT (protein_has_descrip_string (p5, "nape")); OBSERT (protein_has_descrip_string (p5, "ooze")); OBSERT (!protein_has_descrip_string (p5, "pule")); - OBSERT (0 <= protein_search (p5, f (slaw_list_inline_c ("mumps", "nape", - "ooze", NULL)))); + OBSERT (0 <= protein_search ( + p5, f (slaw_list_inline_c ("mumps", "nape", "ooze", NULL)))); OBSERT ( 0 <= protein_search (p5, f (slaw_list_inline_c ("nape", "ooze", NULL)))); OBSERT ( diff --git a/libPlasma/c/t/simple-numerics.c b/libPlasma/c/t/simple-numerics.c index 544aa4a9..95423c9f 100644 --- a/libPlasma/c/t/simple-numerics.c +++ b/libPlasma/c/t/simple-numerics.c @@ -21,9 +21,9 @@ { \ type x = *slaw_##type##_emit (s); \ if (x != (num)) \ - OB_FATAL_ERROR_CODE (0x2030a003, "expected %" OB_FMT_64 \ - "d but got %" OB_FMT_64 "d\n", \ - (int64) (num), (int64) x); \ + OB_FATAL_ERROR_CODE ( \ + 0x2030a003, "expected %" OB_FMT_64 "d but got %" OB_FMT_64 "d\n", \ + (int64) (num), (int64) x); \ } \ slaw_free (s); diff --git a/libPlasma/c/t/slabu-list.c b/libPlasma/c/t/slabu-list.c index dc86247e..f5307d5d 100644 --- a/libPlasma/c/t/slabu-list.c +++ b/libPlasma/c/t/slabu-list.c @@ -75,9 +75,10 @@ static void test (int16 num) expected = i; if (x != expected) - OB_FATAL_ERROR_CODE (0x2030b001, "%" OB_FMT_64 "d" - " != %" OB_FMT_64 "d" - "\n", + OB_FATAL_ERROR_CODE (0x2030b001, + "%" OB_FMT_64 "d" + " != %" OB_FMT_64 "d" + "\n", x, expected); } @@ -113,8 +114,9 @@ static void test (int16 num) OB_DIE_ON_ERROR (slabu_list_add_c (sb, "banana")); x = slabu_list_find_c (sb, "banana"); if (x != slabu_count (sb) - 1) - OB_FATAL_ERROR_CODE (0x2030b004, "didn't expect banana at %" OB_FMT_64 "d" - "\n", + OB_FATAL_ERROR_CODE (0x2030b004, + "didn't expect banana at %" OB_FMT_64 "d" + "\n", x); tort = slabu_list_remove_c (sb, "panama"); diff --git a/libPlasma/c/t/slabu-map.c b/libPlasma/c/t/slabu-map.c index 07621c07..02822d80 100644 --- a/libPlasma/c/t/slabu-map.c +++ b/libPlasma/c/t/slabu-map.c @@ -178,9 +178,8 @@ int main (int argc, char **argv) test (sb); got = slabu_list_find_c (sb, "I am not a cons"); if (got != SLAW_NOT_FOUND) - OB_FATAL_ERROR_CODE (0x2030c010, - "expected SLAW_NOT_FOUND and got %" OB_FMT_64 "d\n", - got); + OB_FATAL_ERROR_CODE ( + 0x2030c010, "expected SLAW_NOT_FOUND and got %" OB_FMT_64 "d\n", got); slabu_free (sb); sb = slabu_new (); diff --git a/libPlasma/c/t/slaw-preakness.c b/libPlasma/c/t/slaw-preakness.c index b5361a08..31d105b9 100644 --- a/libPlasma/c/t/slaw-preakness.c +++ b/libPlasma/c/t/slaw-preakness.c @@ -488,14 +488,12 @@ int main (int ac, char **av) OBSERT (slawx_equal (s6, s6)); - protein p = - protein_from_ff (slaw_list_inline_c ("scribblers", "major", NULL), - slaw_map_inline_cc ("crank", "William Gaddis", - "philosopher", "William Gass", - "savant", "David Foster Wallace", - "mindman", "Nicholas Mosley", - "fabulist", "Harry Mathews", "gnarled", - "Samuel Beckett", NULL)); + protein p = protein_from_ff ( + slaw_list_inline_c ("scribblers", "major", NULL), + slaw_map_inline_cc ("crank", "William Gaddis", "philosopher", + "William Gass", "savant", "David Foster Wallace", + "mindman", "Nicholas Mosley", "fabulist", + "Harry Mathews", "gnarled", "Samuel Beckett", NULL)); OBSERT (NULL != p); fprintf (stderr, "molesting protein sans mercy...\n"); slaw s7 = slaw_dup (p); diff --git a/libPlasma/c/t/slumcat.c b/libPlasma/c/t/slumcat.c index 66105894..b5ea344c 100644 --- a/libPlasma/c/t/slumcat.c +++ b/libPlasma/c/t/slumcat.c @@ -56,10 +56,8 @@ OBSERT (NULL != sa2); \ OBSERT (NULL != sa3); \ OBSERT (NULL != sa4); \ - snumcat = \ - slaw_##vt##bt##ct##_arrays_concat_f (slaw_dup (sa1), slaw_dup (sa2), \ - slaw_dup (sa3), slaw_dup (sa4), \ - NULL); \ + snumcat = slaw_##vt##bt##ct##_arrays_concat_f ( \ + slaw_dup (sa1), slaw_dup (sa2), slaw_dup (sa3), slaw_dup (sa4), NULL); \ ptr##vt##bt##ct = \ (bt *) ((void *) slaw_##vt##bt##ct##_array_emit (snumcat)); \ \ diff --git a/libPlasma/c/t/slypes.c b/libPlasma/c/t/slypes.c index 7cb8e26d..fd62f4bc 100644 --- a/libPlasma/c/t/slypes.c +++ b/libPlasma/c/t/slypes.c @@ -105,8 +105,9 @@ int main (int ac, char **av) slaw snull = NULL; OBSERT (0 == gantlet_secular (snull, 0, 0, 0, 0, 0, 0)); - OBSERT (0 == gantlet_ecclesiastical (snull, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0)); + OBSERT (0 + == gantlet_ecclesiastical (snull, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0)); #define NUMPY(typ, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) \ typ n_##typ; \ @@ -118,10 +119,12 @@ int main (int ac, char **av) OBSERT (slaw_is_##typ (sn)); \ OBSERT (slaw_is_##typ##_array (sna)); \ OBSERT (!slaw_is_##typ (snull)); \ - OBSERT (0 == gantlet_ecclesiastical (sn, a, b, c, d, e, f, g, h, i, j, k, l, \ - m, n, o, 0, 1)); \ - OBSERT (0 == gantlet_ecclesiastical (sna, a, b, c, d, e, f, g, h, i, j, k, \ - l, m, n, o, 1, 0)); \ + OBSERT (0 \ + == gantlet_ecclesiastical (sn, a, b, c, d, e, f, g, h, i, j, k, l, \ + m, n, o, 0, 1)); \ + OBSERT (0 \ + == gantlet_ecclesiastical (sna, a, b, c, d, e, f, g, h, i, j, k, l, \ + m, n, o, 1, 0)); \ Free_Slaw (sn); \ Free_Slaw (sna); diff --git a/libPlasma/c/t/spew-test.c b/libPlasma/c/t/spew-test.c index 3d5e9e6b..e9455df8 100644 --- a/libPlasma/c/t/spew-test.c +++ b/libPlasma/c/t/spew-test.c @@ -124,17 +124,14 @@ static void add_spew (MyState *ms, const char *name, bslaw sl) static slaw make_map (void) { - slaw m1 = - slaw_map_inline_cc ("mortals", "foolish", "pallor", "cadaverous", "aura", - "foreboding", "metamorphosis", "disquieting", - "observation", "dismaying", NULL); - - slaw m2 = - slaw_map_inline_cf ("no", slaw_list_inline_c ("windows", "doors", NULL), - "challenge", slaw_string ("chilling"), "way", - slaw_list_inline_c ("out", "my", NULL), "frighten", - slaw_string ("prematurely"), "haunts", slaw_int16 (999), - NULL); + slaw m1 = slaw_map_inline_cc ( + "mortals", "foolish", "pallor", "cadaverous", "aura", "foreboding", + "metamorphosis", "disquieting", "observation", "dismaying", NULL); + + slaw m2 = slaw_map_inline_cf ( + "no", slaw_list_inline_c ("windows", "doors", NULL), "challenge", + slaw_string ("chilling"), "way", slaw_list_inline_c ("out", "my", NULL), + "frighten", slaw_string ("prematurely"), "haunts", slaw_int16 (999), NULL); slaw m3 = slaw_map_inline_ff (slaw_list_inline_c ("room", "for", NULL), slaw_unt32 (1000), slaw_string ("volunteers?"), diff --git a/libPlasma/c/t/test-interop.c b/libPlasma/c/t/test-interop.c index 5bdbcaef..6909d997 100644 --- a/libPlasma/c/t/test-interop.c +++ b/libPlasma/c/t/test-interop.c @@ -30,17 +30,14 @@ void do_check (bslaw expected) static slaw make_map (void) { - slaw m1 = - slaw_map_inline_cc ("mortals", "foolish", "pallor", "cadaverous", "aura", - "foreboding", "metamorphosis", "disquieting", - "observation", "dismaying", NULL); - - slaw m2 = - slaw_map_inline_cf ("no", slaw_list_inline_c ("windows", "doors", NULL), - "challenge", slaw_string ("chilling"), "way", - slaw_list_inline_c ("out", "my", NULL), "frighten", - slaw_string ("prematurely"), "haunts", slaw_int16 (999), - NULL); + slaw m1 = slaw_map_inline_cc ( + "mortals", "foolish", "pallor", "cadaverous", "aura", "foreboding", + "metamorphosis", "disquieting", "observation", "dismaying", NULL); + + slaw m2 = slaw_map_inline_cf ( + "no", slaw_list_inline_c ("windows", "doors", NULL), "challenge", + slaw_string ("chilling"), "way", slaw_list_inline_c ("out", "my", NULL), + "frighten", slaw_string ("prematurely"), "haunts", slaw_int16 (999), NULL); slaw m3 = slaw_map_inline_ff (slaw_list_inline_c ("room", "for", NULL), slaw_unt32 (1000), slaw_string ("volunteers?"), diff --git a/libPlasma/c/t/test-path.c b/libPlasma/c/t/test-path.c index 59ef274a..458f4b23 100644 --- a/libPlasma/c/t/test-path.c +++ b/libPlasma/c/t/test-path.c @@ -65,8 +65,9 @@ int main (int argc, char **argv) if (one != 1) { - fprintf (stderr, "one = %" OB_FMT_64 "d" - "\n", + fprintf (stderr, + "one = %" OB_FMT_64 "d" + "\n", one); OB_FATAL_ERROR_CODE (0x20313000, "one\n"); } diff --git a/libPlasma/c/t/test-slaw-io.c b/libPlasma/c/t/test-slaw-io.c index fed5a803..6a228749 100644 --- a/libPlasma/c/t/test-slaw-io.c +++ b/libPlasma/c/t/test-slaw-io.c @@ -56,9 +56,9 @@ static void slaw_playground (void) { slabu *sb; - something (__LINE__, - slaw_string ( - "http://ophelia.media.mit.edu/downloads/jamie-gspeak.m4v")); + something ( + __LINE__, + slaw_string ("http://ophelia.media.mit.edu/downloads/jamie-gspeak.m4v")); something (__LINE__, slaw_cons_ff (slaw_string ("QuacktimeBurper.cpp"), slaw_unt8 (97))); @@ -88,10 +88,9 @@ static void slaw_playground (void) const char *str = "'SetGWorld' is deprecated (declared at " "/System/Library/Frameworks/ApplicationServices.framework/" "Frameworks/QD.framework/Headers/QDOffscreen.h:254)"; - protein p = - protein_from_ff (slaw_list_inline_c (str, NULL), - slaw_map_inline_cf ("2 and beyond", - slaw_float32 (OB_POSINF), NULL)); + protein p = protein_from_ff ( + slaw_list_inline_c (str, NULL), + slaw_map_inline_cf ("2 and beyond", slaw_float32 (OB_POSINF), NULL)); something (__LINE__, p); // succeeds! diff --git a/libPlasma/c/t/test-string.c b/libPlasma/c/t/test-string.c index 3ae369df..2bc5af65 100644 --- a/libPlasma/c/t/test-string.c +++ b/libPlasma/c/t/test-string.c @@ -29,8 +29,9 @@ expected = strlen (str); \ really = slaw_string_emit_length (x); \ if (really != expected) \ - OB_FATAL_ERROR_CODE (0x20315004, "length was %" OB_FMT_64 \ - "d, but expected %" OB_FMT_64 "d\n", \ + OB_FATAL_ERROR_CODE (0x20315004, \ + "length was %" OB_FMT_64 \ + "d, but expected %" OB_FMT_64 "d\n", \ really, expected); \ actual = slaw_string_emit (x); \ if (!actual) \ @@ -157,18 +158,22 @@ int main (int argc, char **argv) EXPECT ("abcdefghijklmnopqrstuvwxyz7890123"); // is_valid_utf8 tests - s = slaw_string_format("%s", "it was the best of times it was the blurst of times"); - if (!slaw_string_is_valid_utf8((bslaw)s)) - OB_FATAL_ERROR_CODE(0x20315010, "'%s' is incorrectly marked as an invalid utf8 string\n", - slaw_string_emit(s)); - slaw_free(s); - - s = slaw_string_format("%s", "\xc3\x28 was the best of times it was the blurst of times"); - - if (slaw_string_is_valid_utf8((bslaw)s)) - OB_FATAL_ERROR_CODE(0x20315011, "'%s' is incorrectly marked as a valid utf8 string\n", - slaw_string_emit(s)); - slaw_free(s); + s = slaw_string_format ( + "%s", "it was the best of times it was the blurst of times"); + if (!slaw_string_is_valid_utf8 ((bslaw) s)) + OB_FATAL_ERROR_CODE ( + 0x20315010, "'%s' is incorrectly marked as an invalid utf8 string\n", + slaw_string_emit (s)); + slaw_free (s); + + s = slaw_string_format ( + "%s", "\xc3\x28 was the best of times it was the blurst of times"); + + if (slaw_string_is_valid_utf8 ((bslaw) s)) + OB_FATAL_ERROR_CODE (0x20315011, + "'%s' is incorrectly marked as a valid utf8 string\n", + slaw_string_emit (s)); + slaw_free (s); return EXIT_SUCCESS; } diff --git a/libPlasma/c/t/test-yaml.c b/libPlasma/c/t/test-yaml.c index aaa33d50..95e9a4c8 100644 --- a/libPlasma/c/t/test-yaml.c +++ b/libPlasma/c/t/test-yaml.c @@ -59,9 +59,9 @@ static int mainish (int argc, char **argv) // check that int64 and float64 are 8-byte aligned if (u1 % 8 != 0 || u2 % 8 != 0) - OB_FATAL_ERROR_CODE (0x20316009, "%" OB_FMT_64 "x or %" OB_FMT_64 - "x is not 8-byte aligned\n", - u1, u2); + OB_FATAL_ERROR_CODE ( + 0x20316009, "%" OB_FMT_64 "x or %" OB_FMT_64 "x is not 8-byte aligned\n", + u1, u2); slaw_free (s); slaw_free (s2); diff --git a/libPlasma/c/t/testcoerce.c b/libPlasma/c/t/testcoerce.c index 66852bdc..5985f7e8 100644 --- a/libPlasma/c/t/testcoerce.c +++ b/libPlasma/c/t/testcoerce.c @@ -134,14 +134,12 @@ int main (int argc, char **argv) err = slaw_to_unt64 (f (slaw_list_inline_c ("0x0015ed", NULL)), &x); report_unt64 ('r', x, err); - err = slaw_to_unt64 (f (slaw_int64_array_filled (1, OB_CONST_I64 ( - -4503599627370495))), - &x); + err = slaw_to_unt64 ( + f (slaw_int64_array_filled (1, OB_CONST_I64 (-4503599627370495))), &x); report_unt64 ('s', x, err); - err = slaw_to_unt64 (f (slaw_unt64_array_filled (1, OB_CONST_U64 ( - 4503599627370495))), - &x); + err = slaw_to_unt64 ( + f (slaw_unt64_array_filled (1, OB_CONST_U64 (4503599627370495))), &x); report_unt64 ('t', x, err); err = @@ -233,14 +231,12 @@ int main (int argc, char **argv) err = slaw_to_int64 (f (slaw_list_inline_c ("0x0015ed", NULL)), &y); report_int64 ('r', y, err); - err = slaw_to_int64 (f (slaw_int64_array_filled (1, OB_CONST_I64 ( - -4503599627370495))), - &y); + err = slaw_to_int64 ( + f (slaw_int64_array_filled (1, OB_CONST_I64 (-4503599627370495))), &y); report_int64 ('s', y, err); - err = slaw_to_int64 (f (slaw_unt64_array_filled (1, OB_CONST_U64 ( - 4503599627370495))), - &y); + err = slaw_to_int64 ( + f (slaw_unt64_array_filled (1, OB_CONST_U64 (4503599627370495))), &y); report_int64 ('t', y, err); err = @@ -333,14 +329,12 @@ int main (int argc, char **argv) err = slaw_to_float64 (f (slaw_list_inline_c ("0x0015ed", NULL)), &z); report_float64 ('r', z, err); - err = slaw_to_float64 (f (slaw_int64_array_filled (1, OB_CONST_I64 ( - -4503599627370495))), - &z); + err = slaw_to_float64 ( + f (slaw_int64_array_filled (1, OB_CONST_I64 (-4503599627370495))), &z); report_float64 ('s', z, err); - err = slaw_to_float64 (f (slaw_unt64_array_filled (1, OB_CONST_U64 ( - 4503599627370495))), - &z); + err = slaw_to_float64 ( + f (slaw_unt64_array_filled (1, OB_CONST_U64 (4503599627370495))), &z); report_float64 ('t', z, err); err = diff --git a/libPlasma/c/t/various-types.c b/libPlasma/c/t/various-types.c index 7fdb7374..b1c5812e 100644 --- a/libPlasma/c/t/various-types.c +++ b/libPlasma/c/t/various-types.c @@ -70,11 +70,10 @@ static void add_something (slabu *sb, int what, int how) x[2] = slaw_string (strerror (EEXIST)); x[3] = slaw_string (strerror (ENOENT)); x[4] = slaw_string (strerror (ENOSPC)); - s = slaw_map_inline_ff (slaw_string ("EINVAL"), x[0], - slaw_string ("ERANGE"), x[1], - slaw_string ("EEXIST"), x[2], - slaw_string ("ENOENT"), x[3], - slaw_string ("ENOSPC"), x[4], NULL); + s = slaw_map_inline_ff ( + slaw_string ("EINVAL"), x[0], slaw_string ("ERANGE"), x[1], + slaw_string ("EEXIST"), x[2], slaw_string ("ENOENT"), x[3], + slaw_string ("ENOSPC"), x[4], NULL); break; case 5: s = protein_from_ff (slaw_string ("descrips is not a list!"), @@ -180,13 +179,12 @@ static void add_something (slabu *sb, int what, int how) s = slaw_float64_array_filled (1, 3.14159); break; case 35: - s = protein_from_ff (NULL, slaw_list_inline_c ("descrips", "are", - "NULL", NULL)); + s = protein_from_ff ( + NULL, slaw_list_inline_c ("descrips", "are", "NULL", NULL)); break; case 36: - s = - protein_from_ff (slaw_list_inline_c ("ingests", "are", "NULL", NULL), - NULL); + s = protein_from_ff ( + slaw_list_inline_c ("ingests", "are", "NULL", NULL), NULL); break; case 37: b = 10; @@ -298,9 +296,9 @@ int main (int argc, char **argv) fprintf (stderr, "====================\n"); slaw_spew_overview_to_stderr (s1); fprintf (stderr, "\n====================\n"); - OB_FATAL_ERROR_CODE (0x20317002, "expected %" OB_FMT_64 - "d things and got %" OB_FMT_64 "d\n", - (int64) num_things, (int64) slaw_list_count (s1)); + OB_FATAL_ERROR_CODE ( + 0x20317002, "expected %" OB_FMT_64 "d things and got %" OB_FMT_64 "d\n", + (int64) num_things, (int64) slaw_list_count (s1)); } sb = slabu_new (); diff --git a/libPlasma/c/t/yaml-options.c b/libPlasma/c/t/yaml-options.c index 9fa0fb04..83769f42 100644 --- a/libPlasma/c/t/yaml-options.c +++ b/libPlasma/c/t/yaml-options.c @@ -16,17 +16,14 @@ static slaw make_map (void) { - slaw m1 = - slaw_map_inline_cc ("mortals", "foolish", "pallor", "cadaverous", "aura", - "foreboding", "metamorphosis", "disquieting", - "observation", "dismaying", NULL); - - slaw m2 = - slaw_map_inline_cf ("no", slaw_list_inline_c ("windows", "doors", NULL), - "challenge", slaw_string ("chilling"), "way", - slaw_list_inline_c ("out", "my", NULL), "frighten", - slaw_string ("prematurely"), "haunts", slaw_int16 (999), - NULL); + slaw m1 = slaw_map_inline_cc ( + "mortals", "foolish", "pallor", "cadaverous", "aura", "foreboding", + "metamorphosis", "disquieting", "observation", "dismaying", NULL); + + slaw m2 = slaw_map_inline_cf ( + "no", slaw_list_inline_c ("windows", "doors", NULL), "challenge", + slaw_string ("chilling"), "way", slaw_list_inline_c ("out", "my", NULL), + "frighten", slaw_string ("prematurely"), "haunts", slaw_int16 (999), NULL); slaw m3 = slaw_map_inline_ff (slaw_list_inline_c ("room", "for", NULL), slaw_unt32 (1000), slaw_string ("volunteers?"), @@ -55,9 +52,8 @@ static void verify (int id, slaw x, bool (*haunt_func) (bslaw s), OB_FATAL_ERROR_CODE (0x20319002, "%d: slaw_is_map (x) was false\n", id); if ((c = slaw_list_count (x)) != n) - OB_FATAL_ERROR_CODE (0x20319003, - "%d: expected count %d but got %" OB_FMT_64 "d\n", id, - n, c); + OB_FATAL_ERROR_CODE ( + 0x20319003, "%d: expected count %d but got %" OB_FMT_64 "d\n", id, n, c); DO_CHECK ("mortals", "foolish"); DO_CHECK ("pallor", "cadaverous"); diff --git a/libPlasma/c/tests/MiscPoolTest.cpp b/libPlasma/c/tests/MiscPoolTest.cpp index 50a86a6f..cac35a4b 100644 --- a/libPlasma/c/tests/MiscPoolTest.cpp +++ b/libPlasma/c/tests/MiscPoolTest.cpp @@ -42,11 +42,9 @@ TEST (MiscPoolTest, ParticipateOptions) pool_cmd_options_from_env (&cmd); EXPECT_TORTEQ (OB_OK, pool_create (cmd.pool_name, cmd.type, cmd.create_options)); - protein popt = - protein_from_ff (NULL, - slaw_map_inline_cc ("my favorite nonsense phrase", - "oblolate the syntax information", - NULL)); + protein popt = protein_from_ff ( + NULL, slaw_map_inline_cc ("my favorite nonsense phrase", + "oblolate the syntax information", NULL)); EXPECT_TORTEQ (OB_OK, pool_participate (cmd.pool_name, &cmd.ph, popt)); EXPECT_TORTEQ (OB_OK, pool_withdraw (cmd.ph)); EXPECT_TORTEQ (OB_OK, pool_dispose (cmd.pool_name)); @@ -187,9 +185,9 @@ TEST (MiscPoolTest, ZeroAwaitProbeFrwdNotFound) EXPECT_TORTEQ (OB_OK, pool_index (cmd.ph, &expected)); protein p; slaw srch = slaw_string ("bananagram"); - EXPECT_TORTEQ (POOL_AWAIT_TIMEDOUT, - pool_await_probe_frwd (cmd.ph, srch, POOL_NO_WAIT, &p, NULL, - NULL)); + EXPECT_TORTEQ ( + POOL_AWAIT_TIMEDOUT, + pool_await_probe_frwd (cmd.ph, srch, POOL_NO_WAIT, &p, NULL, NULL)); EXPECT_TORTEQ (OB_OK, pool_index (cmd.ph, &actual)); // expect index to be unchanged by failed pool_probe_frwd (bug 547 comment 1) EXPECT_EQ (expected, actual); @@ -213,9 +211,9 @@ TEST (MiscPoolTest, NonzeroAwaitProbeFrwdNotFound) EXPECT_TORTEQ (OB_OK, pool_index (cmd.ph, &expected)); protein p; slaw srch = slaw_string ("bananagram"); - EXPECT_EQ (POOL_AWAIT_TIMEDOUT, - pool_await_probe_frwd (cmd.ph, srch, 0.0000000001, &p, NULL, - NULL)); + EXPECT_EQ ( + POOL_AWAIT_TIMEDOUT, + pool_await_probe_frwd (cmd.ph, srch, 0.0000000001, &p, NULL, NULL)); EXPECT_TORTEQ (OB_OK, pool_index (cmd.ph, &actual)); // expect index to be unchanged by failed pool_probe_frwd (bug 547 comment 1) EXPECT_EQ (expected, actual); @@ -308,8 +306,8 @@ TEST (MiscPoolTest, GangManipulation) cmd.create_options)); jets_slaw.push_back (pool_name); pool_hose ph; - EXPECT_TORTEQ (OB_OK, pool_participate (slaw_string_emit (pool_name), &ph, - NULL)); + EXPECT_TORTEQ ( + OB_OK, pool_participate (slaw_string_emit (pool_name), &ph, NULL)); jets_hoses.push_back (ph); EXPECT_TORTEQ (OB_OK, pool_join_gang (gang, ph)); } @@ -328,9 +326,10 @@ TEST (MiscPoolTest, GangManipulation) sharks_slaw.push_back (pool_name); } #ifdef HAVE_STD_SHUFFLE - std::shuffle(jets_hoses.begin(), jets_hoses.end(), std::mt19937{std::random_device{}()}); + std::shuffle (jets_hoses.begin (), jets_hoses.end (), + std::mt19937{std::random_device{}()}); #else - std::random_shuffle (jets_hoses.begin (), jets_hoses.end ()); + std::random_shuffle (jets_hoses.begin (), jets_hoses.end ()); #endif @@ -353,7 +352,8 @@ TEST (MiscPoolTest, GangManipulation) } EXPECT_EQ (5, pool_gang_count (gang)); #ifdef HAVE_STD_SHUFFLE - std::shuffle(sharks_hoses.begin(), sharks_hoses.end(), std::mt19937{std::random_device{}()}); + std::shuffle (sharks_hoses.begin (), sharks_hoses.end (), + std::mt19937{std::random_device{}()}); #else std::random_shuffle (sharks_hoses.begin (), sharks_hoses.end ()); #endif @@ -421,12 +421,10 @@ static void *fowl (void *v) for (int64 i = 0; i < FOWL_ITERATIONS; i++) { bool is_goose = (ob_rand_state_float64 (0.0, 1.0, r) > 0.9); - protein p = - protein_from_ff (slaw_list_inline_c (is_goose ? "goose" : "duck", NULL), - slaw_map_inline_cf ("last-duck", - slaw_int64 (f->last_duck), - "last-goose", - slaw_int64 (f->last_goose), NULL)); + protein p = protein_from_ff ( + slaw_list_inline_c (is_goose ? "goose" : "duck", NULL), + slaw_map_inline_cf ("last-duck", slaw_int64 (f->last_duck), + "last-goose", slaw_int64 (f->last_goose), NULL)); int64 idx = -1; EXPECT_TORTEQ (OB_OK, pool_deposit (ph, p, &idx)); EXPECT_EQ (i, idx); @@ -531,9 +529,8 @@ static void deposit_100_proteins (pool_hose ph) for (i = 0; i < 100; i++) { - protein p = - protein_from_lf (descrips, - slaw_map_inline_cf ("n", slaw_int64 (i), NULL)); + protein p = protein_from_lf ( + descrips, slaw_map_inline_cf ("n", slaw_int64 (i), NULL)); EXPECT_TORTEQ (OB_OK, pool_deposit (ph, p, NULL)); protein_free (p); } @@ -1731,8 +1728,8 @@ TEST (MiscPoolTest, ClientCertificateInContext) EXPECT_TORTEQ (OB_OK, pool_new_context (&ctx)); EXPECT_TORTEQ (OB_OK, pool_ctx_set_options (ctx, options)); pool_cmd_options_from_env (&cmd); - EXPECT_TORTEQ (OB_OK, pool_create_ctx (cmd.pool_name, cmd.type, - cmd.create_options, ctx)); + EXPECT_TORTEQ ( + OB_OK, pool_create_ctx (cmd.pool_name, cmd.type, cmd.create_options, ctx)); EXPECT_TORTEQ (OB_YES, pool_exists_ctx (cmd.pool_name, ctx)); EXPECT_TORTEQ (OB_OK, pool_dispose_ctx (cmd.pool_name, ctx)); EXPECT_TORTEQ (OB_NO, pool_exists_ctx (cmd.pool_name, ctx)); diff --git a/libPlasma/c/tests/RecentServerOnly.cpp b/libPlasma/c/tests/RecentServerOnly.cpp index 819125e0..033e5df4 100644 --- a/libPlasma/c/tests/RecentServerOnly.cpp +++ b/libPlasma/c/tests/RecentServerOnly.cpp @@ -23,10 +23,8 @@ static void require_resizable (pool_cmd_info *cmd) { slaw re = slaw_map_inline_cf ("resizable", slaw_boolean (true), "single-file", slaw_boolean (true), NULL); - protein p = - protein_from_ff (NULL, - slaw_maps_merge (protein_ingests (cmd->create_options), re, - NULL)); + protein p = protein_from_ff ( + NULL, slaw_maps_merge (protein_ingests (cmd->create_options), re, NULL)); Free_Protein (cmd->create_options); cmd->create_options = p; slaw_free (re); @@ -43,10 +41,9 @@ TEST (RecentServerOnly, FailedPermissionize) pool_cmd_info cmd; slaw perm = slaw_map_inline_cc ("owner", "root", NULL); pool_cmd_options_from_env (&cmd); - protein opts = - protein_from_ff (NULL, - slaw_maps_merge (protein_ingests (cmd.create_options), - perm, NULL)); + protein opts = protein_from_ff ( + NULL, + slaw_maps_merge (protein_ingests (cmd.create_options), perm, NULL)); const ob_retort expected = ob_errno_to_retort (EPERM); const ob_retort actual = pool_create (cmd.pool_name, cmd.type, opts); EXPECT_TORTEQ (expected, actual); @@ -167,9 +164,7 @@ static void no_nested_pool (swap_func maybe_swap) pool_cmd_free_options (&cmd); } -static void dont_swap (slaw &a, slaw &b) -{ -} +static void dont_swap (slaw &a, slaw &b) {} static void do_swap (slaw &a, slaw &b) { @@ -801,51 +796,51 @@ static void *deposit_one_protein (void *arg) return NULL; } -static const char *const weird_names[] = - {"foobar", - "foo/bar", - "foo.bar", - "Something with spaces in it!", - "^^^ I like hats ^^^", - "f", - "I am a legal pool name ;)", - "This used to not be legal... but now it is!", - "$100", - "commercial", - "conscience", - "null", - "LPT1 is not legal as a pool name, but it's okay as part of a longer name", - "a name with in it", - "a name with ! in it", - "a name with # in it", - "a name with $ in it", - "a name with % in it", - "a name with & in it", - "a name with ' in it", - "a name with ( in it", - "a name with ) in it", - "a name with + in it", - "a name with , in it", - "a name with - in it", - "a name with . in it", - "a name with ; in it", - "a name with = in it", - "a name with @ in it", - "a name with [ in it", - "a name with ] in it", - "a name with ^ in it", - "a name with _ in it", - "a name with ` in it", - "a name with { in it", - "a name with } in it", - "a name with ~ in it", - " the final frontier", - "CONOUT", - "foo/COM10/bar", - "AUX1", - "COM0", - "LPT0", - "Trey thinks no one will put %s/or %f/or worse, %n/in a pool name"}; +static const char *const weird_names[] = { + "foobar", + "foo/bar", + "foo.bar", + "Something with spaces in it!", + "^^^ I like hats ^^^", + "f", + "I am a legal pool name ;)", + "This used to not be legal... but now it is!", + "$100", + "commercial", + "conscience", + "null", + "LPT1 is not legal as a pool name, but it's okay as part of a longer name", + "a name with in it", + "a name with ! in it", + "a name with # in it", + "a name with $ in it", + "a name with % in it", + "a name with & in it", + "a name with ' in it", + "a name with ( in it", + "a name with ) in it", + "a name with + in it", + "a name with , in it", + "a name with - in it", + "a name with . in it", + "a name with ; in it", + "a name with = in it", + "a name with @ in it", + "a name with [ in it", + "a name with ] in it", + "a name with ^ in it", + "a name with _ in it", + "a name with ` in it", + "a name with { in it", + "a name with } in it", + "a name with ~ in it", + " the final frontier", + "CONOUT", + "foo/COM10/bar", + "AUX1", + "COM0", + "LPT0", + "Trey thinks no one will put %s/or %f/or worse, %n/in a pool name"}; TEST (RecentServerOnly, WeirdPoolNames) { @@ -889,8 +884,8 @@ TEST (RecentServerOnly, WeirdPoolNames) { protein p = NULL; pthread_t thr; - EXPECT_EQ (0, pthread_create (&thr, NULL, deposit_one_protein, - (void *) name)); + EXPECT_EQ ( + 0, pthread_create (&thr, NULL, deposit_one_protein, (void *) name)); EXPECT_TORTEQ (OB_OK, pool_await_next (ph, 600, &p, NULL, NULL)); EXPECT_EQ (0, pthread_join (thr, NULL)); Free_Protein (p); @@ -1163,17 +1158,16 @@ static protein toupee (void) { return protein_from_ff ( slaw_list_inline_c ("limerick", NULL), - slaw_map_inline_cf ("author", slaw_string ("jh"), "president", - slaw_string ("Leslie Lynch King, Jr."), "bug", - slaw_unt16 (2072), "text", - slaw_list_inline_c ("ford kept reporters at bay", - "through use of a robo-toupee:", - "when questioned, he'd shrug", - "and say \"talk to the rug\",", - "which then said \"no comment " - "today\".", - NULL), - NULL)); + slaw_map_inline_cf ( + "author", slaw_string ("jh"), "president", + slaw_string ("Leslie Lynch King, Jr."), "bug", slaw_unt16 (2072), "text", + slaw_list_inline_c ( + "ford kept reporters at bay", "through use of a robo-toupee:", + "when questioned, he'd shrug", "and say \"talk to the rug\",", + "which then said \"no comment " + "today\".", + NULL), + NULL)); } TEST (RecentServerOnly, StopWhenFull) @@ -1183,10 +1177,8 @@ TEST (RecentServerOnly, StopWhenFull) require_resizable (&cmd); slaw stop = slaw_map_inline_cf ("stop-when-full", slaw_boolean (true), NULL); - protein opts = - protein_from_ff (NULL, - slaw_maps_merge (protein_ingests (cmd.create_options), - stop, NULL)); + protein opts = protein_from_ff ( + NULL, slaw_maps_merge (protein_ingests (cmd.create_options), stop, NULL)); Free_Slaw (stop); EXPECT_TORTEQ (OB_OK, pool_create (cmd.pool_name, cmd.type, opts)); diff --git a/libPlasma/c/tests/TocUnitTest.cpp b/libPlasma/c/tests/TocUnitTest.cpp index e5d7af5d..05f21335 100644 --- a/libPlasma/c/tests/TocUnitTest.cpp +++ b/libPlasma/c/tests/TocUnitTest.cpp @@ -28,8 +28,8 @@ static pool_toc_entry check_entry (const pool_toc_t *pi, pool_timestamp ts, const pool_toc_entry &low) { pool_toc_entry l = POOL_TOC_NULL_ENTRY, u = POOL_TOC_NULL_ENTRY; - EXPECT_TRUE (pool_toc_find_timestamp (pi, ts, &l, &u)) << "Seeking timestamp " - << ts; + EXPECT_TRUE (pool_toc_find_timestamp (pi, ts, &l, &u)) + << "Seeking timestamp " << ts; EXPECT_EQ (low, l); if (!POOL_TOC_ENTRY_NULL_P (l)) @@ -57,12 +57,11 @@ static void check_entry (const pool_toc_t *pi, const pool_toc_entry &entry) // Fixtures -pool_toc_entry test_data[] = {{0, 1, 0.11}, {1, 19, 0.2}, - {2, 21, 0.33}, {3, 31, 50.40002}, - {4, 32, 284.6}, {5, 33, 3231.0216}, - {6, 42, 3233}, {7, 543, 3233.001}, - {8, 552, 3240.2}, {9, 6000, 10000.1}, - {10, 6001, 10000.2}, {11, 6002, 10001.1}}; +pool_toc_entry test_data[] = { + {0, 1, 0.11}, {1, 19, 0.2}, {2, 21, 0.33}, + {3, 31, 50.40002}, {4, 32, 284.6}, {5, 33, 3231.0216}, + {6, 42, 3233}, {7, 543, 3233.001}, {8, 552, 3240.2}, + {9, 6000, 10000.1}, {10, 6001, 10000.2}, {11, 6002, 10001.1}}; static const unt64 TESTDN = sizeof (test_data) / sizeof (test_data[0]); @@ -148,9 +147,8 @@ TEST (TocUnitTest, Monotonic) (i < TESTDN - 1) ? test_data[i + 1].stamp - test_data[i].stamp : 1; for (int k = 0; k < K; ++k) { - pool_toc_entry e = - check_entry (pi, test_data[i].stamp + SHIFTS[k] * delta, - test_data[i]); + pool_toc_entry e = check_entry ( + pi, test_data[i].stamp + SHIFTS[k] * delta, test_data[i]); if (i < TESTDN - 1) EXPECT_EQ (e, test_data[i + 1]); else @@ -162,16 +160,14 @@ TEST (TocUnitTest, Monotonic) { if (i > 0) { - pool_toc_entry e = - check_entry (pi, test_data[i].stamp - SHIFTS[k] * delta, - test_data[i - 1]); + pool_toc_entry e = check_entry ( + pi, test_data[i].stamp - SHIFTS[k] * delta, test_data[i - 1]); EXPECT_EQ (e, test_data[i]); } else { - pool_toc_entry e = - check_entry (pi, test_data[0].stamp - SHIFTS[k], - POOL_TOC_NULL_ENTRY); + pool_toc_entry e = check_entry ( + pi, test_data[0].stamp - SHIFTS[k], POOL_TOC_NULL_ENTRY); EXPECT_EQ (e, test_data[0]); } } diff --git a/libPlasma/c/tests/check-stepsize-behavior.c b/libPlasma/c/tests/check-stepsize-behavior.c index 27d2f525..b11c1592 100644 --- a/libPlasma/c/tests/check-stepsize-behavior.c +++ b/libPlasma/c/tests/check-stepsize-behavior.c @@ -15,10 +15,11 @@ static void usage (void) { - fprintf (stderr, "Usage: check-stepsize-behavior [-t ] [-s ] " - "[-i ] \n" - "\t defaults to \"mmap\"\n" - "\t defaults to %" OB_FMT_64 "u bytes\n", + fprintf (stderr, + "Usage: check-stepsize-behavior [-t ] [-s ] " + "[-i ] \n" + "\t defaults to \"mmap\"\n" + "\t defaults to %" OB_FMT_64 "u bytes\n", (unt64) POOL_MMAP_DEFAULT_SIZE); exit (EXIT_FAILURE); } @@ -31,7 +32,7 @@ static int mainish (int argc, char **argv) protein terminal_info = NULL; unt64 stepsize; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:s:t:v")) != -1) { @@ -68,15 +69,12 @@ static int mainish (int argc, char **argv) // Let's make a protein slightly bigger than half the pool int ret = EXIT_SUCCESS; - protein p = - protein_from_ff (slaw_list_inline_c ("There should be room for one of", - "these proteins, but not two of", - "these proteins in the pool at once.", - NULL), - slaw_map_inline_cf ("very large array", - slaw_int8_array_filled (cmd.size / 2, - -1), - NULL)); + protein p = protein_from_ff ( + slaw_list_inline_c ("There should be room for one of", + "these proteins, but not two of", + "these proteins in the pool at once.", NULL), + slaw_map_inline_cf ("very large array", + slaw_int8_array_filled (cmd.size / 2, -1), NULL)); for (idx = 0; idx < cmd.toc_capacity * 10; idx++) if (OB_OK != (pret = pool_deposit (cmd.ph, p, NULL))) diff --git a/libPlasma/c/tests/deposit-timestamp.c b/libPlasma/c/tests/deposit-timestamp.c index 0ce9969f..4529ccfc 100644 --- a/libPlasma/c/tests/deposit-timestamp.c +++ b/libPlasma/c/tests/deposit-timestamp.c @@ -31,7 +31,7 @@ int mainish (int argc, char *argv[]) pool_timestamp ret_ts, dep_ts; int64 ret_idx, dep_idx; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:s:t:")) != -1) { @@ -81,8 +81,9 @@ int mainish (int argc, char *argv[]) if (pret != OB_OK) { - OB_LOG_ERROR_CODE (0x20402002, "pool_rewind returned %s, " - "but expected OB_OK\n", + OB_LOG_ERROR_CODE (0x20402002, + "pool_rewind returned %s, " + "but expected OB_OK\n", ob_error_string (pret)); retcode = EXIT_FAILURE; goto cleanup; @@ -92,8 +93,9 @@ int mainish (int argc, char *argv[]) if (pret != OB_OK) { - OB_LOG_ERROR_CODE (0x20402003, "pool_next returned %s, " - "but expected OB_OK\n", + OB_LOG_ERROR_CODE (0x20402003, + "pool_next returned %s, " + "but expected OB_OK\n", ob_error_string (pret)); retcode = EXIT_FAILURE; goto cleanup; @@ -101,8 +103,9 @@ int mainish (int argc, char *argv[]) if (ret_idx != dep_idx) { - OB_LOG_ERROR_CODE (0x20402004, "dep_idx was %" OB_FMT_64 - "d, but ret_idx was %" OB_FMT_64 "d\n", + OB_LOG_ERROR_CODE (0x20402004, + "dep_idx was %" OB_FMT_64 + "d, but ret_idx was %" OB_FMT_64 "d\n", dep_idx, ret_idx); retcode = EXIT_FAILURE; } diff --git a/libPlasma/c/tests/doppelganger.c b/libPlasma/c/tests/doppelganger.c index 7827759f..0981831c 100644 --- a/libPlasma/c/tests/doppelganger.c +++ b/libPlasma/c/tests/doppelganger.c @@ -21,7 +21,7 @@ int mainish (int argc, char *argv[]) pool_cmd_info cmd; ob_retort pret; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); // ob_log_to_file ("/dev/tty"); if (pool_cmd_get_poolname (&cmd, argc, argv, optind)) @@ -96,9 +96,10 @@ int mainish (int argc, char *argv[]) ob_log (OBLV_DBUG, 0x2040300f, "Joining gang with second hose...\n"); pret = pool_join_gang (crips, cmd2.ph); if (pret != OB_OK) - OB_FATAL_ERROR_CODE (0x20403010, "Second pool hose for %s failed to join " - "gang: %" OB_FMT_RETORT "d" - "\n", + OB_FATAL_ERROR_CODE (0x20403010, + "Second pool hose for %s failed to join " + "gang: %" OB_FMT_RETORT "d" + "\n", cmd2.pool_name, pret); protein prot; diff --git a/libPlasma/c/tests/empty-gang.c b/libPlasma/c/tests/empty-gang.c index d3840701..2c999f41 100644 --- a/libPlasma/c/tests/empty-gang.c +++ b/libPlasma/c/tests/empty-gang.c @@ -15,16 +15,14 @@ int main (int argc, char **argv) OB_DIE_ON_ERROR (pool_new_gang (&jets)); ob_retort err = pool_next_multi (jets, NULL, NULL, NULL, NULL); if (err != POOL_EMPTY_GANG) - OB_FATAL_ERROR_CODE (0x20404000, - "pool_next_multi: Got %s but expected %s\n", - ob_error_string (err), - ob_error_string (POOL_EMPTY_GANG)); + OB_FATAL_ERROR_CODE ( + 0x20404000, "pool_next_multi: Got %s but expected %s\n", + ob_error_string (err), ob_error_string (POOL_EMPTY_GANG)); err = pool_await_next_multi (jets, 0, NULL, NULL, NULL, NULL); if (err != POOL_EMPTY_GANG) - OB_FATAL_ERROR_CODE (0x20404001, - "pool_await_next_multi: Got %s but expected %s\n", - ob_error_string (err), - ob_error_string (POOL_EMPTY_GANG)); + OB_FATAL_ERROR_CODE ( + 0x20404001, "pool_await_next_multi: Got %s but expected %s\n", + ob_error_string (err), ob_error_string (POOL_EMPTY_GANG)); OB_DIE_ON_ERROR (pool_disband_gang (jets, true)); return EXIT_SUCCESS; diff --git a/libPlasma/c/tests/many_creates.c b/libPlasma/c/tests/many_creates.c index 11fa5b85..e93b7a52 100644 --- a/libPlasma/c/tests/many_creates.c +++ b/libPlasma/c/tests/many_creates.c @@ -51,12 +51,14 @@ static void warn_about_semaphores (void) if (OB_OK == slaw_to_int64 (slabu_list_nth (sb, 3), &semsets) && semsets < creates) { - fprintf (stderr, "warning: %d semaphore sets are needed, and you " - "only have %" OB_FMT_64 "d\n", + fprintf (stderr, + "warning: %d semaphore sets are needed, and you " + "only have %" OB_FMT_64 "d\n", creates, semsets); fprintf (stderr, "If this test fails, try this:\n"); - fprintf (stderr, "sudo sh -c 'echo %s %s %s %" OB_FMT_64 - "d > /proc/sys/kernel/sem'\n", + fprintf (stderr, + "sudo sh -c 'echo %s %s %s %" OB_FMT_64 + "d > /proc/sys/kernel/sem'\n", slaw_string_emit (slabu_list_nth (sb, 0)), slaw_string_emit (slabu_list_nth (sb, 1)), slaw_string_emit (slabu_list_nth (sb, 2)), creates + semsets); @@ -78,7 +80,7 @@ int main (int argc, char **argv) pool_cmd_info cmd; int c; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:n:s:t:")) != -1) { switch (c) @@ -120,8 +122,9 @@ int main (int argc, char **argv) if (cmd.verbose) printf ("%d\n", i); if (pret < OB_OK) - OB_FATAL_ERROR_CODE (0x20405000, "no can create %s (%" OB_FMT_64 "u" - "): %s\n", + OB_FATAL_ERROR_CODE (0x20405000, + "no can create %s (%" OB_FMT_64 "u" + "): %s\n", cmd.pool_name, cmd.size, ob_error_string (pret)); // While we're at it, participate and withdraw, too pool_cmd_open_pool (&cmd); @@ -133,8 +136,9 @@ int main (int argc, char **argv) cmd.pool_name, cmd.size, ob_error_string (pret)); pret = pool_dispose (cmd.pool_name); if (pret < OB_OK) - OB_FATAL_ERROR_CODE (0x20405002, "no can dispose %s (%" OB_FMT_64 "u" - "): %s\n", + OB_FATAL_ERROR_CODE (0x20405002, + "no can dispose %s (%" OB_FMT_64 "u" + "): %s\n", cmd.pool_name, cmd.size, ob_error_string (pret)); } @@ -169,8 +173,9 @@ int main (int argc, char **argv) printf ("%d\n", i); ob_retort pret = pool_dispose (poolName); if (pret != OB_OK) - OB_FATAL_ERROR_CODE (0x20405005, "no can dispose %s (%" OB_FMT_64 "u" - "): %s\n", + OB_FATAL_ERROR_CODE (0x20405005, + "no can dispose %s (%" OB_FMT_64 "u" + "): %s\n", poolName, cmd.size, ob_error_string (pret)); } diff --git a/libPlasma/c/tests/null_test.c b/libPlasma/c/tests/null_test.c index ad6c184a..9c4f4f34 100644 --- a/libPlasma/c/tests/null_test.c +++ b/libPlasma/c/tests/null_test.c @@ -35,7 +35,7 @@ int mainish (int argc, char *argv[]) int64 idx; int c; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:s:t:")) != -1) { switch (c) @@ -83,22 +83,25 @@ int mainish (int argc, char *argv[]) pret = pool_next (ph, &curr_prot, NULL, NULL); if (pret != OB_OK) - OB_FATAL_ERROR_CODE (0x20408001, "pool_next with null timestamp and index " - "addr failed: %s\n", + OB_FATAL_ERROR_CODE (0x20408001, + "pool_next with null timestamp and index " + "addr failed: %s\n", ob_error_string (pret)); Free_Protein (curr_prot); pret = pool_prev (ph, &curr_prot, NULL, NULL); if (pret != OB_OK) - OB_FATAL_ERROR_CODE (0x20408002, "pool_prev with null timestamp and index " - "addr failed: %s\n", + OB_FATAL_ERROR_CODE (0x20408002, + "pool_prev with null timestamp and index " + "addr failed: %s\n", ob_error_string (pret)); Free_Protein (curr_prot); pret = pool_await_next (ph, 0, &curr_prot, NULL, NULL); if (pret != OB_OK) - OB_FATAL_ERROR_CODE (0x20408003, "pool_next with null timestamp and index " - "addr failed: %s\n", + OB_FATAL_ERROR_CODE (0x20408003, + "pool_next with null timestamp and index " + "addr failed: %s\n", ob_error_string (pret)); Free_Protein (curr_prot); @@ -108,22 +111,25 @@ int mainish (int argc, char *argv[]) pret = pool_next (ph, &curr_prot, &ts, &idx); if ((pret != OB_OK) || (ts == 0) || idx != 0) - OB_FATAL_ERROR_CODE (0x20408004, "pool_next with non-null timestamp and " - "index addr failed: %s\n", + OB_FATAL_ERROR_CODE (0x20408004, + "pool_next with non-null timestamp and " + "index addr failed: %s\n", ob_error_string (pret)); Free_Protein (curr_prot); pret = pool_prev (ph, &curr_prot, &ts, &idx); if ((pret != OB_OK) || (ts == 0) || idx != 0) - OB_FATAL_ERROR_CODE (0x20408005, "pool_prev with null timestamp and index " - "addr failed: %s\n", + OB_FATAL_ERROR_CODE (0x20408005, + "pool_prev with null timestamp and index " + "addr failed: %s\n", ob_error_string (pret)); Free_Protein (curr_prot); pret = pool_await_next (ph, 0, &curr_prot, &ts, &idx); if ((pret != OB_OK) || (ts == 0) || idx != 0) - OB_FATAL_ERROR_CODE (0x20408006, "pool_next with null timestamp and index " - "addr failed: %s\n", + OB_FATAL_ERROR_CODE (0x20408006, + "pool_next with null timestamp and index " + "addr failed: %s\n", ob_error_string (pret)); Free_Protein (curr_prot); diff --git a/libPlasma/c/tests/participate_create.c b/libPlasma/c/tests/participate_create.c index 2e3ed2a7..be19edff 100644 --- a/libPlasma/c/tests/participate_create.c +++ b/libPlasma/c/tests/participate_create.c @@ -19,7 +19,7 @@ int mainish (int argc, char **argv) int c; ob_retort expected; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:s:t:")) != -1) { switch (c) diff --git a/libPlasma/c/tests/pingpong_test.c b/libPlasma/c/tests/pingpong_test.c index d1419d8e..07f2e3e8 100644 --- a/libPlasma/c/tests/pingpong_test.c +++ b/libPlasma/c/tests/pingpong_test.c @@ -352,10 +352,8 @@ static void test_resize (void) static void require_resizable (pool_cmd_info *pci) { slaw re = slaw_map_inline_cf ("resizable", slaw_boolean (true), NULL); - protein p = - protein_from_ff (NULL, - slaw_maps_merge (protein_ingests (pci->create_options), re, - NULL)); + protein p = protein_from_ff ( + NULL, slaw_maps_merge (protein_ingests (pci->create_options), re, NULL)); Free_Protein (pci->create_options); pci->create_options = p; slaw_free (re); @@ -444,9 +442,8 @@ int main (int argc, char *argv[]) { // let's get something in those pools to make it more challenging pool_hose ph; - OB_DIE_ON_ERROR (pool_participate_creatingly (pool_names[i], cmd.type, - &ph, - cmd.create_options)); + OB_DIE_ON_ERROR (pool_participate_creatingly ( + pool_names[i], cmd.type, &ph, cmd.create_options)); // Fill pool almost full, but not quite // (So can't call pool_cmd_fill_pool(), which will wrap) const int goal = 7000; diff --git a/libPlasma/c/tests/pool-log-test.c b/libPlasma/c/tests/pool-log-test.c index 2c33bbbc..4ea45cb5 100644 --- a/libPlasma/c/tests/pool-log-test.c +++ b/libPlasma/c/tests/pool-log-test.c @@ -14,38 +14,38 @@ #include "libPlasma/c/protein.h" #include "libPlasma/c/slaw.h" -static ob_log_level my_log = - {OB_DST_FD | OB_FLG_SHOW_CODE_OR_WHERE | OB_FLG_SHOW_TID_NONMAIN, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED, /* red */ - LOG_ERR, - 2, - "test: ", - NULL, - NULL, - NULL, - NULL}; - -static ob_log_level red_log = - {OB_DST_FD | OB_FLG_SHOW_TID_NONMAIN, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED, /* red */ - LOG_ERR, - 2, - "", - NULL, - NULL, - NULL, - NULL}; - -static ob_log_level yellow_log = - {OB_DST_FD | OB_FLG_SHOW_TID_NONMAIN, - OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED | OB_FOREGROUND_GREEN, /* yellow */ - LOG_ERR, - 2, - "", - NULL, - NULL, - NULL, - NULL}; +static ob_log_level my_log = { + OB_DST_FD | OB_FLG_SHOW_CODE_OR_WHERE | OB_FLG_SHOW_TID_NONMAIN, + OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED, /* red */ + LOG_ERR, + 2, + "test: ", + NULL, + NULL, + NULL, + NULL}; + +static ob_log_level red_log = {OB_DST_FD | OB_FLG_SHOW_TID_NONMAIN, + OB_FOREGROUND_ENABLE + | OB_FOREGROUND_RED, /* red */ + LOG_ERR, + 2, + "", + NULL, + NULL, + NULL, + NULL}; + +static ob_log_level yellow_log = {OB_DST_FD | OB_FLG_SHOW_TID_NONMAIN, + OB_FOREGROUND_ENABLE | OB_FOREGROUND_RED + | OB_FOREGROUND_GREEN, /* yellow */ + LOG_ERR, + 2, + "", + NULL, + NULL, + NULL, + NULL}; static ob_log_level limited_log = {OB_DST_FD | OB_FLG_SHOW_TID_NONMAIN, 0, /* no color */ @@ -215,7 +215,7 @@ int main (int argc, char **argv) int ret = EXIT_SUCCESS; int64 l[3]; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:s:t:")) != -1) { switch (c) diff --git a/libPlasma/c/tests/random-access-test.c b/libPlasma/c/tests/random-access-test.c index 3bd62a75..3472d232 100644 --- a/libPlasma/c/tests/random-access-test.c +++ b/libPlasma/c/tests/random-access-test.c @@ -38,9 +38,8 @@ static void *thread_main (void *ignored) protein p = protein_from_ff (NULL, ingests); OB_DIE_ON_ERROR (pool_deposit (hose, p, &idx)); if (idx != i) - OB_FATAL_ERROR_CODE (0x2040c000, - "idx = %" OB_FMT_64 "d, i = %" OB_FMT_64 "d\n", - idx, i); + OB_FATAL_ERROR_CODE ( + 0x2040c000, "idx = %" OB_FMT_64 "d, i = %" OB_FMT_64 "d\n", idx, i); OB_DIE_ON_ERROR (pool_oldest_index (hose, &oldest)); if (oldest > i) OB_FATAL_ERROR_CODE (0x2040c001, @@ -69,7 +68,7 @@ int mainish (int argc, char *argv[]) int64 proteins_attempted = 0; bool valgrind = false; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:s:t:S")) != -1) { switch (c) @@ -160,9 +159,9 @@ int mainish (int argc, char *argv[]) } if (oldest <= idx) { - OB_LOG_ERROR_CODE (0x2040c006, "oldest = %" OB_FMT_64 - "d, idx = %" OB_FMT_64 "d\n", - oldest, idx); + OB_LOG_ERROR_CODE ( + 0x2040c006, "oldest = %" OB_FMT_64 "d, idx = %" OB_FMT_64 "d\n", + oldest, idx); retcode = EXIT_FAILURE; goto thread_cleanup; } @@ -179,8 +178,9 @@ int mainish (int argc, char *argv[]) int64 contents = slaw_path_get_int64 (p, "bad wolf", -456); if (contents != idx) { - OB_LOG_ERROR_CODE (0x2040c008, "contents = %" OB_FMT_64 - "d, idx = %" OB_FMT_64 "d\n", + OB_LOG_ERROR_CODE (0x2040c008, + "contents = %" OB_FMT_64 "d, idx = %" OB_FMT_64 + "d\n", contents, idx); retcode = EXIT_FAILURE; goto thread_cleanup; diff --git a/libPlasma/c/tests/rewind_test.c b/libPlasma/c/tests/rewind_test.c index a2a0d7a7..78693712 100644 --- a/libPlasma/c/tests/rewind_test.c +++ b/libPlasma/c/tests/rewind_test.c @@ -30,7 +30,7 @@ int mainish (int argc, char *argv[]) const char *actual; const char *expected; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:s:t:")) != -1) { switch (c) @@ -71,8 +71,9 @@ int mainish (int argc, char *argv[]) if (pret != OB_OK) { - OB_LOG_ERROR_CODE (0x2040d001, "pool_rewind on empty pool returned %s, " - "but expected OB_OK\n", + OB_LOG_ERROR_CODE (0x2040d001, + "pool_rewind on empty pool returned %s, " + "but expected OB_OK\n", ob_error_string (pret)); retcode = EXIT_FAILURE; goto cleanup; diff --git a/libPlasma/c/tests/seek_test.c b/libPlasma/c/tests/seek_test.c index bf7ab43f..b6516e1a 100644 --- a/libPlasma/c/tests/seek_test.c +++ b/libPlasma/c/tests/seek_test.c @@ -35,7 +35,7 @@ int mainish (int argc, char *argv[]) int c; pool_cmd_info cmd; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:s:t:")) != -1) { switch (c) @@ -100,10 +100,9 @@ int mainish (int argc, char *argv[]) OB_FATAL_ERROR_CODE (0x2040e003, "deposit protein failed: %s\n", ob_error_string (pret)); if ((i == 0) && (idx != 0)) - OB_FATAL_ERROR_CODE (0x2040e004, - "deposit returned wrong index: %" OB_FMT_64 - "d (should be 0)\n", - idx); + OB_FATAL_ERROR_CODE ( + 0x2040e004, + "deposit returned wrong index: %" OB_FMT_64 "d (should be 0)\n", idx); } // Test that pool_curr gives first protein on start @@ -253,9 +252,9 @@ int mainish (int argc, char *argv[]) Free_Protein (curr_prot); OB_DIE_ON_ERROR (pool_index (ph, &cidx)); if (cidx != idx) - OB_FATAL_ERROR_CODE (0x2040e024, "Got %" OB_FMT_64 - "d, but expected %" OB_FMT_64 "d\n", - cidx, idx); + OB_FATAL_ERROR_CODE ( + 0x2040e024, "Got %" OB_FMT_64 "d, but expected %" OB_FMT_64 "d\n", + cidx, idx); } // Check that we really are out of proteins pret = pool_prev (ph, &curr_prot, &ts, NULL); @@ -318,9 +317,9 @@ int mainish (int argc, char *argv[]) Free_Protein (curr_prot); OB_DIE_ON_ERROR (pool_index (clone_ph, &cidx)); if (cidx != idx + 1) - OB_FATAL_ERROR_CODE (0x2040e032, "Got %" OB_FMT_64 - "d, but expected %" OB_FMT_64 "d + 1\n", - cidx, idx); + OB_FATAL_ERROR_CODE ( + 0x2040e032, "Got %" OB_FMT_64 "d, but expected %" OB_FMT_64 "d + 1\n", + cidx, idx); // Search for protein in the past slaw search = slaw_string ("descrip_0"); @@ -350,9 +349,9 @@ int mainish (int argc, char *argv[]) Free_Slaw (search); OB_DIE_ON_ERROR (pool_index (ph, &cidx)); if (cidx != idx + 1) - OB_FATAL_ERROR_CODE (0x2040e038, "Got %" OB_FMT_64 - "d, but expected %" OB_FMT_64 "d + 1\n", - cidx, idx); + OB_FATAL_ERROR_CODE ( + 0x2040e038, "Got %" OB_FMT_64 "d, but expected %" OB_FMT_64 "d + 1\n", + cidx, idx); // Test that index starts at the end of the pool on participate @@ -385,9 +384,10 @@ int mainish (int argc, char *argv[]) OB_FATAL_ERROR_CODE (0x2040e03c, "pool_index failed: %s\n", ob_error_string (pret)); if (start_index != (NUM_PROTEINS)) - OB_FATAL_ERROR_CODE (0x2040e03d, "pool index at participate_creatingly " - "time is %" OB_FMT_64 "d" - ", should be %d\n", + OB_FATAL_ERROR_CODE (0x2040e03d, + "pool index at participate_creatingly " + "time is %" OB_FMT_64 "d" + ", should be %d\n", start_index, NUM_PROTEINS - 1); // Not necessary but good habit diff --git a/libPlasma/c/tests/test-await-index.c b/libPlasma/c/tests/test-await-index.c index 9046bde5..fbf2747b 100644 --- a/libPlasma/c/tests/test-await-index.c +++ b/libPlasma/c/tests/test-await-index.c @@ -36,10 +36,9 @@ static void *send_some_proteins (void *v) int64 prev = -1; for (i = 0; i < ITERATIONS; i++) { - protein p = - protein_from_ff (slaw_list_inline_c ("inaugural", "balls", NULL), - slaw_map_inline_ff (slaw_string ("count"), - slaw_int64 (i), NULL)); + protein p = protein_from_ff ( + slaw_list_inline_c ("inaugural", "balls", NULL), + slaw_map_inline_ff (slaw_string ("count"), slaw_int64 (i), NULL)); int64 idx; err = pool_deposit (ph, p, &idx); if (err != OB_OK) @@ -49,9 +48,10 @@ static void *send_some_proteins (void *v) if (prev != -1) { if (idx != prev + 1) - OB_FATAL_ERROR_CODE (0x2040f002, "previous index was %" OB_FMT_64 - "d and current " - "index is %" OB_FMT_64 "d\n", + OB_FATAL_ERROR_CODE (0x2040f002, + "previous index was %" OB_FMT_64 + "d and current " + "index is %" OB_FMT_64 "d\n", prev, idx); } prev = idx; @@ -70,7 +70,7 @@ static int mainish (int argc, char **argv) pool_cmd_info cmd; int c; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:s:t:")) != -1) { switch (c) @@ -127,9 +127,10 @@ static int mainish (int argc, char **argv) if (prev != -1) { if (idx != prev + 1) - OB_FATAL_ERROR_CODE (0x2040f007, "previous index was %" OB_FMT_64 - "d and current " - "index is %" OB_FMT_64 "d\n", + OB_FATAL_ERROR_CODE (0x2040f007, + "previous index was %" OB_FMT_64 + "d and current " + "index is %" OB_FMT_64 "d\n", prev, idx); } prev = idx; diff --git a/libPlasma/c/tests/test-bigger.c b/libPlasma/c/tests/test-bigger.c index b01feb2c..8d7fe0e0 100644 --- a/libPlasma/c/tests/test-bigger.c +++ b/libPlasma/c/tests/test-bigger.c @@ -12,10 +12,11 @@ static void usage (void) { - fprintf (stderr, "Usage: test-bigger [-t ] [-s ] [-i ] " - "\n" - "\t defaults to \"mmap\"\n" - "\t defaults to %" OB_FMT_64 "u bytes\n", + fprintf (stderr, + "Usage: test-bigger [-t ] [-s ] [-i ] " + "\n" + "\t defaults to \"mmap\"\n" + "\t defaults to %" OB_FMT_64 "u bytes\n", (unt64) POOL_MMAP_DEFAULT_SIZE); exit (EXIT_FAILURE); } @@ -28,7 +29,7 @@ static int mainish (int argc, char **argv) protein p; ob_retort expected; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:s:t:v")) != -1) { switch (c) @@ -65,19 +66,15 @@ static int mainish (int argc, char **argv) // Let's make a protein slightly bigger than the pool int ret = EXIT_SUCCESS; - protein big = - protein_from_ff (NULL, slaw_map_inline_cf ("this is too big", - slaw_int8_array_filled (sz, -1), - NULL)); - protein medium = - protein_from_ff (NULL, - slaw_map_inline_cf ("this should not be too big", - slaw_int8_array_filled (sz / 2, -1), - NULL)); - protein tiny = - protein_from_ff (NULL, - slaw_map_inline_cf ("this is very small", - slaw_int8_array_filled (0, -1), NULL)); + protein big = protein_from_ff ( + NULL, slaw_map_inline_cf ("this is too big", + slaw_int8_array_filled (sz, -1), NULL)); + protein medium = protein_from_ff ( + NULL, slaw_map_inline_cf ("this should not be too big", + slaw_int8_array_filled (sz / 2, -1), NULL)); + protein tiny = protein_from_ff ( + NULL, slaw_map_inline_cf ("this is very small", + slaw_int8_array_filled (0, -1), NULL)); // And try to deposit it pret = pool_deposit (cmd.ph, big, &idx); diff --git a/libPlasma/c/tests/test-info.c b/libPlasma/c/tests/test-info.c index e0dce585..e60d42a2 100644 --- a/libPlasma/c/tests/test-info.c +++ b/libPlasma/c/tests/test-info.c @@ -18,10 +18,11 @@ static void usage (void) { - fprintf (stderr, "Usage: test-info [-t ] [-s ] [-i ] " - "\n" - "\t defaults to \"mmap\"\n" - "\t defaults to %" OB_FMT_64 "u bytes\n", + fprintf (stderr, + "Usage: test-info [-t ] [-s ] [-i ] " + "\n" + "\t defaults to \"mmap\"\n" + "\t defaults to %" OB_FMT_64 "u bytes\n", (unt64) POOL_MMAP_DEFAULT_SIZE); exit (EXIT_FAILURE); } @@ -31,7 +32,7 @@ int mainish (int argc, char **argv) pool_cmd_info cmd; int c; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "i:s:t:v")) != -1) { switch (c) @@ -82,9 +83,9 @@ int mainish (int argc, char **argv) unt64 sz = slaw_path_get_unt64 (terminal_info, "size", 923); if (sz != cmd.size) - OB_FATAL_ERROR_CODE (0x20411004, "expected size %" OB_FMT_64 - "u, but got %" OB_FMT_64 "u\n", - cmd.size, sz); + OB_FATAL_ERROR_CODE ( + 0x20411004, "expected size %" OB_FMT_64 "u, but got %" OB_FMT_64 "u\n", + cmd.size, sz); protein transport_info; pret = pool_get_info (cmd.ph, 0, &transport_info); @@ -96,9 +97,8 @@ int mainish (int argc, char **argv) { slabu *sb = slabu_of_strings_from_split (cmd.pool_name, "://"); const char *proto = slaw_string_emit (slabu_list_nth (sb, 0)); - slabu *sb2 = - slabu_of_strings_from_split (slaw_string_emit (slabu_list_nth (sb, 1)), - "/"); + slabu *sb2 = slabu_of_strings_from_split ( + slaw_string_emit (slabu_list_nth (sb, 1)), "/"); const char *host = slaw_string_emit (slabu_list_nth (sb2, 0)); slabu *sb3 = slabu_of_strings_from_split (host, ":"); if (slabu_count (sb3) == 2) @@ -108,8 +108,9 @@ int mainish (int argc, char **argv) OB_DIE_ON_ERROR (slaw_to_unt64 (slabu_list_nth (sb3, 1), &port)); unt64 p = slaw_path_get_unt64 (transport_info, "port", 923); if (p != port) - OB_FATAL_ERROR_CODE (0x20411006, "expected port %" OB_FMT_64 - "u, but got %" OB_FMT_64 "u\n", + OB_FATAL_ERROR_CODE (0x20411006, + "expected port %" OB_FMT_64 + "u, but got %" OB_FMT_64 "u\n", port, p); } diff --git a/libPlasma/c/tests/test-multi-await.c b/libPlasma/c/tests/test-multi-await.c index 69f6c7ce..71514671 100644 --- a/libPlasma/c/tests/test-multi-await.c +++ b/libPlasma/c/tests/test-multi-await.c @@ -16,7 +16,8 @@ #include "libPlasma/c/protein.h" #include "libPlasma/c/slaw.h" -typedef enum { +typedef enum +{ TEST_MULTI, TEST_SINGLE, TEST_NEXT, @@ -141,10 +142,9 @@ static void do_op (test_op op, pool_hose ph, int hoseno, pool_gang gang, { p = protein_from_ff ( slaw_list_inline_c ("what", "ever", NULL), - slaw_map_inline_cf ("random", - slaw_float64 ( - ob_rand_state_float64 (0.0, 1.0, rstate)), - NULL)); + slaw_map_inline_cf ( + "random", + slaw_float64 (ob_rand_state_float64 (0.0, 1.0, rstate)), NULL)); tort = pool_deposit (ph, p, &dep_index); OB_DIE_ON_ERROR (tort); expected = OB_OK; @@ -195,9 +195,9 @@ static void do_op (test_op op, pool_hose ph, int hoseno, pool_gang gang, ob_error_string (expected), ob_error_string (tort)); if (current_index - 1 != ret_index) - OB_FATAL_ERROR_CODE (0x2041200b, "Expected %" OB_FMT_64 - "d but got %" OB_FMT_64 "d\n", - current_index - 1, ret_index); + OB_FATAL_ERROR_CODE ( + 0x2041200b, "Expected %" OB_FMT_64 "d but got %" OB_FMT_64 "d\n", + current_index - 1, ret_index); break; case TEST_OLDEST: expected = (current_index == 0) ? POOL_NO_SUCH_PROTEIN : OB_OK; @@ -213,7 +213,7 @@ static void do_op (test_op op, pool_hose ph, int hoseno, pool_gang gang, break; case TEST_649: stimulate (hoseno); - again: +again: OB_DIE_ON_ERROR (pool_await_multi (gang, timeout)); OB_DIE_ON_ERROR (pool_index (ph, &new_index)); if (new_index != current_index) @@ -231,9 +231,10 @@ static void do_op (test_op op, pool_hose ph, int hoseno, pool_gang gang, default: OB_DIE_ON_ERROR (pool_next (ph, &ret_prot, NULL, &ret_index)); if (ret_index != current_index) - OB_FATAL_ERROR_CODE (0x2041201a, "%s: returned index was not " - "what I expected: %" OB_FMT_64 - "d != %" OB_FMT_64 "d\n", + OB_FATAL_ERROR_CODE (0x2041201a, + "%s: returned index was not " + "what I expected: %" OB_FMT_64 + "d != %" OB_FMT_64 "d\n", pool_name (ph), new_index, current_index); protein_free (ret_prot); break; @@ -256,7 +257,7 @@ static int mainish (int argc, char **argv) pool_cmd_info cmd; int c; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); while ((c = getopt (argc, argv, "s:t:i:")) != -1) { switch (c) diff --git a/libPlasma/c/tests/wrap_test.c b/libPlasma/c/tests/wrap_test.c index 4993f275..455d7519 100644 --- a/libPlasma/c/tests/wrap_test.c +++ b/libPlasma/c/tests/wrap_test.c @@ -54,10 +54,9 @@ static void CreateProtein (int str_len, protein *prot) // Null terminate buffer[j] = '\0'; - slaw m = - slaw_map_inline_cf ("time", slaw_int32 (165955708), "numdots", - slaw_int32 (0), "points", slaw_list_f (slabu_new ()), - "test_string", slaw_string (buffer), NULL); + slaw m = slaw_map_inline_cf ( + "time", slaw_int32 (165955708), "numdots", slaw_int32 (0), "points", + slaw_list_f (slabu_new ()), "test_string", slaw_string (buffer), NULL); *prot = protein_from_ff (slaw_list_inline_c ("dotframe", NULL), m); free (buffer); @@ -73,7 +72,7 @@ int mainish (int argc, char **argv) int c; int i; - memset(&cmd, 0, sizeof(cmd)); + memset (&cmd, 0, sizeof (cmd)); cmd.size = pool_size; while ((c = getopt (argc, argv, "d:i:I:s:t:")) != -1) diff --git a/libPlasma/c/tests/zombie.c b/libPlasma/c/tests/zombie.c index bef54100..7e38b93f 100644 --- a/libPlasma/c/tests/zombie.c +++ b/libPlasma/c/tests/zombie.c @@ -14,11 +14,9 @@ int main (int argc, char **argv) OB_DIE_ON_ERROR (OB_CHECK_ABI ()); const char *poolname = argv[1]; - protein pro = - protein_from_ff (NULL, - slaw_map_inline_cf ("size", slaw_int64 (128 * KILOBYTE), - "resizable", slaw_boolean (true), - NULL)); + protein pro = protein_from_ff ( + NULL, slaw_map_inline_cf ("size", slaw_int64 (128 * KILOBYTE), "resizable", + slaw_boolean (true), NULL)); OB_DIE_ON_ERROR (pool_participate_creatingly (poolname, "mmap", &hose, pro)); slaw releaseOptionSlaw = slaw_map_inline_ff (slaw_string ("auto-dispose"), slaw_boolean (true), NULL); diff --git a/libPlasma/c/win32/fifo_ops_win32.c b/libPlasma/c/win32/fifo_ops_win32.c index 53c5bf5b..dbdfd9fc 100644 --- a/libPlasma/c/win32/fifo_ops_win32.c +++ b/libPlasma/c/win32/fifo_ops_win32.c @@ -55,9 +55,7 @@ /// XXX shouldn't this go into some other file? pool.h / pool.c? -void pool_fifo_multi_destroy_awaiter (pool_hose ph) -{ -} +void pool_fifo_multi_destroy_awaiter (pool_hose ph) {} DWORD pool_timeout_to_wait_millis (pool_timestamp timeout) @@ -149,8 +147,9 @@ ob_retort pool_fifo_multi_add_awaiter (pool_hose ph, protein *ret_prot, DWORD err = GetLastError (); if (new_event == 0) - OB_FATAL_ERROR_CODE (0x2010b005, "unable to create wait event for pool " - "notification, error %d", + OB_FATAL_ERROR_CODE (0x2010b005, + "unable to create wait event for pool " + "notification, error %d", err); if (err == ERROR_ALREADY_EXISTS) @@ -269,8 +268,9 @@ ob_retort pool_fifo_wake_awaiters (pool_hose ph) //in any case, we are going to delete the notification file if (unlink (file_name) != 0) { - OB_LOG_ERROR_CODE (0x2010b009, "wake_awaiters could not unlink " - "%s - errno %d\n", + OB_LOG_ERROR_CODE (0x2010b009, + "wake_awaiters could not unlink " + "%s - errno %d\n", file_name, errno); } if (wake_up_handle) @@ -345,9 +345,8 @@ ob_retort pool_fifo_await_next_single (pool_hose ph, pool_timestamp timeout, break; default: - OB_LOG_ERROR_CODE (0x2010b00b, - "unknown error WaitForSingleObject - %d\n", - wait_res); + OB_LOG_ERROR_CODE ( + 0x2010b00b, "unknown error WaitForSingleObject - %d\n", wait_res); pret = POOL_FIFO_BADTH; break; } diff --git a/libPlasma/c/win32/sem_ops_win32.c b/libPlasma/c/win32/sem_ops_win32.c index d6f9bfdd..32aa1f2b 100644 --- a/libPlasma/c/win32/sem_ops_win32.c +++ b/libPlasma/c/win32/sem_ops_win32.c @@ -92,8 +92,9 @@ static ob_retort __pool_create_semaphores (pool_hose ph) DWORD err = GetLastError (); if (mutex_handle == 0) { - OB_LOG_ERROR_CODE (0x2010c000, "__pool_create_semaphores could not " - "create mutex %s", + OB_LOG_ERROR_CODE (0x2010c000, + "__pool_create_semaphores could not " + "create mutex %s", mutex_name); return POOL_SEMAPHORES_BADTH; } @@ -164,8 +165,9 @@ static ob_retort pool_sem_lock (pool_hose ph, int index) return OB_OK; default: - OB_LOG_ERROR_CODE (0x2010c005, "unhandled WaitForSingleObject error in " - "pool_sem_lock - %d", + OB_LOG_ERROR_CODE (0x2010c005, + "unhandled WaitForSingleObject error in " + "pool_sem_lock - %d", result); break; } diff --git a/libPlasma/ruby/rubyPlasma.c b/libPlasma/ruby/rubyPlasma.c index 7377095b..908644e4 100644 --- a/libPlasma/ruby/rubyPlasma.c +++ b/libPlasma/ruby/rubyPlasma.c @@ -433,25 +433,20 @@ OB_RUBYPLASMA_API void Init_rubyPlasma (void) rcStandardError = rb_define_class ("StandardError", rcException); rcSlawTypeTagError = rb_define_class_under (rcPlasmaModule, "SlawTypeTagError", rcStandardError); - rcPoolOperationError = - rb_define_class_under (rcPlasmaModule, "PoolOperationError", - rcStandardError); + rcPoolOperationError = rb_define_class_under ( + rcPlasmaModule, "PoolOperationError", rcStandardError); rcPoolInUseError = rb_define_class_under (rcPlasmaModule, "PoolInUseError", rcPoolOperationError); rcPoolExistsError = rb_define_class_under (rcPlasmaModule, "PoolExistsError", rcPoolOperationError); - rcPoolNotFoundError = - rb_define_class_under (rcPlasmaModule, "PoolNotFoundError", - rcPoolOperationError); - rcPoolNoProteinError = - rb_define_class_under (rcPlasmaModule, "PoolNoProteinError", - rcPoolOperationError); - rcPoolWithdrawnError = - rb_define_class_under (rcPlasmaModule, "PoolWithdrawnError", - rcPoolOperationError); - rcPoolUnsupportedError = - rb_define_class_under (rcPlasmaModule, "PoolUnsupportedError", - rcPoolOperationError); + rcPoolNotFoundError = rb_define_class_under ( + rcPlasmaModule, "PoolNotFoundError", rcPoolOperationError); + rcPoolNoProteinError = rb_define_class_under ( + rcPlasmaModule, "PoolNoProteinError", rcPoolOperationError); + rcPoolWithdrawnError = rb_define_class_under ( + rcPlasmaModule, "PoolWithdrawnError", rcPoolOperationError); + rcPoolUnsupportedError = rb_define_class_under ( + rcPlasmaModule, "PoolUnsupportedError", rcPoolOperationError); rcPoolFrozenError = rb_define_class_under (rcPlasmaModule, "PoolFrozenError", rcPoolOperationError); rcPoolFullError = rb_define_class_under (rcPlasmaModule, "PoolFullError", @@ -855,9 +850,8 @@ static VALUE _new_slaw_from_c_slaw (bslaw cslaw, VALUE container, else rslaw = rb_class_new_instance (2, from_c_slaw_constructor_args, rcSlaw); - VALUE wrapped = - Data_Wrap_Struct (rb_cData, 0, (free_on_gc ? rubySlaw__slaw_free : NULL), - (slaw) cslaw); + VALUE wrapped = Data_Wrap_Struct ( + rb_cData, 0, (free_on_gc ? rubySlaw__slaw_free : NULL), (slaw) cslaw); rb_iv_set (rslaw, "@ruby_value", Qnil); rb_iv_set (rslaw, "@_c_slaw", wrapped); rb_iv_set (rslaw, "@type_tag", _c_type_tag (cslaw)); diff --git a/libPlasma/zeroconf/pool-server-zeroconf-adapter.cpp b/libPlasma/zeroconf/pool-server-zeroconf-adapter.cpp index 430cadda..b88f35b0 100644 --- a/libPlasma/zeroconf/pool-server-zeroconf-adapter.cpp +++ b/libPlasma/zeroconf/pool-server-zeroconf-adapter.cpp @@ -220,8 +220,9 @@ int main (int argc, char **argv) &pollInterval, true); ap.ArgString ("zname", " \aName to announce for Zeroconf service ", &nameOfService, true); - ap.ArgString ("subtypes", " \aList of Zeroconf subtypes, " - "comma-separated only ", + ap.ArgString ("subtypes", + " \aList of Zeroconf subtypes, " + "comma-separated only ", &subTypes); #ifndef _MSC_VER ap.ArgFlag ("nofork", diff --git a/libPlasma/zeroconf/tests/PoolServerTest.cpp b/libPlasma/zeroconf/tests/PoolServerTest.cpp index 1f7c58bf..e5dc5cfa 100644 --- a/libPlasma/zeroconf/tests/PoolServerTest.cpp +++ b/libPlasma/zeroconf/tests/PoolServerTest.cpp @@ -10,8 +10,7 @@ using namespace oblong::plasma; namespace { class PoolServerTest : public ::testing::Test -{ -}; +{}; TEST_F (PoolServerTest, Defaults) { diff --git a/libPlasma/zeroconf/tests/ZeroconfTest.cpp b/libPlasma/zeroconf/tests/ZeroconfTest.cpp index 9bbe9b1e..f0e4212b 100644 --- a/libPlasma/zeroconf/tests/ZeroconfTest.cpp +++ b/libPlasma/zeroconf/tests/ZeroconfTest.cpp @@ -84,10 +84,9 @@ class MockServer while (!announce_) usleep (10000); ZEROCONF_LOG_DEBUG ("MOCK: Announcing %s", me->Name ()); - zc_server_data *sd = - zeroconf_server_announce (me->server_.Name (), ZEROCONF_SERVICE_TYPE, - me->server_.Type (), me->server_.Port (), NULL, - NULL); + zc_server_data *sd = zeroconf_server_announce ( + me->server_.Name (), ZEROCONF_SERVICE_TYPE, me->server_.Type (), + me->server_.Port (), NULL, NULL); if (!sd) { ZEROCONF_LOG_ERROR ("Announcement failed for %s", me->Name ()); @@ -108,7 +107,7 @@ class MockServer gethostname (host, 256); const int p = getpid (); char name[512]; - int namelen = snprintf (name, sizeof(name), "%d=)%d(>>=%s", p, i, host); + int namelen = snprintf (name, sizeof (name), "%d=)%d(>>=%s", p, i, host); if (namelen >= ZEROCONF_MAX_SERVICE_LEN) { ZEROCONF_LOG_ERROR ("service name %s too long", name); diff --git a/libPlasma/zeroconf/zeroconf-client-avahi.c b/libPlasma/zeroconf/zeroconf-client-avahi.c index a79a097a..25f8660e 100644 --- a/libPlasma/zeroconf/zeroconf-client-avahi.c +++ b/libPlasma/zeroconf/zeroconf-client-avahi.c @@ -112,9 +112,9 @@ static void browse_callback (AvahiServiceBrowser *b, AvahiIfIndex interface, type, domain, AVAHI_PROTO_UNSPEC, 0, resolve_callback, bd))) { - ZEROCONF_LOG_WARNING ("Failed to resolve service '%s': %s", name, - avahi_strerror ( - avahi_client_errno (bd->client))); + ZEROCONF_LOG_WARNING ( + "Failed to resolve service '%s': %s", name, + avahi_strerror (avahi_client_errno (bd->client))); bd->unresolved--; } break; @@ -171,10 +171,9 @@ static bool init_avahi_data (browser_data *bd) return false; } - bd->browser = - avahi_service_browser_new (bd->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, - ZEROCONF_SERVICE_TYPE, NULL, 0, browse_callback, - bd); + bd->browser = avahi_service_browser_new ( + bd->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, ZEROCONF_SERVICE_TYPE, + NULL, 0, browse_callback, bd); if (!bd->browser) { ZEROCONF_LOG_ERROR ("Failed to create service browser: %s", diff --git a/libPlasma/zeroconf/zeroconf-server-avahi.c b/libPlasma/zeroconf/zeroconf-server-avahi.c index fd5301b6..cd5e3d9b 100644 --- a/libPlasma/zeroconf/zeroconf-server-avahi.c +++ b/libPlasma/zeroconf/zeroconf-server-avahi.c @@ -128,10 +128,9 @@ static void solve_collision (AvahiClient *c, zc_server_data *sd, bool reset) static bool add_subtype (zc_server_data *sd, const char *subtype) { char *st = format_subtype (sd->type, subtype); - int ret = - avahi_entry_group_add_service_subtype (sd->group, AVAHI_IF_UNSPEC, - AVAHI_PROTO_UNSPEC, 0, sd->name, - sd->type, NULL, st); + int ret = avahi_entry_group_add_service_subtype ( + sd->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, sd->name, sd->type, NULL, + st); if (ret < 0) ZEROCONF_LOG_ERROR ("failed to add service subtype %s: %s\n", st, @@ -157,10 +156,9 @@ static bool add_subtypes (zc_server_data *sd) static void add_service (AvahiClient *c, zc_server_data *sd) { - int ret = avahi_entry_group_add_service_strlst (sd->group, AVAHI_IF_UNSPEC, - AVAHI_PROTO_UNSPEC, 0, - sd->name, sd->type, NULL, - NULL, sd->port, sd->subtypes); + int ret = avahi_entry_group_add_service_strlst ( + sd->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, sd->name, sd->type, NULL, + NULL, sd->port, sd->subtypes); if (ret == AVAHI_ERR_COLLISION) { solve_collision (c, sd, true);