mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 00:59:45 -05:00
const'ify and remove lint
This commit is contained in:
parent
608de2fd65
commit
d0991d97fb
6 changed files with 24 additions and 13 deletions
|
|
@ -14,9 +14,7 @@
|
|||
|
||||
#include "lber-int.h"
|
||||
|
||||
typedef void (*BER_LOG_FN) LDAP_P((FILE *file, char *subsys, int level, const char *fmt, va_list vl));
|
||||
|
||||
#define ber_log_check(errlvl, loglvl) (errlvl & loglvl)
|
||||
#define ber_log_check(errlvl, loglvl) ((errlvl) & (loglvl))
|
||||
|
||||
BER_LOG_FN ber_int_log_proc = NULL;
|
||||
|
||||
|
|
@ -71,7 +69,11 @@ BER_LOG_PRINT_FN ber_pvt_log_print = ber_error_print;
|
|||
* lber log
|
||||
*/
|
||||
|
||||
int ber_pvt_log_output( char *subsystem, int level, const char *fmt, ... )
|
||||
int ber_pvt_log_output(
|
||||
const char *subsystem,
|
||||
int level,
|
||||
const char *fmt,
|
||||
... )
|
||||
{
|
||||
char buf[ 1024 ];
|
||||
va_list vl;
|
||||
|
|
@ -244,7 +246,7 @@ int ber_output_dump(
|
|||
(long) ber->ber_end,
|
||||
(long) len );
|
||||
|
||||
ber_pvt_log_output( subsys, level, "%s", buf );
|
||||
(void) ber_pvt_log_output( subsys, level, "%s", buf );
|
||||
|
||||
#define BP_OFFSET 9
|
||||
#define BP_GRAPH 60
|
||||
|
|
@ -261,7 +263,9 @@ int ber_output_dump(
|
|||
unsigned off;
|
||||
|
||||
if( !n ) {
|
||||
if( i ) ber_pvt_log_output( subsys, level, "%s", line );
|
||||
if( i ) {
|
||||
(void) ber_pvt_log_output( subsys, level, "%s", line );
|
||||
}
|
||||
memset( line, ' ', sizeof(line)-2 );
|
||||
line[sizeof(line)-2] = '\n';
|
||||
line[sizeof(line)-1] = '\0';
|
||||
|
|
@ -288,7 +292,7 @@ int ber_output_dump(
|
|||
}
|
||||
}
|
||||
|
||||
ber_pvt_log_output( subsys, level, "%s", line );
|
||||
return ber_pvt_log_output( subsys, level, "%s", line );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -333,7 +337,7 @@ ber_dump(
|
|||
(long) ber->ber_end,
|
||||
(long) len );
|
||||
|
||||
(*ber_pvt_log_print)( buf );
|
||||
(void) (*ber_pvt_log_print)( buf );
|
||||
|
||||
ber_bprint( ber->ber_ptr, len );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include <lber.h>
|
||||
|
||||
static void usage( char *name )
|
||||
static void usage( const char *name )
|
||||
{
|
||||
fprintf( stderr, "usage: %s fmt\n", name );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@
|
|||
|
||||
#include "lber.h"
|
||||
|
||||
static void usage( char *name )
|
||||
static void usage( const char *name )
|
||||
{
|
||||
fprintf( stderr, "usage: %s fmtstring\n", name );
|
||||
}
|
||||
|
||||
static char* getbuf() {
|
||||
static char* getbuf( void ) {
|
||||
char *p;
|
||||
static char buf[128];
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@
|
|||
|
||||
LDAP_BEGIN_DECL
|
||||
|
||||
typedef void (*BER_LOG_FN)(FILE *file,
|
||||
const char *subsys, int level, const char *fmt, va_list vl );
|
||||
|
||||
LBER_V (BER_ERRNO_FN) ber_int_errno_fn;
|
||||
|
||||
struct lber_options {
|
||||
|
|
@ -46,6 +49,11 @@ struct lber_options {
|
|||
# endif
|
||||
#endif
|
||||
|
||||
LBER_F( int ) ber_pvt_log_output(
|
||||
const char *subsystem,
|
||||
int level,
|
||||
const char *fmt, ... );
|
||||
|
||||
#define LBER_UNINITIALIZED 0x0
|
||||
#define LBER_INITIALIZED 0x1
|
||||
#define LBER_VALID_BERELEMENT 0x2
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ char *ber_pvt_wsa_err2string( int err )
|
|||
LBER_RETSTR( WSA_E_NO_MORE )
|
||||
LBER_RETSTR( WSA_E_CANCELLED )
|
||||
LBER_RETSTR( WSAEREFUSED )
|
||||
#endif // HAVE_WINSOCK2
|
||||
#endif /* HAVE_WINSOCK2 */
|
||||
|
||||
LBER_RETSTR( WSAHOST_NOT_FOUND )
|
||||
LBER_RETSTR( WSATRY_AGAIN )
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
#include "lber-int.h"
|
||||
|
||||
/* bprint.c */
|
||||
typedef void (*BER_LOG_FN) LDAP_P((FILE *file, char *subsys, int level, const char *fmt, va_list vl));
|
||||
extern void * ber_pvt_err_file;
|
||||
extern BER_LOG_FN ber_int_log_proc;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue