From: Hallvard Furuseth Date: Sat, 4 Sep 1999 21:15:49 +0000 (+0000) Subject: Some constification & lint removal X-Git-Tag: TWEB_OL_BASE~25 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4a5e2febed6fdffa1e10ce3ae15340f35aa4742e;p=openldap Some constification & lint removal --- diff --git a/include/ldap_schema.h b/include/ldap_schema.h index 29c55a284d..c0c21bc88d 100644 --- a/include/ldap_schema.h +++ b/include/ldap_schema.h @@ -161,7 +161,7 @@ ldap_matchingrule2str LDAP_P(( LDAP_F( char *) ldap_scherr2str LDAP_P(( - int code )); + int code )) LDAP_GCCATTR((const)); LDAP_END_DECL diff --git a/libraries/libldap/schema.c b/libraries/libldap/schema.c index ffbe2bd256..d3fb9a836c 100644 --- a/libraries/libldap/schema.c +++ b/libraries/libldap/schema.c @@ -1834,7 +1834,7 @@ ldap_str2objectclass( const char * s, int * code, const char ** errp ) } } -static char *err2text[] = { +static char *const err2text[] = { "", "Out of memory", "Unexpected token", diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index b554ede05a..93e8ee4d46 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -35,7 +35,9 @@ static unsigned long conn_nextid = 0; #define SLAP_C_BINDING 0x03 /* binding */ #define SLAP_C_CLOSING 0x04 /* closing */ -char* connection_state2str( int state ) { +const char * +connection_state2str( int state ) +{ switch( state ) { case SLAP_C_INVALID: return "!"; case SLAP_C_INACTIVE: return "|"; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index feeabf5556..4be7e9310c 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -189,7 +189,7 @@ long connection_init LDAP_P(( void connection_closing LDAP_P(( Connection *c )); int connection_state_closing LDAP_P(( Connection *c )); -char *connection_state2str LDAP_P(( int state )); +const char *connection_state2str LDAP_P(( int state )) LDAP_GCCATTR((const)); int connection_write LDAP_P((ber_socket_t s)); int connection_read LDAP_P((ber_socket_t s)); @@ -387,7 +387,7 @@ void parse_oc_old LDAP_P(( Backend *be, const char *fname, int lineno, int argc, void parse_oc LDAP_P(( const char *fname, int lineno, char *line, char **argv )); void parse_at LDAP_P(( const char *fname, int lineno, char *line, char **argv )); void parse_oidm LDAP_P(( const char *fname, int lineno, int argc, char **argv )); -char *scherr2str LDAP_P((int code)); +char *scherr2str LDAP_P((int code)) LDAP_GCCATTR((const)); int dscompare LDAP_P(( const char *s1, const char *s2del, char delim )); /* * str2filter.c diff --git a/servers/slapd/schemaparse.c b/servers/slapd/schemaparse.c index 3f65bc41ed..f624b5dce8 100644 --- a/servers/slapd/schemaparse.c +++ b/servers/slapd/schemaparse.c @@ -15,15 +15,13 @@ #include "slap.h" #include "ldap_schema.h" -static Avlnode *object_classes = NULL; - int global_schemacheck = 1; /* schemacheck on is default */ static void oc_usage_old(void) LDAP_GCCATTR((noreturn)); static void oc_usage(void) LDAP_GCCATTR((noreturn)); static void at_usage(void) LDAP_GCCATTR((noreturn)); -static char *err2text[] = { +static char *const err2text[] = { "", "Out of memory", "Objectclass not found",