This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Some pure/const attributes added



FYI: I've commited the following patch.

Btw. crypt.h doesn't have use any attributes at all.  Any volunteer to
add __THROW and other attributes?

Andreas

2000-05-17  Andreas Jaeger  <aj@suse.de>

	* string/envz.h: Add pure attributes if possible.

	* string/argz.h: argz_count is a pure function.

	* string/strings.h: Add pure and const attributes if possible.

============================================================
Index: string/envz.h
--- string/envz.h	1999/10/09 21:24:43	1.12
+++ string/envz.h	2000/05/17 11:41:03
@@ -1,5 +1,5 @@
 /* Routines for dealing with '\0' separated environment vectors
-   Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1995, 96, 98, 99, 2000 Free Software Foundation, Inc.
 
    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
@@ -31,12 +31,14 @@
 
 /* Returns a pointer to the entry in ENVZ for NAME, or 0 if there is none.  */
 extern char *envz_entry (__const char *__restrict __envz, size_t __envz_len,
-			 __const char *__restrict __name) __THROW;
+			 __const char *__restrict __name)
+     __THROW __attribute_pure__;
 
 /* Returns a pointer to the value portion of the entry in ENVZ for NAME, or 0
    if there is none.  */
 extern char *envz_get (__const char *__restrict __envz, size_t __envz_len,
-		       __const char *__restrict __name) __THROW;
+		       __const char *__restrict __name)
+     __THROW __attribute_pure__;
 
 /* Adds an entry for NAME with value VALUE to ENVZ & ENVZ_LEN.  If an entry
    with the same name already exists in ENVZ, it is removed.  If VALUE is
============================================================
Index: string/strings.h
--- string/strings.h	1999/10/09 21:24:53	1.9
+++ string/strings.h	2000/05/17 11:41:03
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1996, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,96,97,99,2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -30,7 +30,8 @@
 __BEGIN_DECLS
 
 /* Compare N bytes of S1 and S2 (same as memcmp).  */
-extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) __THROW;
+extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
+     __THROW __attribute_pure__;
 
 /* Copy N bytes of SRC to DEST (like memmove, but args reversed).  */
 extern void bcopy (__const void *__src, void *__dest, size_t __n) __THROW;
@@ -40,20 +41,21 @@
 
 /* Return the position of the first bit set in I, or 0 if none are set.
    The least-significant bit is position 1, the most-significant 32.  */
-extern int ffs (int __i) __THROW;
+extern int ffs (int __i) __THROW __attribute__ ((const));
 
 /* Find the first occurrence of C in S (same as strchr).  */
-extern char *index (__const char *__s, int __c) __THROW;
+extern char *index (__const char *__s, int __c) __THROW __attribute_pure__;
 
 /* Find the last occurrence of C in S (same as strrchr).  */
-extern char *rindex (__const char *__s, int __c) __THROW;
+extern char *rindex (__const char *__s, int __c) __THROW __attribute_pure__;
 
 /* Compare S1 and S2, ignoring case.  */
-extern int strcasecmp (__const char *__s1, __const char *__s2) __THROW;
+extern int strcasecmp (__const char *__s1, __const char *__s2)
+     __THROW __attribute_pure__;
 
 /* Compare no more than N chars of S1 and S2, ignoring case.  */
 extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
-     __THROW;
+     __THROW __attribute_pure__;
 
 __END_DECLS
 

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]