diff options
Diffstat (limited to 'sysdeps/generic/strlen.c')
-rw-r--r-- | sysdeps/generic/strlen.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/sysdeps/generic/strlen.c b/sysdeps/generic/strlen.c index 5e8d360c9a..37dc9ed20c 100644 --- a/sysdeps/generic/strlen.c +++ b/sysdeps/generic/strlen.c @@ -1,24 +1,23 @@ -/* Copyright (C) 1991, 1993 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1993, 1997 Free Software Foundation, Inc. Written by Torbjorn Granlund (tege@sics.se), with help from Dan Sahlin (dan@sics.se); commentary by Jim Blandy (jimb@ai.mit.edu). -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -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. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include <ansidecl.h> #include <string.h> @@ -26,10 +25,11 @@ Cambridge, MA 02139, USA. */ the null terminator quickly by testing four bytes at a time. */ size_t -DEFUN(strlen, (str), CONST char *str) +strlen (str) + const char *str; { - CONST char *char_ptr; - CONST unsigned long int *longword_ptr; + const char *char_ptr; + const unsigned long int *longword_ptr; unsigned long int longword, magic_bits, himagic, lomagic; /* Handle the first few characters by reading one character at a time. @@ -48,9 +48,9 @@ DEFUN(strlen, (str), CONST char *str) /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits the "holes." Note that there is a hole just to the left of each byte, with an extra at the end: - + bits: 01111110 11111110 11111110 11111111 - bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD + bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD The 1-bits make sure that carries propagate to the next 0-bit. The 0-bits provide holes for carries to fall into. */ @@ -123,7 +123,7 @@ DEFUN(strlen, (str), CONST char *str) /* Which of the bytes was the zero? If none of them were, it was a misfire; continue the search. */ - CONST char *cp = (CONST char *) (longword_ptr - 1); + const char *cp = (const char *) (longword_ptr - 1); if (cp[0] == 0) return cp - str; |