~ubuntu-branches/ubuntu/maverick/avr-libc/maverick

« back to all changes in this revision

Viewing changes to libc/stdlib/bsearch.c

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2009-10-31 11:52:10 UTC
  • mfrom: (1.1.8 upstream) (4.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091031115210-x0mlijnegkce86fk
Tags: 1:1.6.7-1
* New upstream relese (closes: #544030)
* Added lintian overrides (closes: #553265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
#include <stddef.h>
35
35
#include <stdlib.h>
 
36
#include "sectionname.h"
36
37
 
37
38
/*
38
39
 * Perform a binary search.
50
51
 * have to make lim 3, then halve, obtaining 1, so that we will only
51
52
 * look at item 3.
52
53
 */
 
54
ATTRIBUTE_CLIB_SECTION
53
55
void *
54
 
bsearch(key, base0, nmemb, size, compar)
55
 
        register const void *key;
56
 
        const void *base0;
57
 
        size_t nmemb;
58
 
        register size_t size;
59
 
        register int (*compar)(const void *, const void *);
 
56
bsearch(register const void *key, const void *base0, size_t nmemb,
 
57
        register size_t size, register int (*compar)(const void *, const void *))
60
58
{
61
59
        register const char *base = base0;
62
60
        register size_t lim;