diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/strrchr.c | 12 | ||||
-rw-r--r-- | sysdeps/i386/strrchr.S | 6 |
2 files changed, 8 insertions, 10 deletions
diff --git a/sysdeps/generic/strrchr.c b/sysdeps/generic/strrchr.c index 29402f086c..663b6aa753 100644 --- a/sysdeps/generic/strrchr.c +++ b/sysdeps/generic/strrchr.c @@ -16,25 +16,23 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <string.h> - /* Find the last ocurrence of C in S. */ char * -DEFUN(strrchr, (s, c), CONST char *s AND int c) +strrchr (const char *s, int c) { - register CONST char *found, *p; + register const char *found, *p; c = (unsigned char) c; /* Since strchr is fast, we use it rather than the obvious loop. */ - + if (c == '\0') - return strchr(s, '\0'); + return strchr (s, '\0'); found = NULL; - while ((p = strchr(s, c)) != NULL) + while ((p = strchr (s, c)) != NULL) { found = p; s = p + 1; diff --git a/sysdeps/i386/strrchr.S b/sysdeps/i386/strrchr.S index 468a940d74..26d6a22d6b 100644 --- a/sysdeps/i386/strrchr.S +++ b/sysdeps/i386/strrchr.S @@ -58,7 +58,7 @@ ENTRY (strrchr) implementation (this is because all processor inherant boundaries are multiples of 4. */ - testb $3, %esi /* correctly aligned ? */ + testl $3, %esi /* correctly aligned ? */ jz L19 /* yes => begin loop */ movb (%esi), %dl /* load byte in question (we need it twice) */ cmpb %dl, %cl /* compare byte */ @@ -68,7 +68,7 @@ L11: orb %dl, %dl /* is NUL? */ jz L2 /* yes => return NULL */ incl %esi /* increment pointer */ - testb $3, %esi /* correctly aligned ? */ + testl $3, %esi /* correctly aligned ? */ jz L19 /* yes => begin loop */ movb (%esi), %dl /* load byte in question (we need it twice) */ cmpb %dl, %cl /* compare byte */ @@ -78,7 +78,7 @@ L12: orb %dl, %dl /* is NUL? */ jz L2 /* yes => return NULL */ incl %esi /* increment pointer */ - testb $3, %esi /* correctly aligned ? */ + testl $3, %esi /* correctly aligned ? */ jz L19 /* yes => begin loop */ movb (%esi), %dl /* load byte in question (we need it twice) */ cmpb %dl, %cl /* compare byte */ |