diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2007-02-17 13:07:16 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2007-02-17 13:07:16 +0100 |
commit | 1cc1884587bd156fb210c2a049ae12b763a2a9e1 (patch) | |
tree | c4ccbf52096cd4d424879384c6cbaed739c3dc44 /nslcd | |
parent | d352025fc0e8fea2f7f166b3c3f945d3aa16efa3 (diff) |
add gcc attributes to some functions and parameters
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@250 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd')
-rw-r--r-- | nslcd/cfg.h | 10 | ||||
-rw-r--r-- | nslcd/common.h | 4 | ||||
-rw-r--r-- | nslcd/dict.h | 11 | ||||
-rw-r--r-- | nslcd/log.h | 9 | ||||
-rw-r--r-- | nslcd/nslcd.c | 3 |
5 files changed, 26 insertions, 11 deletions
diff --git a/nslcd/cfg.h b/nslcd/cfg.h index 995aa13..b9009f9 100644 --- a/nslcd/cfg.h +++ b/nslcd/cfg.h @@ -28,6 +28,7 @@ #include "ldap-nss.h" #include "dict.h" +#include "compat/attrs.h" /* maximum number of URIs */ #define NSS_LDAP_CONFIG_URI_MAX 31 @@ -161,10 +162,13 @@ extern struct ldap_config *nslcd_cfg; #define NSS_LDAP_FLAGS_RFC2307BIS 0x0004 #define NSS_LDAP_FLAGS_CONNECT_POLICY_ONESHOT 0x0008 -int _nss_ldap_test_config_flag(unsigned int flag); +int _nss_ldap_test_config_flag(unsigned int flag) + MUST_USE; -int cfg_init(void); +int cfg_init(void) + MUST_USE; -enum nss_status _nss_ldap_add_uri (struct ldap_config *result, const char *uri,char **buffer, size_t *buflen); +enum nss_status _nss_ldap_add_uri (struct ldap_config *result, const char *uri,char **buffer, size_t *buflen) + MUST_USE; #endif /* _CFG_H */ diff --git a/nslcd/common.h b/nslcd/common.h index 8c53cdd..2a14e30 100644 --- a/nslcd/common.h +++ b/nslcd/common.h @@ -26,13 +26,15 @@ #include "nslcd.h" #include "nslcd-common.h" +#include "compat/attrs.h" /* translates a nss code (as defined in nss.h) to a nslcd return code (as defined in nslcd.h) */ /* FIXME: this is a temporary hack, get rid of it */ #include <nss.h> -int nss2nslcd(enum nss_status code); +int nss2nslcd(enum nss_status code) + PURE MUST_USE; /* macros for basic read and write operations, the following diff --git a/nslcd/dict.h b/nslcd/dict.h index 12a46c9..104c5a7 100644 --- a/nslcd/dict.h +++ b/nslcd/dict.h @@ -23,6 +23,8 @@ #ifndef _DICT_H #define _DICT_H +#include "compat/attrs.h" + /* These functions provide a mapping between a case insensitive string and a pointer. @@ -31,7 +33,8 @@ typedef struct dictionary DICT; /* Create a new instance of a dictionary. Returns NULL in case of memory allocation errors. */ -DICT *dict_new(void); +DICT *dict_new(void) + LIKE_MALLOC MUST_USE; /* Add a relation in the dictionary. The key is duplicated and can be reused by the caller. The pointer is just stored. @@ -43,7 +46,8 @@ int dict_put(DICT *dict,const char *key,void *value); /* Look up a key in the dictionary and return the associated value. NULL is returned if the key is not found in the dictionary. All key comparisons are case insensitive. */ -void *dict_get(DICT *dict,const char *key); +void *dict_get(DICT *dict,const char *key) + MUST_USE; /* Delete a key-value association from the dictionary. All key comparisons are case insensitive. */ @@ -61,6 +65,7 @@ void dict_values_first(DICT *dict); /* Function for looping over all dictionary values. This returns a stored value. NULL is returned when all stored values have been returned. */ -void *dict_values_next(DICT *dict); +void *dict_values_next(DICT *dict) + MUST_USE; #endif /* _DICT_H */ diff --git a/nslcd/log.h b/nslcd/log.h index 8e66a1e..1a20f9c 100644 --- a/nslcd/log.h +++ b/nslcd/log.h @@ -1,7 +1,7 @@ /* log.h - definitions of logging funtions - Copyright (C) 2002, 2003 Arthur de Jong + Copyright (C) 2002, 2003, 2007 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ #include <syslog.h> +#include "compat/attrs.h" /* set loglevel when no logging is configured */ @@ -49,12 +50,14 @@ void log_startlogging(void); /* log the given message using the configured logging method */ -void log_log(int pri,const char *format, ...); +void log_log(int pri,const char *format, ...) + LIKE_PRINTF(2,3); /* return the syslog loglevel represented by the string return -1 on unknown */ -int log_getloglevel(const char *lvl); +int log_getloglevel(const char *lvl) + MUST_USE; #endif /* not _LOG_H */ diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c index 9d1e336..93efed7 100644 --- a/nslcd/nslcd.c +++ b/nslcd/nslcd.c @@ -49,6 +49,7 @@ #include "nslcd.h" #include "log.h" #include "common.h" +#include "compat/attrs.h" /* the definition of the environment */ @@ -487,7 +488,7 @@ static void install_sighandler(int signum,RETSIGTYPE (*handler) (int)) } } -static void *worker(void *arg) +static void *worker(void UNUSED(*arg)) { /* start waiting for incoming connections */ while (nslcd_exitsignal==0) |