summaryrefslogtreecommitdiff
path: root/lib/gl_array_omap.c
Commit message (Collapse)AuthorAgeFilesLines
* gnulib-common: update for C2x 2020-12-11 draftPaul Eggert2021-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use blessed-by-draft-standard way to test for [[__deprecated__]] etc.; this is supported by GCC 11 and the fallback code should work fine with GCC 10 and earlier, clang, etc. * NEWS, doc/attribute.texi: Mention that DEPRECATED etc. must now come first. * lib/fflush.c, lib/unistr.in.h: Do not include unused-parameter.h. All uses of _GL_UNUSED_PARAMETER (after parameters) replaced by _GL_ATTRIBUTE_MAYBE_UNUSED (before parameters). Although perhaps we need a shorter name for _GL_ATTRIBUTE_MAYBE_UNUSED, that should probably be in gnulib-common.m4, due to the ubiquity of this issue. And perhaps the snippet/unused-parameter module should be marked obsolete since it's no longer compatible with its old use. * m4/gnulib-common.m4 (gl_COMMON_BODY): Define the macro _GL_HAS_C_ATTRIBUTE, and use it instead of __STDC_VERSION__ in deciding whether to use C2x attributes like [[__deprecated__]]. (_GL_ATTRIBUTE_MAYBE_UNUSED): Fall back on _GL_ATTRIBUTE_UNUSED. (_GL_ATTRIBUTE_UNUSED): New macro, for labels where C2x [[maybe_unused]] do not work. (_GL_UNUSED, _GL_UNUSED_LABEL): Use it. * modules/fflush, modules/unistr/base (Depends-on): Remove snippet/unused-parameter. * modules/fflush (selinux/selinux.h, selinux/context.h) (selinux/label.h): Do not use $(UNUSED_PARAMETER). Remove useless chmod a-x.
* Put LGPLv2+ notices in source files where appropriate.Bruno Haible2021-06-041-7/+7
| | | | | * lib/**.{h,c,gperf}: Use LGPLv2+ notice whenever the module description says so.
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* *-list, *-oset, *-omap: Avoid a GCC warning (regression 2020-10-10).Bruno Haible2020-10-181-1/+1
| | | | | | | | | | | | * lib/gl_anylinked_list2.h (gl_linked_iterator_free): Remove '_GL_ATTRIBUTE_CONST'. * lib/gl_anytree_list2.h (gl_tree_iterator_free): Likewise. * lib/gl_anytree_omap.h (gl_tree_iterator_free): Likewise. * lib/gl_anytree_oset.h (gl_tree_iterator_free): Likewise. * lib/gl_array_list.c (gl_array_iterator_free): Likewise. * lib/gl_array_omap.c (gl_array_iterator_free): Likewise. * lib/gl_array_oset.c (gl_array_iterator_free): Likewise. * lib/gl_carray_list.c (gl_carray_iterator_free): Likewise.
* *-list, *-oset, *-omap: Avoid possible compiler warnings.Bruno Haible2020-10-101-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Marc Nieper-Wißkirchen in <https://lists.gnu.org/r/bug-gnulib/2020-10/msg00025.html>. * lib/gl_anylinked_list2.h (gl_linked_iterator, gl_linked_iterator_from_to): Mark as 'pure'. (gl_linked_iterator_free): Mark as 'const'. * lib/gl_anytree_list2.h (gl_tree_size, gl_tree_node_value, gl_tree_search_from_to, gl_tree_indexof_from_to, gl_tree_iterator, gl_tree_iterator_from_to, gl_tree_sortedlist_search, gl_tree_sortedlist_search_from_to, gl_tree_sortedlist_indexof, gl_tree_sortedlist_indexof_from_to): Mark as 'pure'. (gl_tree_iterator_free): Mark as 'const'. * lib/gl_anytree_omap.h (gl_tree_size, gl_tree_iterator): Mark as 'pure'. (gl_tree_iterator_free): Mark as 'const'. * lib/gl_anytree_oset.h (gl_tree_size, gl_tree_next_node, gl_tree_prev_node, gl_tree_iterator): Mark as 'pure'. (gl_tree_iterator_free): Mark as 'const'. * lib/gl_anytreehash_list1.h (node_position, compare_by_position, compare_position_threshold): Mark as 'pure'. * lib/gl_array_list.c (gl_array_size, gl_array_indexof_from_to, gl_array_search_from_to, gl_array_iterator, gl_array_iterator_from_to, gl_array_sortedlist_indexof_from_to, gl_array_sortedlist_indexof, gl_array_sortedlist_search_from_to, gl_array_sortedlist_search): Mark as 'pure'. (gl_array_iterator_free): Mark as 'const'. * lib/gl_array_omap.c (gl_array_size, gl_array_indexof, gl_array_search, gl_array_search_atleast, gl_array_iterator): Mark as 'pure'. (gl_array_iterator_free): Mark as 'const'. * lib/gl_array_oset.c (gl_array_size, gl_array_indexof, gl_array_search, gl_array_indexof_atleast, gl_array_search_atleast, gl_array_iterator, gl_array_iterator_atleast): Mark as 'pure'. (gl_array_iterator_free): Mark as 'const'. * lib/gl_carray_list.c (gl_carray_size, gl_carray_node_value, gl_carray_next_node, gl_carray_previous_node, gl_carray_get_at, gl_carray_indexof_from_to, gl_carray_search_from_to, gl_carray_iterator, gl_carray_iterator_from_to, gl_carray_sortedlist_indexof_from_to, gl_carray_sortedlist_indexof, gl_carray_sortedlist_search_from_to, gl_carray_sortedlist_search): Mark as 'pure'. (gl_carray_iterator_free): Mark as 'const'.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* omap: Don't dispose the old value when the function returns it.Bruno Haible2018-12-121-19/+17
| | | | | | | | | * lib/gl_array_omap.c (gl_array_remove_at): Don't invoke the vdispose_fn here. * lib/gl_avltree_omap.c (NODE_PAYLOAD_DISPOSE): Likewise. * lib/gl_rbtree_omap.c (NODE_PAYLOAD_DISPOSE): Likewise. * lib/gl_omap.h (gl_omap_nx_put, gl_omap_remove): Invoke the vdispose_fn here.
* array-omap, avltree-omap, rbtree-omap: Tweak style.Bruno Haible2018-12-121-1/+1
| | | | | | * lib/gl_anytree_omap.h (gl_tree_nx_getput): Return 1 or 0, not true or false. * lib/gl_array_omap.c (gl_array_nx_getput): Likewise.
* array-omap: New module.Bruno Haible2018-12-111-0/+392
* lib/gl_array_omap.h: New file. * lib/gl_array_omap.c: New file. * modules/array-omap: New file.