~ubuntu-branches/ubuntu/precise/wget/precise-proposed

« back to all changes in this revision

Viewing changes to lib/memchr.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-10-19 00:00:09 UTC
  • mfrom: (2.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20111019000009-8p33w3wz4b1rdri0
Tags: 1.13-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
  - Depend on libssl-dev 0.9.8k-7ubuntu4 (LP: #503339)
* Dropped changes, superseded in Debian:
  - Keep build dependencies in main:
    + debian/control: remove info2man build-dep
    + debian/patches/series: disable wget-infopod_generated_manpage
  - Mark wget Multi-Arch: foreign, so packages that aren't of the same arch
    can depend on it.
* Pass --with-ssl=openssl; we don't want to use gnutls, there's no udeb for
  it.
* Add a second build pass for the udeb, so we can build without libidn.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2006,
2
 
   2008, 2009 Free Software Foundation, Inc.
 
1
/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2011
 
2
   Free Software Foundation, Inc.
3
3
 
4
4
   Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
5
5
   with help from Dan Sahlin (dan@sics.se) and
97
97
      repeated_one |= repeated_one << 31 << 1;
98
98
      repeated_c |= repeated_c << 31 << 1;
99
99
      if (8 < sizeof (longword))
100
 
        {
101
 
          size_t i;
 
100
        {
 
101
          size_t i;
102
102
 
103
 
          for (i = 64; i < sizeof (longword) * 8; i *= 2)
104
 
            {
105
 
              repeated_one |= repeated_one << i;
106
 
              repeated_c |= repeated_c << i;
107
 
            }
108
 
        }
 
103
          for (i = 64; i < sizeof (longword) * 8; i *= 2)
 
104
            {
 
105
              repeated_one |= repeated_one << i;
 
106
              repeated_c |= repeated_c << i;
 
107
            }
 
108
        }
109
109
    }
110
110
 
111
111
  /* Instead of the traditional loop which tests each byte, we will test a
144
144
      longword longword1 = *longword_ptr ^ repeated_c;
145
145
 
146
146
      if ((((longword1 - repeated_one) & ~longword1)
147
 
           & (repeated_one << 7)) != 0)
148
 
        break;
 
147
           & (repeated_one << 7)) != 0)
 
148
        break;
149
149
      longword_ptr++;
150
150
      n -= sizeof (longword);
151
151
    }
162
162
  for (; n > 0; --n, ++char_ptr)
163
163
    {
164
164
      if (*char_ptr == c)
165
 
        return (void *) char_ptr;
 
165
        return (void *) char_ptr;
166
166
    }
167
167
 
168
168
  return NULL;