From 266d8f5fc0f7e730a906ed5bba203a8c59783c04 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 19 Dec 2001 21:23:11 +0000 Subject: [PATCH] misc cleanup --- libraries/libldap/libldap.dsp | 16 -------------- libraries/libldap/schema.c | 41 ++++++++++++++++++++++++----------- libraries/libldap/test.c | 25 ++++++++++++--------- libraries/libldap/utf-8.c | 2 +- 4 files changed, 44 insertions(+), 40 deletions(-) diff --git a/libraries/libldap/libldap.dsp b/libraries/libldap/libldap.dsp index a409864fce..3f05a1b205 100644 --- a/libraries/libldap/libldap.dsp +++ b/libraries/libldap/libldap.dsp @@ -167,14 +167,6 @@ SOURCE=.\delete.c # End Source File # Begin Source File -SOURCE=.\disptmpl.c -# End Source File -# Begin Source File - -SOURCE=..\..\include\disptmpl.h -# End Source File -# Begin Source File - SOURCE=.\dn.c # End Source File # Begin Source File @@ -339,14 +331,6 @@ SOURCE=.\sortctrl.c # End Source File # Begin Source File -SOURCE=.\srchpref.c -# End Source File -# Begin Source File - -SOURCE=..\..\include\srchpref.h -# End Source File -# Begin Source File - SOURCE=.\string.c # End Source File # Begin Source File diff --git a/libraries/libldap/schema.c b/libraries/libldap/schema.c index cf7a9923c4..dac2eb267b 100644 --- a/libraries/libldap/schema.c +++ b/libraries/libldap/schema.c @@ -20,8 +20,8 @@ #include -static LDAP_CONST char * -choose_name( char *names[], LDAP_CONST char *fallback ) +static const char * +choose_name( char *names[], const char *fallback ) { return( (names != NULL && names[0] != NULL) ? names[0] : fallback ); } @@ -296,7 +296,7 @@ print_extensions(safe_string *ss, LDAPSchemaExtensionItem **extensions) } char * -ldap_syntax2str( const LDAPSyntax * syn ) +ldap_syntax2str( LDAPSyntax * syn ) { safe_string * ss; char * retstring; @@ -328,7 +328,7 @@ ldap_syntax2str( const LDAPSyntax * syn ) } char * -ldap_matchingrule2str( const LDAPMatchingRule * mr ) +ldap_matchingrule2str( LDAPMatchingRule * mr ) { safe_string * ss; char * retstring; @@ -377,7 +377,7 @@ ldap_matchingrule2str( const LDAPMatchingRule * mr ) } char * -ldap_matchingruleuse2str( const LDAPMatchingRuleUse * mru ) +ldap_matchingruleuse2str( LDAPMatchingRuleUse * mru ) { safe_string * ss; char * retstring; @@ -426,7 +426,7 @@ ldap_matchingruleuse2str( const LDAPMatchingRuleUse * mru ) } char * -ldap_objectclass2str( const LDAPObjectClass * oc ) +ldap_objectclass2str( LDAPObjectClass * oc ) { safe_string * ss; char * retstring; @@ -505,7 +505,7 @@ ldap_objectclass2str( const LDAPObjectClass * oc ) } char * -ldap_attributetype2str( const LDAPAttributeType * at ) +ldap_attributetype2str( LDAPAttributeType * at ) { safe_string * ss; char * retstring; @@ -646,7 +646,7 @@ struct token { }; static int -get_token(const char ** sp, char ** token_val) +get_token( const char ** sp, char ** token_val ) { int kind; const char * p; @@ -1083,7 +1083,10 @@ ldap_syntax_free( LDAPSyntax * syn ) } LDAPSyntax * -ldap_str2syntax( const char * s, int * code, const char ** errp, const int flags ) +ldap_str2syntax( LDAP_CONST char * s, + int * code, + LDAP_CONST char ** errp, + LDAP_CONST int flags ) { int kind; const char * ss = s; @@ -1222,7 +1225,10 @@ ldap_matchingrule_free( LDAPMatchingRule * mr ) } LDAPMatchingRule * -ldap_str2matchingrule( const char * s, int * code, const char ** errp, const int flags ) +ldap_str2matchingrule( LDAP_CONST char * s, + int * code, + LDAP_CONST char ** errp, + LDAP_CONST int flags ) { int kind; const char * ss = s; @@ -1413,7 +1419,10 @@ ldap_matchingruleuse_free( LDAPMatchingRuleUse * mru ) } LDAPMatchingRuleUse * -ldap_str2matchingruleuse( const char * s, int * code, const char ** errp, const int flags ) +ldap_str2matchingruleuse( LDAP_CONST char * s, + int * code, + LDAP_CONST char ** errp, + LDAP_CONST int flags ) { int kind; const char * ss = s; @@ -1607,7 +1616,10 @@ ldap_attributetype_free(LDAPAttributeType * at) } LDAPAttributeType * -ldap_str2attributetype( const char * s, int * code, const char ** errp, const int flags ) +ldap_str2attributetype( LDAP_CONST char * s, + int * code, + LDAP_CONST char ** errp, + LDAP_CONST int flags ) { int kind; const char * ss = s; @@ -1982,7 +1994,10 @@ ldap_objectclass_free(LDAPObjectClass * oc) } LDAPObjectClass * -ldap_str2objectclass( const char * s, int * code, const char ** errp, const int flags ) +ldap_str2objectclass( LDAP_CONST char * s, + int * code, + LDAP_CONST char ** errp, + LDAP_CONST int flags ) { int kind; const char * ss = s; diff --git a/libraries/libldap/test.c b/libraries/libldap/test.c index 29cdf49409..5023dfe66a 100644 --- a/libraries/libldap/test.c +++ b/libraries/libldap/test.c @@ -35,13 +35,15 @@ /* local functions */ #ifndef HAVE_GETLINE -static char *getline LDAP_P(( char *line, int len, FILE *fp, char *prompt )); +static char *getline LDAP_P(( char *line, int len, FILE *fp, const char *prompt )); #endif -static char **get_list LDAP_P(( char *prompt )); -static int file_read LDAP_P(( char *path, struct berval *bv )); -static LDAPMod **get_modlist LDAP_P(( char *prompt1, char *prompt2, char *prompt3 )); +static char **get_list LDAP_P(( const char *prompt )); +static int file_read LDAP_P(( const char *path, struct berval *bv )); +static LDAPMod **get_modlist LDAP_P(( const char *prompt1, + const char *prompt2, const char *prompt3 )); static void handle_result LDAP_P(( LDAP *ld, LDAPMessage *lm )); -static void print_ldap_result LDAP_P(( LDAP *ld, LDAPMessage *lm, char *s )); +static void print_ldap_result LDAP_P(( LDAP *ld, LDAPMessage *lm, + const char *s )); static void print_search_entry LDAP_P(( LDAP *ld, LDAPMessage *res )); static void free_list LDAP_P(( char **list )); @@ -51,7 +53,7 @@ static char *dnsuffix; #ifndef HAVE_GETLINE static char * -getline( char *line, int len, FILE *fp, char *prompt ) +getline( char *line, int len, FILE *fp, const char *prompt ) { printf(prompt); @@ -65,7 +67,7 @@ getline( char *line, int len, FILE *fp, char *prompt ) #endif static char ** -get_list( char *prompt ) +get_list( const char *prompt ) { static char buf[256]; int num; @@ -111,7 +113,7 @@ free_list( char **list ) static int -file_read( char *path, struct berval *bv ) +file_read( const char *path, struct berval *bv ) { FILE *fp; ber_slen_t rlen; @@ -157,7 +159,10 @@ file_read( char *path, struct berval *bv ) static LDAPMod ** -get_modlist( char *prompt1, char *prompt2, char *prompt3 ) +get_modlist( + const char *prompt1, + const char *prompt2, + const char *prompt3 ) { static char buf[256]; int num; @@ -802,7 +807,7 @@ handle_result( LDAP *ld, LDAPMessage *lm ) } static void -print_ldap_result( LDAP *ld, LDAPMessage *lm, char *s ) +print_ldap_result( LDAP *ld, LDAPMessage *lm, const char *s ) { ldap_result2error( ld, lm, 1 ); ldap_perror( ld, s ); diff --git a/libraries/libldap/utf-8.c b/libraries/libldap/utf-8.c index 6b2ac969e1..b0c2fd9973 100644 --- a/libraries/libldap/utf-8.c +++ b/libraries/libldap/utf-8.c @@ -60,7 +60,7 @@ ber_len_t ldap_utf8_chars( const char * p ) for( ; *p ; LDAP_UTF8_INCR(p) ) { chars++; - }; + } return chars; } -- 2.39.5