From 2a0715d947f7c82cb2bfa53dc749a7ca30e92e8a Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 18 Nov 1998 20:08:02 +0000 Subject: [PATCH] Remove lint in UserDirectory found on NT --- clients/ud/edit.c | 10 ++++++++-- clients/ud/group.c | 27 +++++++++++++++------------ clients/ud/main.c | 9 ++++++--- clients/ud/util.c | 4 ++++ include/portable.h.nt | 3 +++ libraries/liblber/io.c | 2 +- 6 files changed, 37 insertions(+), 18 deletions(-) diff --git a/clients/ud/edit.c b/clients/ud/edit.c index b34790ca92..88fe0b613a 100644 --- a/clients/ud/edit.c +++ b/clients/ud/edit.c @@ -114,10 +114,11 @@ load_editor( void ) FILE *fp; char *cp, *editor = UD_DEFAULT_EDITOR; static char template[MED_BUF_SIZE]; +#ifndef HAVE_SPAWNLP int pid; int status; +#endif int rc; - void (*handler)(); #ifdef DEBUG if (debug & D_TRACE) @@ -186,6 +187,7 @@ load_editor( void ) } else if (pid > 0) { /* parent - wait until the child proc is done editing */ + void (*handler)(); handler = SIGNAL(SIGINT, SIG_IGN); (void) wait(&status); (void) SIGNAL(SIGINT, handler); @@ -204,8 +206,12 @@ print_attrs_and_values( FILE *fp, struct attribute *attrs, short int flag ) register int i, j; for (i = 0; attrs[i].quipu_name != NULL; i++) { - if (!modifiable(attrs[i].quipu_name, flag|ATTR_FLAG_MAY_EDIT)) + if (!modifiable(attrs[i].quipu_name, + (short) (flag|ATTR_FLAG_MAY_EDIT))) + { continue; + } + fprintf(fp, "%s\n", attrs[i].quipu_name); if ( attrs[i].number_of_values > MAX_VALUES ) { printf(" The %s attribute has more than %d values.\n", diff --git a/clients/ud/group.c b/clients/ud/group.c index e9c9c49cde..be5a923267 100644 --- a/clients/ud/group.c +++ b/clients/ud/group.c @@ -20,6 +20,10 @@ #include #include +#ifdef HAVE_IO_H +#include +#endif + #include #include #include @@ -31,7 +35,7 @@ static char * bind_and_fetch(char *name); void add_group( char *name ) { - register int i, idx = 0, prompt = 0; + int idx = 0, prompt = 0; char tmp[BUFSIZ], dn[BUFSIZ]; static LDAPMod *attrs[9]; LDAPMod init_rdn, init_owner, init_domain, @@ -152,9 +156,9 @@ add_group( char *name ) #ifdef DEBUG if (debug & D_GROUPS) { - register LDAPMod **lpp; - register char **cpp; - register int j; + LDAPMod **lpp; + char **cpp; + int i, j; printf(" About to call ldap_add()\n"); printf(" ld = 0x%x\n", ld); printf(" dn = [%s]\n", dn); @@ -728,7 +732,6 @@ mod_addrDN( char *group, int offset ) { char s[BUFSIZ], *new_value /* was member */, *values[2]; char attrtype[ 64 ]; - int i; LDAPMod mod, *mods[2]; LDAPMessage *mp; @@ -867,7 +870,7 @@ mod_addrDN( char *group, int offset ) * "Bryan Beecher" * Bryan Beecher */ - register char *cp; + char *cp; if (strchr(s, '<') == NULL) { for (cp = s; *cp != '@'; cp++) if (isspace(*cp)) @@ -895,9 +898,9 @@ mod_addrDN( char *group, int offset ) #ifdef DEBUG if (debug & D_GROUPS) { - register LDAPMod **lpp; - register char **cp; - register int i, j; + LDAPMod **lpp; + char **cp; + int i, j; printf(" About to call ldap_modify_s()\n"); printf(" ld = 0x%x\n", ld); printf(" dn = [%s]\n", group); @@ -954,9 +957,9 @@ mod_addrDN( char *group, int offset ) mod.mod_op = LDAP_MOD_DELETE; #ifdef DEBUG if (debug & D_GROUPS) { - register LDAPMod **lpp; - register char **cp; - register int i, j; + LDAPMod **lpp; + char **cp; + int i, j; printf(" About to call ldap_modify_s()\n"); printf(" ld = 0x%x\n", ld); printf(" dn = [%s]\n", group); diff --git a/clients/ud/main.c b/clients/ud/main.c index 46fe1de720..3d9a004180 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -158,6 +158,8 @@ main( int argc, char **argv ) /* now tackle the user's commands */ do_commands(); /* NOTREACHED */ + + return 0; } void @@ -283,7 +285,6 @@ void status( void ) { register char **rdns; - char *host; #ifdef DEBUG if (debug & D_TRACE) @@ -537,9 +538,10 @@ initialize_client( void ) { FILE *fp; /* for config file */ static char buffer[MED_BUF_SIZE]; /* for input */ +#ifdef HAVE_GETPWUID struct passwd *pw; /* for getting the home dir */ +#endif register char *cp; /* for fiddling with buffer */ - char *term; /* for tty set-up */ char *config; /* config file to use */ static char bp[1024]; /* for tty set-up */ @@ -551,7 +553,7 @@ initialize_client( void ) * A per-user config file has precedence over any system-wide * config file, if one exists. */ -#ifdef HAVE_GETPWUID_H +#ifdef HAVE_GETPWUID if ((pw = getpwuid((uid_t) geteuid())) == (struct passwd *) NULL) config = config_file; else { @@ -678,6 +680,7 @@ initialize_client( void ) #ifndef NO_TERMCAP { + char *term; struct winsize win; /* for tty set-up */ if (((term = getenv("TERM")) == NULL) || (tgetent(bp, term) <= 0)) diff --git a/clients/ud/util.c b/clients/ud/util.c index dd1adf3f7f..084de81301 100644 --- a/clients/ud/util.c +++ b/clients/ud/util.c @@ -24,6 +24,10 @@ #include #include +#ifdef HAVE_CONIO_H +#include +#endif + #include #include #include diff --git a/include/portable.h.nt b/include/portable.h.nt index 90df2e963b..18efd3ee02 100644 --- a/include/portable.h.nt +++ b/include/portable.h.nt @@ -56,6 +56,9 @@ typedef char * caddr_t; /* we have winsock */ #define HAVE_WINSOCK 1 +/* we have */ +#define HAVE_CONIO_H 1 + /* we have */ #define HAVE_IO_H 1 diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index e1dfdda505..b9cc3fe033 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -473,7 +473,7 @@ ber_get_next( Sockbuf *sb, unsigned long *len, BerElement *ber ) unsigned long tag = 0, netlen, toread; unsigned char lc; long rc; - int noctets; + long noctets; unsigned int diff; #ifdef LDAP_DEBUG -- 2.39.5