From c2781df0d5477be58c3189c6d3c17b261d7b8b89 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 1 Jun 2007 12:01:53 +0000 Subject: r23289: Provide support for GCC attributes _PURE_, _NONNULL_, _DEPRECATED_, _NORETURN_ and _WARN_UNUSED_RESULT_. (This used to be commit 44248f662f0b609dad6a7b437948f12d661a28f7) --- source4/lib/json/debug.c | 2 +- source4/lib/json/linkhash.c | 2 +- source4/lib/util/fault.c | 2 +- source4/lib/util/util_str.c | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/json/debug.c b/source4/lib/json/debug.c index eaa6fca33c..a315b0e2a4 100644 --- a/source4/lib/json/debug.c +++ b/source4/lib/json/debug.c @@ -41,7 +41,7 @@ extern void mc_set_syslog(int syslog) _syslog = syslog; } -void mc_abort(const char *msg, ...) +_NORETURN_ void mc_abort(const char *msg, ...) { va_list ap; va_start(ap, msg); diff --git a/source4/lib/json/linkhash.c b/source4/lib/json/linkhash.c index 6cfc9a0ea6..b04254b597 100644 --- a/source4/lib/json/linkhash.c +++ b/source4/lib/json/linkhash.c @@ -20,7 +20,7 @@ #include "linkhash.h" -void lh_abort(const char *msg, ...) +_NORETURN_ void lh_abort(const char *msg, ...) { va_list ap; va_start(ap, msg); diff --git a/source4/lib/util/fault.c b/source4/lib/util/fault.c index c7d6b7ede6..86a0b61a76 100644 --- a/source4/lib/util/fault.c +++ b/source4/lib/util/fault.c @@ -118,7 +118,7 @@ _PUBLIC_ const char *panic_action = NULL; /** Something really nasty happened - panic ! **/ -_PUBLIC_ void smb_panic(const char *why) +_PUBLIC_ _NORETURN_ void smb_panic(const char *why) { int result; diff --git a/source4/lib/util/util_str.c b/source4/lib/util/util_str.c index 86cd3176c5..c088e26fe5 100644 --- a/source4/lib/util/util_str.c +++ b/source4/lib/util/util_str.c @@ -36,16 +36,16 @@ /** Trim the specified elements off the front and back of a string. **/ -_PUBLIC_ BOOL trim_string(char *s,const char *front,const char *back) +_PUBLIC_ bool trim_string(char *s, const char *front, const char *back) { - BOOL ret = False; + bool ret = false; size_t front_len; size_t back_len; size_t len; /* Ignore null or empty strings. */ if (!s || (s[0] == '\0')) - return False; + return false; front_len = front? strlen(front) : 0; back_len = back? strlen(back) : 0; @@ -58,7 +58,7 @@ _PUBLIC_ BOOL trim_string(char *s,const char *front,const char *back) * easily overlap. Found by valgrind. JRA. */ memmove(s, s+front_len, (len-front_len)+1); len -= front_len; - ret=True; + ret=true; } } @@ -66,7 +66,7 @@ _PUBLIC_ BOOL trim_string(char *s,const char *front,const char *back) while ((len >= back_len) && strncmp(s+len-back_len,back,back_len)==0) { s[len-back_len]='\0'; len -= back_len; - ret=True; + ret=true; } } return ret; @@ -75,7 +75,7 @@ _PUBLIC_ BOOL trim_string(char *s,const char *front,const char *back) /** Find the number of 'c' chars in a string **/ -_PUBLIC_ size_t count_chars(const char *s, char c) +_PUBLIC_ _PURE_ size_t count_chars(const char *s, char c) { size_t count = 0; @@ -218,7 +218,7 @@ _PUBLIC_ size_t strhex_to_str(char *p, size_t len, const char *strhex) /** * Parse a hex string and return a data blob. */ -_PUBLIC_ DATA_BLOB strhex_to_data_blob(const char *strhex) +_PUBLIC_ _PURE_ DATA_BLOB strhex_to_data_blob(const char *strhex) { DATA_BLOB ret_blob = data_blob(NULL, strlen(strhex)/2+1); -- cgit