From: Kurt Zeilenga Date: Fri, 23 Oct 1998 23:10:49 +0000 (+0000) Subject: More lint removal from Hallvard. X-Git-Tag: PHP3_TOOL_0_0~33 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b978170b1a98751af42e971ee8214492cba307f5;p=openldap More lint removal from Hallvard. --- diff --git a/include/avl.h b/include/avl.h index 46a1e7667a..b649f51283 100644 --- a/include/avl.h +++ b/include/avl.h @@ -29,13 +29,13 @@ typedef struct avlnode { #define NULLAVL ((Avlnode *) NULL) /* balance factor values */ -#define LH -1 +#define LH (-1) #define EH 0 #define RH 1 /* avl routines */ -#define avl_getone(x) (x == 0 ? 0 : (x)->avl_data) -#define avl_onenode(x) (x == 0 || ((x)->avl_left == 0 && (x)->avl_right == 0)) +#define avl_getone(x) ((x) == 0 ? 0 : (x)->avl_data) +#define avl_onenode(x) ((x) == 0 || ((x)->avl_left == 0 && (x)->avl_right == 0)) extern int avl_insert(); extern caddr_t avl_delete(); extern caddr_t avl_find(); @@ -49,7 +49,7 @@ extern int avl_apply(); #define AVL_INORDER 2 #define AVL_POSTORDER 3 /* what apply returns if it ran out of nodes */ -#define AVL_NOMORE -6 +#define AVL_NOMORE (-6) typedef int (*IFP)(); diff --git a/include/disptmpl.h b/include/disptmpl.h index c4e06ef2fe..7c592109b1 100644 --- a/include/disptmpl.h +++ b/include/disptmpl.h @@ -126,13 +126,13 @@ struct ldap_tmplitem { #define NULLTMPLITEM ((struct ldap_tmplitem *)0) #define LDAP_SET_TMPLITEM_APPDATA( ti, datap ) \ - (ti)->ti_appdata = (void *)(datap) + ( (ti)->ti_appdata = (void *)(datap) ) #define LDAP_GET_TMPLITEM_APPDATA( ti, type ) \ - (type)((ti)->ti_appdata) + ( (type)((ti)->ti_appdata) ) #define LDAP_IS_TMPLITEM_OPTION_SET( ti, option ) \ - (((ti)->ti_options & option ) != 0 ) + ( ((ti)->ti_options & (option) ) != 0 ) /* @@ -202,13 +202,13 @@ struct ldap_disptmpl { #define NULLDISPTMPL ((struct ldap_disptmpl *)0) #define LDAP_SET_DISPTMPL_APPDATA( dt, datap ) \ - (dt)->dt_appdata = (void *)(datap) + ( (dt)->dt_appdata = (void *)(datap) ) #define LDAP_GET_DISPTMPL_APPDATA( dt, type ) \ - (type)((dt)->dt_appdata) + ( (type)((dt)->dt_appdata) ) #define LDAP_IS_DISPTMPL_OPTION_SET( dt, option ) \ - (((dt)->dt_options & option ) != 0 ) + ( ((dt)->dt_options & (option) ) != 0 ) #define LDAP_TMPL_ERR_VERSION 1 #define LDAP_TMPL_ERR_MEM 2 diff --git a/include/lber.h b/include/lber.h index 9998f0b000..fa3e94855e 100644 --- a/include/lber.h +++ b/include/lber.h @@ -168,12 +168,12 @@ extern void ber_init(); * SAFEMEMCPY is an overlap-safe copy from s to d of n bytes */ #ifdef MACOS -#define SAFEMEMCPY( d, s, n ) BlockMoveData( (Ptr)s, (Ptr)d, n ) +#define SAFEMEMCPY( d, s, n ) BlockMoveData( (Ptr)(s), (Ptr)(d), (n) ) #else /* MACOS */ #ifdef sunos4 -#define SAFEMEMCPY( d, s, n ) bcopy( s, d, n ) +#define SAFEMEMCPY( d, s, n ) bcopy( (s), (d), (n) ) #else /* sunos4 */ -#define SAFEMEMCPY( d, s, n ) memmove( d, s, n ) +#define SAFEMEMCPY( d, s, n ) memmove( (d), (s), (n) ) #endif /* sunos4 */ #endif /* MACOS */ diff --git a/include/ldap.h b/include/ldap.h index 8c91b2160f..deae5d4970 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -64,16 +64,16 @@ extern int ldap_syslog_level; #ifdef LDAP_SYSLOG #define Debug( level, fmt, arg1, arg2, arg3 ) \ { \ - if ( ldap_debug & level ) \ - fprintf( stderr, fmt, arg1, arg2, arg3 ); \ + if ( ldap_debug & (level) ) \ + fprintf( stderr, (fmt), (arg1), (arg2), (arg3) ); \ if ( ldap_syslog & level ) \ - syslog( ldap_syslog_level, fmt, arg1, arg2, arg3 ); \ + syslog( ldap_syslog_level, (fmt), (arg1), (arg2), (arg3) ); \ } #else /* LDAP_SYSLOG */ #ifndef WINSOCK #define Debug( level, fmt, arg1, arg2, arg3 ) \ - if ( ldap_debug & level ) \ - fprintf( stderr, fmt, arg1, arg2, arg3 ); + if ( ldap_debug & (level) ) \ + fprintf( stderr, (fmt), (arg1), (arg2), (arg3) ); #else /* !WINSOCK */ extern void Debug( int level, char* fmt, ... ); #endif /* !WINSOCK */ @@ -490,7 +490,7 @@ typedef struct friendly { /* * handy macro to check whether LDAP struct is set up for CLDAP or not */ -#define LDAP_IS_CLDAP( ld ) ( ld->ld_sb.sb_naddr > 0 ) +#define LDAP_IS_CLDAP( ld ) ( (ld)->ld_sb.sb_naddr > 0 ) /* diff --git a/include/ldif.h b/include/ldif.h index dd2b339193..366576c95a 100644 --- a/include/ldif.h +++ b/include/ldif.h @@ -34,7 +34,7 @@ extern "C" { */ #define LDIF_SIZE_NEEDED(tlen,vlen) \ ((tlen) + 4 + LDIF_BASE64_LEN(vlen) \ - + ((LDIF_BASE64_LEN(vlen) + tlen + 3) / LINE_WIDTH * 2 )) + + ((LDIF_BASE64_LEN(vlen) + (tlen) + 3) / LINE_WIDTH * 2 )) #ifdef NEEDPROTOS diff --git a/include/lthread.h b/include/lthread.h index d3fd3d0ec6..df13e93aac 100644 --- a/include/lthread.h +++ b/include/lthread.h @@ -164,7 +164,7 @@ typedef cond_t pthread_cond_t; #define pthread_attr_init( a ) pthread_attr_create( a ) #define pthread_attr_destroy( a ) pthread_attr_delete( a ) #define pthread_attr_setdetachstate( a, b ) \ - pthread_attr_setdetach_np( a, b ) + pthread_attr_setdetach_np( (a), (b) ) #else /* end dce pthreads */ diff --git a/include/portable.h b/include/portable.h index 8456f25a61..34d725136b 100644 --- a/include/portable.h +++ b/include/portable.h @@ -134,7 +134,7 @@ * compilers don't like recursive macros, so ignore the problem if __STDC__ * is not defined. */ -#define select(a,b,c,d,e) select(a, (int *)b, (int *)c, (int *)d, e) +#define select(a,b,c,d,e) select((a),(int *)(b),(int *)(c),(int *)(d),(e)) #endif /* hpux && __STDC__ */ @@ -171,11 +171,11 @@ * toupper and tolower macros are different under bsd and sys v */ #if defined( SYSV ) && !defined( hpux ) -#define TOUPPER(c) (isascii(c) && islower(c) ? _toupper(c) : c) -#define TOLOWER(c) (isascii(c) && isupper(c) ? _tolower(c) : c) +#define TOUPPER(c) (isascii(c) && islower(c) ? _toupper(c) : (c)) +#define TOLOWER(c) (isascii(c) && isupper(c) ? _tolower(c) : (c)) #else -#define TOUPPER(c) (isascii(c) && islower(c) ? toupper(c) : c) -#define TOLOWER(c) (isascii(c) && isupper(c) ? tolower(c) : c) +#define TOUPPER(c) (isascii(c) && islower(c) ? toupper(c) : (c)) +#define TOLOWER(c) (isascii(c) && isupper(c) ? tolower(c) : (c)) #endif /* @@ -186,16 +186,16 @@ #define TERMFLAG_TYPE int #define GETATTR( fd, tiop ) ioctl((fd), TIOCGETP, (caddr_t)(tiop)) #define SETATTR( fd, tiop ) ioctl((fd), TIOCSETP, (caddr_t)(tiop)) -#define GETFLAGS( tio ) (tio).sg_flags -#define SETFLAGS( tio, flags ) (tio).sg_flags = (flags) +#define GETFLAGS( tio ) ((tio).sg_flags) +#define SETFLAGS( tio, flags ) ((tio).sg_flags = (flags)) #else #define USE_TERMIOS #define TERMIO_TYPE struct termios #define TERMFLAG_TYPE tcflag_t #define GETATTR( fd, tiop ) tcgetattr((fd), (tiop)) #define SETATTR( fd, tiop ) tcsetattr((fd), TCSANOW /* 0 */, (tiop)) -#define GETFLAGS( tio ) (tio).c_lflag -#define SETFLAGS( tio, flags ) (tio).c_lflag = (flags) +#define GETFLAGS( tio ) ((tio).c_lflag) +#define SETFLAGS( tio, flags ) ((tio).c_lflag = (flags)) #endif diff --git a/include/srchpref.h b/include/srchpref.h index a1d65cffb0..c3fcbc51f5 100644 --- a/include/srchpref.h +++ b/include/srchpref.h @@ -60,7 +60,7 @@ struct ldap_searchobj { #define LDAP_SEARCHOBJ_OPT_INTERNAL 0x00000001 #define LDAP_IS_SEARCHOBJ_OPTION_SET( so, option ) \ - (((so)->so_options & option ) != 0 ) + (((so)->so_options & (option) ) != 0 ) #define LDAP_SEARCHPREF_VERSION_ZERO 0 #define LDAP_SEARCHPREF_VERSION 1