From a794235489a8cea454b3f64fdad56ce202fdf830 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Fri, 6 Aug 2004 21:49:54 +0000 Subject: [PATCH] * include/string.h (memchr, memcmp, strchr, strcmp, strcspn) (strlen, strncmp, strpbrk, strrchr, strspn, strstr): Add pure attribute. --- winsup/mingw/ChangeLog | 6 ++++++ winsup/mingw/include/string.h | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index fe2aa456c..ab9a7aae4 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,9 @@ +2004-08-07 Danny Smith + + * include/string.h (memchr, memcmp, strchr, strcmp, strcspn) + (strlen, strncmp, strpbrk, strrchr, strspn, strstr): Add pure + attribute. + 2004-07-30 Danny Smith * include/dirent.h (struct _wdirent): Remove obsolete comment. diff --git a/winsup/mingw/include/string.h b/winsup/mingw/include/string.h index f77ea83cd..44fff31ce 100644 --- a/winsup/mingw/include/string.h +++ b/winsup/mingw/include/string.h @@ -33,27 +33,27 @@ extern "C" { /* * Prototypes of the ANSI Standard C library string functions. */ -_CRTIMP void* __cdecl memchr (const void*, int, size_t); -_CRTIMP int __cdecl memcmp (const void*, const void*, size_t); +_CRTIMP void* __cdecl memchr (const void*, int, size_t) __MINGW_ATTRIB_PURE; +_CRTIMP int __cdecl memcmp (const void*, const void*, size_t) __MINGW_ATTRIB_PURE; _CRTIMP void* __cdecl memcpy (void*, const void*, size_t); _CRTIMP void* __cdecl memmove (void*, const void*, size_t); _CRTIMP void* __cdecl memset (void*, int, size_t); _CRTIMP char* __cdecl strcat (char*, const char*); -_CRTIMP char* __cdecl strchr (const char*, int); -_CRTIMP int __cdecl strcmp (const char*, const char*); +_CRTIMP char* __cdecl strchr (const char*, int) __MINGW_ATTRIB_PURE; +_CRTIMP int __cdecl strcmp (const char*, const char*) __MINGW_ATTRIB_PURE; _CRTIMP int __cdecl strcoll (const char*, const char*); /* Compare using locale */ _CRTIMP char* __cdecl strcpy (char*, const char*); -_CRTIMP size_t __cdecl strcspn (const char*, const char*); +_CRTIMP size_t __cdecl strcspn (const char*, const char*) __MINGW_ATTRIB_PURE; _CRTIMP char* __cdecl strerror (int); /* NOTE: NOT an old name wrapper. */ -_CRTIMP size_t __cdecl strlen (const char*); +_CRTIMP size_t __cdecl strlen (const char*) __MINGW_ATTRIB_PURE; _CRTIMP char* __cdecl strncat (char*, const char*, size_t); -_CRTIMP int __cdecl strncmp (const char*, const char*, size_t); +_CRTIMP int __cdecl strncmp (const char*, const char*, size_t) __MINGW_ATTRIB_PURE; _CRTIMP char* __cdecl strncpy (char*, const char*, size_t); -_CRTIMP char* __cdecl strpbrk (const char*, const char*); -_CRTIMP char* __cdecl strrchr (const char*, int); -_CRTIMP size_t __cdecl strspn (const char*, const char*); -_CRTIMP char* __cdecl strstr (const char*, const char*); +_CRTIMP char* __cdecl strpbrk (const char*, const char*) __MINGW_ATTRIB_PURE; +_CRTIMP char* __cdecl strrchr (const char*, int) __MINGW_ATTRIB_PURE; +_CRTIMP size_t __cdecl strspn (const char*, const char*) __MINGW_ATTRIB_PURE; +_CRTIMP char* __cdecl strstr (const char*, const char*) __MINGW_ATTRIB_PURE; _CRTIMP char* __cdecl strtok (char*, const char*); _CRTIMP size_t __cdecl strxfrm (char*, const char*, size_t);