about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-03-06 19:57:00 +0000
committerRoland McGrath <roland@gnu.org>1995-03-06 19:57:00 +0000
commit286351153566acc7dcc82834d90e0b8d87dff8be (patch)
treebb5531f838010159e5db6aa57f931eb9b5e167d9
parent797fa6204a2f642a84c379033e182863c39bdcef (diff)
downloadglibc-286351153566acc7dcc82834d90e0b8d87dff8be.tar.gz
glibc-286351153566acc7dcc82834d90e0b8d87dff8be.tar.xz
glibc-286351153566acc7dcc82834d90e0b8d87dff8be.zip
Mon Mar 6 12:34:56 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> cvs/make-3-72-9 cvs/make-3-72-11 cvs/make-3-72-10
	* ctype/ctype.h (_ISbit): New macro, defined dependent on byte order.
	(_IS* enum): Use _ISbit to produce values.
-rw-r--r--ChangeLog5
-rw-r--r--ctype/ctype.h57
-rw-r--r--elf/libelf.h9
-rw-r--r--stdlib/.cvsignore4
4 files changed, 48 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index 57c73d8500..1bab48f8e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar  6 12:34:56 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
+
+	* ctype/ctype.h (_ISbit): New macro, defined dependent on byte order.
+	(_IS* enum): Use _ISbit to produce values.
+
 Sun Mar  5 19:40:13 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
 
 	* locale/localeinfo.h: Rewritten for new locale system, using
diff --git a/ctype/ctype.h b/ctype/ctype.h
index 9c97831585..f568ff45a8 100644
--- a/ctype/ctype.h
+++ b/ctype/ctype.h
@@ -27,39 +27,50 @@ Cambridge, MA 02139, USA.  */
 
 __BEGIN_DECLS
 
-/* These are all the characteristics of characters.  All the
-   interdependencies (such as that an alphabetic is an uppercase or a
-   lowercase) are here.  If there get to be more than
-   (sizeof (unsigned short int) * CHAR_BIT) distinct characteristics,
-   many things must be changed that use `unsigned short int's.  */
+/* These are all the characteristics of characters.
+   If there get to be more than 16 distinct characteristics,
+   many things must be changed that use `unsigned short int's.
+
+   The characteristics are stored always in network byte order (big
+   endian).  We define the bit value interpretations here dependent on the
+   machine's byte order.  */
+
+#include <endian.h>
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define _ISbit(bit)	(1 << bit)
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
+#define _ISbit(bit)	((1 << bit) << (bit < 8 ? 8 : -8))
+#endif
+
 enum
 {
-  _ISupper = 1 << 0,		/* UPPERCASE.  */
-  _ISlower = 1 << 1,		/* lowercase.  */
-  _ISalpha = 1 << 2,	        /* Alphabetic.  */
-  _ISdigit = 1 << 3,		/* Numeric.  */
-  _ISxdigit = 1 << 4,           /* Hexadecimal numeric.  */
-  _ISspace = 1 << 5,		/* Whitespace.  */
-  _ISprint = 1 << 6,            /* Printing.  */
-  _ISgraph = 1 << 7,	        /* Graphical.  */
-  _ISblank = 1 << 8,		/* Blank (usually SPC and TAB).  */
-  _IScntrl = 1 << 9,		/* Control character.  */
-  _ISpunct = 1 << 10,		/* Punctuation.  */
+  _ISupper = _ISbit (0),	/* UPPERCASE.  */
+  _ISlower = _ISbit (1),	/* lowercase.  */
+  _ISalpha = _ISbit (2),	/* Alphabetic.  */
+  _ISdigit = _ISbit (3),	/* Numeric.  */
+  _ISxdigit = _ISbit (4),	/* Hexadecimal numeric.  */
+  _ISspace = _ISbit (5),	/* Whitespace.  */
+  _ISprint = _ISbit (6),	/* Printing.  */
+  _ISgraph = _ISbit (7),	/* Graphical.  */
+  _ISblank = _ISbit (8),	/* Blank (usually SPC and TAB).  */
+  _IScntrl = _ISbit (9),	/* Control character.  */
+  _ISpunct = _ISbit (10),	/* Punctuation.  */
 
   /* The following are defined in POSIX.2 as being combinations of the
      classes above.  */
   _ISalnum = _ISalpha | _ISdigit	/* Alphanumeric.  */
 };
 
