forked from troydhanson/uthash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Minor utstring docs cleanup. Thanks to @tbeu for the patch! This is adapted from part of troydhanson#95. * Remove cast to "unsigned" from utstring_len macro. It causes truncation on 64-bit platforms, and neither @troydhanson nor myself know why it should have been there in the first place. Thanks to @mse11 for the patch (troydhanson#97)! * Silence an instance of -Wsign-compare in the tests. * Fix a segfault in HASH_ADD_KEYPTR_INORDER. Thanks to @IronBug for the bug report (troydhanson#99) and test90.c! test87.c would have caught this bug at the time the macros were added, except that by chance `offsetof(hstruct_t, hh)` was `0`. I've adjusted the test so that it fails before this patch and succeeds after. * Document test90.c in tests/README. I should have done this in 13723b1, but forgot. No functional change. * Make `make pedantic` and `make cplusplus` build cleanly again. Basically just adding malloc-casts and explicit casts from string literals to `(char *)` (since that gives a deprecation warning in clang++ these days). No intended functional change. * Add "Android" to the list of supported platforms. Requested by @silvioprog! He writes: > It worked like a charm for my ARMv7 and finally I can use an efficient > C hash table in my Android (tested on version 5 and 6) application. Sure, technically "Android" is covered by "Linux" anyway. :) Fixes troydhanson#103. * Bump version to 2.0.2. * utlist: Add an assert to silence a scan-build diagnostic. Thanks to @aaronmdjones for the report! Unfortunately scan-build is unhappy with uthash and utarray as well, and the fixes seem harder in those cases. Especially since there's no tradition of adding redundant asserts in those files, and I wouldn't really want to start. This case is easy because we've already committed to liberal use of asserts in utlist (for whatever reason). * utlist: Add INORDER macros for inserting into sorted lists. Thanks to @jeffreylovitz for the initial patch! The `{LL,DL,CDL}_LOWER_BOUND` macros have semantics similar to C++'s `std::lower_bound` algorithm: in essence they return an iterator to the first existing list element which is *not less than* the given one. However, in this context an "iterator to element X" is actually a "pointer to element X-1", because our lists support only insertion-after, not insertion-before. Therefore, in situations where `std::lower_bound` would return `lst.begin()` we return `NULL`, and in cases where `std::lower_bound` would return `lst.end()` we return a pointer to the last element of the list. * uthash, utlist: Make the NO_DECLTYPE codepaths match more closely. utlist had made `NO_DECLTYPE` the default on `__ICCARM__` since 368010b, but uthash had never done so. Do so. utlist gave double-definition errors if `-DNO_DECLTYPE` was passed on the command line (for a compiler that otherwise supported decltype and/or __typeof). Fix that. Passing `-DLDECLTYPE(x)=decltype(x)` on the command line ought to do the right thing. Make it at least not double-define `DECLTYPE`. But we still have the problem that we do things like `LDECLTYPE(*p)`, which in C++ yields an lvalue reference type, not an object type. I don't know how to fix that. uthash's test87.c and test90.c gave errors in C++ with `-DNO_DECLTYPE` because the code now known as `HASH_AKBI_INNER_LOOP` would attempt to call the provided `cmpfcn` with an argument of type `(void *)` instead of the expected `decltype(head)`. This works in C with an implicit conversion, but doesn't work at all in C++ because it would try to call a different overload of the comparison function. So, if we have `NO_DECLTYPE`, let's use `head` as a scratch variable. * C89 compatibility: add a missing "return 0" to test89.c No functional change. * Convince Clang that `pid` is never used uninitialized in hashscan.c. No functional change. * Use non-reserved identifiers for some helper macros. Identifiers beginning with an underscore and an uppercase letter are reserved to the implementation, and Clang apparently warns on such things these days (via -Wreserved-id-macro). Solution: rename those macros to avoid leading underscores. Fixes troydhanson#112. * remove libut
- Loading branch information
Showing
92 changed files
with
538 additions
and
1,787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
utringbuffer: dynamic ring-buffer macros for C | ||
============================================== | ||
Arthur O'Dwyer <arthur[email protected]> | ||
v2.0.1, July 2016 | ||
v2.0.2, March 2017 | ||
|
||
Here's a link back to the https://github.com/troydhanson/uthash[GitHub project page]. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.