search for: bsearch

Displaying 20 results from an estimated 85 matches for "bsearch".

Did you mean: search
2007 Mar 15
5
[PATCH 0/5] fix gcc warnings in CVS HEAD
Hi, I have rewritten the patches I submitted earlier today for the CVS HEAD. Some of the changes were already committed months ago. On 2007/03/15 12:30, Timo Sirainen <tss at iki.fi> wrote: > That's ok, but I'm not sure about bsearch_insert_pos(). It's the way it > is mostly because I wanted to keep bsearch() API. If it can't return > void * then maybe it could be easier to just change the whole API to > something like: One of the patches changes exactly that. Timo, please review this patch carefully, because...
2016 Jan 11
2
RFC: Extend UBSan with qsort checks
Hi all, UndefinedBehaviorSanitizer currently does not check for undefined behaviors which result from improper usage of standard library functions. One notorious instance of such errors is invalid usage of qsort or bsearch routines (or std::sort and friends in case of C++): * using comparison function that violates ordering axioms (reflexivity, symmetry, transitivity) * returning unstable results from comparison function * passing unsorted array to bsearch * etc. Errors like this will usually result in slightly inv...
2016 Jan 12
4
RFC: Extend UBSan with qsort checks
...;t > need to annotate C++ standard library code? > We submitted some annotations to libc++ code (e.g. to report containter > overflow bugs in sanitizers). > > [1] -fsanitize=vptr is an only notable exception > > One notorious instance of such errors is invalid usage of qsort or bsearch >> routines (or std::sort and friends in case of C++): >> * using comparison function that violates ordering axioms (reflexivity, >> symmetry, transitivity) >> * returning unstable results from comparison function >> * passing unsorted array to bsearch >> * etc....
2009 Dec 10
1
Compile problem on AIX with dovecot 1.2 rev 10449:a164075ea33a
+ exec /usr/vac/bin/xlc -g -qarch=pwr5x -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/lib -I../../src/lib-test -I../../src/lib-mail -q64 -c -M mail-index-transaction.c -DPIC "../../src/lib/bsearch-insert-pos.h", line 39.9: 1506-236 (W) Macro name array_bsearch has been redefined. "../../src/lib/bsearch-insert-pos.h", line 39.9: 1506-358 (I) "array_bsearch" is defined on line 285 of ../../src/lib/array.h. "mail-index-transaction.c", line 34.16: 1506-045 (S)...
2016 Jan 13
2
RFC: Extend UBSan with qsort checks
...We submitted some annotations to libc++ code (e.g. to report containter >>> overflow bugs in sanitizers). >>> >>> [1] -fsanitize=vptr is an only notable exception >>> >>> One notorious instance of such errors is invalid usage of qsort or >>>> bsearch routines (or std::sort and friends in case of C++): >>>> * using comparison function that violates ordering axioms (reflexivity, >>>> symmetry, transitivity) >>>> * returning unstable results from comparison function >>>> * passing unsorted array to b...
2019 Aug 12
2
Re: [PATCH libnbd 1/7] api: Add semi-private function for freeing persistent data.
...+ if (new_callbacks == NULL) { > + set_error (errno, "realloc"); > + goto out; > + } > + h->alloc_free_callbacks = new_alloc; > + h->free_callbacks = new_callbacks; > + } > + > + /* Need to keep the list sorted by pointer so we can use bsearch. > + * Insert the new entry before the i'th entry. > + * > + * Note the same pointer can be added multiple times (eg. if a > + * buffer is shared between commands), and that is not a bug. Which > + * free function is called is undefined, but they should all be > +...
2016 Jan 13
2
RFC: Extend UBSan with qsort checks
...er >>>>> overflow bugs in sanitizers). >>>>> >>>>> [1] -fsanitize=vptr is an only notable exception >>>>> >>>>> One notorious instance of such errors is invalid usage of qsort or >>>>> >>>>>> bsearch routines (or std::sort and friends in case of C++): >>>>>> * using comparison function that violates ordering axioms (reflexivity, >>>>>> symmetry, transitivity) >>>>>> * returning unstable results from comparison function >>>>>&g...
2016 Jan 14
2
RFC: Extend UBSan with qsort checks
...itizers). >>>>>>> >>>>>>> [1] -fsanitize=vptr is an only notable exception >>>>>>> >>>>>>> One notorious instance of such errors is invalid usage of qsort or >>>>>>> >>>>>>> bsearch routines (or std::sort and friends in case of C++): >>>>>>>> * using comparison function that violates ordering axioms >>>>>>>> (reflexivity, >>>>>>>> symmetry, transitivity) >>>>>>>> * returning unstabl...
2019 Aug 12
0
Re: [PATCH libnbd 1/7] api: Add semi-private function for freeing persistent data.
...gt; + set_error (errno, "realloc"); > > + goto out; > > + } > > + h->alloc_free_callbacks = new_alloc; > > + h->free_callbacks = new_callbacks; > > + } > > + > > + /* Need to keep the list sorted by pointer so we can use bsearch. > > + * Insert the new entry before the i'th entry. > > + * > > + * Note the same pointer can be added multiple times (eg. if a > > + * buffer is shared between commands), and that is not a bug. Which > > + * free function is called is undefined, but th...
2001 Jul 01
1
Compile error in x86 Solaris
Hello, I got these errors during compile wine-20010629 in x86 Solaris make[2]: Leaving directory `/d1/wine-20010629/miscemu' gcc -o wine miscemu/miscemu.o -L./dlls -lntdll -L./library -lwine -L./unicode -lwine_unicode -lsocket -lnsl -lm make[1]: Entering directory `/d1/wine-20010629/debugger' gcc -c -I. -I. -I../include -I../include -g -O2 -Wall -mpreferred-stack-boundary=2 -fPIC
2020 Apr 19
0
[PATCH nbdkit 2/2] Add insert function and use the new vector library in several places.
...->debug) nbdkit_debug ("%s: inserted new L1 entry for %" PRIu64 " at end of l1_dir", __func__, entry->offset); @@ -233,7 +226,8 @@ lookup (struct sparse_array *sa, uint64_t offset, bool create, again: /* Search the L1 directory. */ - entry = bsearch (&offset, sa->l1_dir, sa->l1_size, sizeof (struct l1_entry), + entry = bsearch (&offset, sa->l1_dir.ptr, + sa->l1_dir.size, sizeof (struct l1_entry), compare_l1_offsets); if (sa->debug) { diff --git a/plugins/eval/eval.c b/plugins/e...
2019 Aug 12
2
Re: [PATCH libnbd 1/7] api: Add semi-private function for freeing persistent data.
...ilable in > glibc yet? 'man realloc' on Fedora 29 lists reallocarray under _GNU_SOURCE, but fails to say which glibc introduced it, and 'man reallocarray' is missing (bug in the man pages). >>> + >>> + /* Need to keep the list sorted by pointer so we can use bsearch. >>> + * Insert the new entry before the i'th entry. >>> + * >>> + * Note the same pointer can be added multiple times (eg. if a >>> + * buffer is shared between commands), and that is not a bug. Which >>> + * free function is called is un...
2007 Sep 13
1
chartr better
...string %d"), i+1); wc = (wchar_t *) R_AllocStringBuffer((nc+1)*sizeof(wchar_t), &cbuff); mbstowcs(wc, xi, nc + 1); - for(j = 0; j < nc; j++) wc[j] = xtable[wc[j]]; + for(j = 0; j < nc; j++) + if (tbl = bsearch(&wc[j], xtable, xtable_cnt, sizeof(xtable_t), + (int(*)(const void *, const void *))xtable_key_comp)) + wc[j]=tbl->c_new; nb = wcstombs(NULL, wc, 0); cbuf = CallocCharBuf(nb); wcsto...
2016 Jan 14
2
RFC: Extend UBSan with qsort checks
...gt;>>>>>>> [1] -fsanitize=vptr is an only notable exception >>>>>>>>> >>>>>>>>> One notorious instance of such errors is invalid usage of qsort or >>>>>>>>> >>>>>>>>>> bsearch routines (or std::sort and friends in case of C++): >>>>>>>>>> * using comparison function that violates ordering axioms >>>>>>>>>> (reflexivity, >>>>>>>>>> symmetry, transitivity) >>>>>>>...
2008 Sep 10
1
Xen-3.3 Etch amd64 compil error
...alnum.c:33: erreur: expected '')'' before ''c'' make[8]: *** [lib_a-iswalnum.o] Erreur 1 Dans le fichier inclus à partir de /usr/src/xen-3.3.0/stubdom/../extras/mini-os/include/posix/stdlib.h:4, à partir de ../../../../../newlib-1.16.0/newlib/libc/search/bsearch.c:64: /usr/src/xen-3.3.0/stubdom/newlib-1.16.0/newlib/libc/include/stdlib.h:14:20: erreur: stddef.h : Aucun fichier ou répertoire de ce type In file included from /usr/src/xen-3.3.0/stubdom/newlib-1.16.0/newlib/libc/include/sys/reent.h:14, from /usr/src/xen-3.3.0/stubdom/newlib-...
2012 Nov 13
0
older gcc don't know --as-needed
...gnu99 -g -O2 -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -fno-builtin-strftime -no-undefined -Wl,--as-needed -o test-lib test_lib-test-lib.o test_lib-test-array.o test_lib-test-aqueue.o test_lib-test-base64.o test_lib-test-bsearch-insert-pos.o test_lib-test-buffer.o test_lib-test-crc32.o test_lib-test-hash-format.o test_lib-test-hex-binary.o test_lib-test-istream-base64-encoder.o test_lib-test-istream-concat.o test_lib-test-istream-crlf.o test_lib-test-istream-seekable.o test_lib-test-istream-tee.o test_lib-test-llist.o test...
2020 Apr 19
2
[PATCH nbdkit 1/2] vddk: Use new vector library to allocate the argv list.
--- plugins/vddk/vddk.c | 41 +++++++++++++++++++++++++---------------- TODO | 1 - 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c index 87c0d146..d1a3015f 100644 --- a/plugins/vddk/vddk.c +++ b/plugins/vddk/vddk.c @@ -51,6 +51,7 @@ #include "isaligned.h" #include "minmax.h" #include
2007 Mar 15
1
[PATCH] fix gcc warnings in 1.0rc26
Hi, I have made a small patchset to fix some of the GCC warnings. With these patches, I was able to compile dovecot r_1_0_rc26 with the following options: -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast Wstrict-prototypes -Wredundant-decls -Wcast-align -Wwrite-strings Wpacked -Winline -Wdisabled-optimization
2015 Feb 04
1
[PATCH v3 18/18] vhost: vhost_scsi_handle_vq() should just use copy_from_user()
...,7 @@ obj-y += lockref.o obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \ bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \ - gcd.o lcm.o list_sort.o uuid.o flex_array.o iovec.o clz_ctz.o \ + gcd.o lcm.o list_sort.o uuid.o flex_array.o clz_ctz.o \ bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o \ percpu-refcount.o percpu_ida.o rhashtable.o reciprocal_div.o obj-y += string_helpers.o diff --git a/lib/iovec.c b/lib/iovec.c deleted file mode 100644 index d8f17a9..0000000 --- a/lib/iovec.c +++ /dev/null @@ -1,36 +0,0 @@ -#includ...
2015 Feb 04
1
[PATCH v3 18/18] vhost: vhost_scsi_handle_vq() should just use copy_from_user()
...,7 @@ obj-y += lockref.o obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \ bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \ - gcd.o lcm.o list_sort.o uuid.o flex_array.o iovec.o clz_ctz.o \ + gcd.o lcm.o list_sort.o uuid.o flex_array.o clz_ctz.o \ bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o \ percpu-refcount.o percpu_ida.o rhashtable.o reciprocal_div.o obj-y += string_helpers.o diff --git a/lib/iovec.c b/lib/iovec.c deleted file mode 100644 index d8f17a9..0000000 --- a/lib/iovec.c +++ /dev/null @@ -1,36 +0,0 @@ -#includ...