-/* These are defined in localeinfo.c.
+/* These are defined in ctype-info.c.
    The declarations here must match those in localeinfo.h.
 
-   These point to the second element ([1]) of arrays of size (UCHAR_MAX + 1).
-   EOF is -1, so [EOF] is the first element of the original array.
-   ANSI requires that the ctype functions work for `unsigned char' values
-   and for EOF.  The case conversion arrays are of `short int's rather than
-   `unsigned char's because tolower (EOF) must be EOF, which doesn't fit
-   into an `unsigned char'.  */
+   These point into arrays of 384, so they can be indexed by any `unsigned
+   char' value [0,255]; by EOF (-1); or by any `signed char' value
+   [-128,-1).  ANSI requires that the ctype functions work for `unsigned
+   char' values and for EOF; we also support negative `signed char' values
+   for broken old programs.  The case conversion arrays are of `short int's
+   rather than `unsigned char's because tolower (EOF) must be EOF, which
+   doesn't fit into an `unsigned char'.  */
 extern __const unsigned short int *__ctype_b;	/* Characteristics.  */
 extern __const short int *__ctype_tolower;	/* Case conversions.  */
 extern __const short int *__ctype_toupper;	/* Case conversions.  */
diff --git a/elf/libelf.h b/elf/libelf.h
index e7119e98b5..e95dd93eaa 100644
--- a/elf/libelf.h
+++ b/elf/libelf.h
@@ -107,7 +107,7 @@ typedef struct
 /* Data descriptor.  */
 typedef struct
 {
-  Elf_Void *d_buf;
+  void *d_buf;
   Elf_Type d_type;
   size_t d_size;
   off_t d_off;			/* Offset into section.  */
@@ -155,7 +155,7 @@ extern unsigned int elf_flagdata __P ((Elf_Data *__data, Elf_Cmd __cmd,
 extern unsigned	int elf_flagehdr __P ((Elf *__elf, Elf_Cmd __cmd,
 				       unsigned int __flags));
 /* Modify flags affecting the ELF program header.  */
-extern unsigned	int elf_flagphdr __P ((Elf *__elf, Elf_Cmd, __cmd
+extern unsigned	int elf_flagphdr __P ((Elf *__elf, Elf_Cmd __cmd,
 				       unsigned int __flags));
 /* Modify flags affecting the given section's data.  */
 extern unsigned	int elf_flagscn __P ((Elf_Scn *__scn, Elf_Cmd __cmd,
@@ -221,8 +221,9 @@ elf_hash (__const char *__name)
       __hi = __hash & 0xf0000000;
       if (__hi != 0)
 	__hash ^= __hi >> 24;
-      hash &= ~__hi;
+      __hash &= ~__hi;
     }
+  return __hash;
 }
 #endif
 
@@ -261,7 +262,7 @@ extern char *elf_strptr __P ((Elf *__elf, size_t __section, size_t __offset));
 
 /* If CMD is ELF_C_NULL, update ELF's data structures based on any
    user modifications, and set the ELF_F_DIRTY flag if anything changed.
-   If CMD is ELF_C_WRITE, do that and then write the changes to the file.
+   If CMD is ELF_C_WRITE, do that and then write the changes to the file.  */
 extern off_t elf_update __P ((Elf *__elf, Elf_Cmd __cmd));
 
 /* Handle ELF version VER.  Return the old version handled,
diff --git a/stdlib/.cvsignore b/stdlib/.cvsignore
new file mode 100644
index 0000000000..1f69fd919a
--- /dev/null
+++ b/stdlib/.cvsignore
@@ -0,0 +1,4 @@
+*.gz *.Z *.tar *.tgz
+=*
+TODO COPYING* AUTHORS copyr-* copying.*
+glibc-*