diff options
author | tjr <tjr@FreeBSD.org> | 2004-07-23 02:20:05 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-07-23 02:20:05 +0000 |
commit | 2ac758c6fa97dfedc34863b3d20ebf01c9f80f56 (patch) | |
tree | 68878076c9ee17707fc5c695b818a0a97c838dab /include | |
parent | 2c07de53fe80ba3845ca4f08bda41fb515f4f573 (diff) | |
download | FreeBSD-src-2ac758c6fa97dfedc34863b3d20ebf01c9f80f56.zip FreeBSD-src-2ac758c6fa97dfedc34863b3d20ebf01c9f80f56.tar.gz |
Mark functions pure where applicable. A notable exclusion is strcoll(),
which is not strictly pure because it calls malloc()/free() in some cases.
Diffstat (limited to 'include')
-rw-r--r-- | include/string.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/include/string.h b/include/string.h index 9a38656..3844d41 100644 --- a/include/string.h +++ b/include/string.h @@ -58,21 +58,21 @@ __BEGIN_DECLS #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE void *memccpy(void * __restrict, const void * __restrict, int, size_t); #endif -void *memchr(const void *, int, size_t); -int memcmp(const void *, const void *, size_t); +void *memchr(const void *, int, size_t) __pure; +int memcmp(const void *, const void *, size_t) __pure; void *memcpy(void * __restrict, const void * __restrict, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); #if __BSD_VISIBLE char *stpcpy(char *, const char *); -char *strcasestr(const char *, const char *); +char *strcasestr(const char *, const char *) __pure; #endif char *strcat(char * __restrict, const char * __restrict); -char *strchr(const char *, int); -int strcmp(const char *, const char *); +char *strchr(const char *, int) __pure; +int strcmp(const char *, const char *) __pure; int strcoll(const char *, const char *); char *strcpy(char * __restrict, const char * __restrict); -size_t strcspn(const char *, const char *); +size_t strcspn(const char *, const char *) __pure; #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE char *strdup(const char *); #endif @@ -84,24 +84,24 @@ int strerror_r(int, char *, size_t); size_t strlcat(char *, const char *, size_t); size_t strlcpy(char *, const char *, size_t); #endif -size_t strlen(const char *); +size_t strlen(const char *) __pure; #if __BSD_VISIBLE void strmode(int, char *); #endif char *strncat(char * __restrict, const char * __restrict, size_t); -int strncmp(const char *, const char *, size_t); +int strncmp(const char *, const char *, size_t) __pure; char *strncpy(char * __restrict, const char * __restrict, size_t); #if __BSD_VISIBLE -char *strnstr(const char *, const char *, size_t); +char *strnstr(const char *, const char *, size_t) __pure; #endif -char *strpbrk(const char *, const char *); -char *strrchr(const char *, int); +char *strpbrk(const char *, const char *) __pure; +char *strrchr(const char *, int) __pure; #if __BSD_VISIBLE char *strsep(char **, const char *); char *strsignal(int); #endif -size_t strspn(const char *, const char *); -char *strstr(const char *, const char *); +size_t strspn(const char *, const char *) __pure; +char *strstr(const char *, const char *) __pure; char *strtok(char * __restrict, const char * __restrict); #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 char *strtok_r(char *, const char *, char **); |