From: Chas Williams (CONTRACTOR) Date: Mon, 24 Sep 2012 19:06:10 +0000 (-0400) Subject: afs: casting NULL is generally unnecessary X-Git-Tag: upstream/1.8.0_pre1^2~1961 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=33ca19acbd0526014da6ac7beeb91f8aa9937676;p=packages%2Fo%2Fopenafs.git afs: casting NULL is generally unnecessary Casting NULL shouldn't be necessary in most cases. Eliminate this in favor of shorter lines and consistency. Function pointers, variadic arguments should still be cast. Change-Id: Ibcd67378556e45c2b24f7aa85a4d73c72cd88e02 Reviewed-on: http://gerrit.openafs.org/8151 Reviewed-by: Garrett Wollman Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/WINNT/afsd/cm_dnlc.c b/src/WINNT/afsd/cm_dnlc.c index ba36ba914..6425f12bd 100644 --- a/src/WINNT/afsd/cm_dnlc.c +++ b/src/WINNT/afsd/cm_dnlc.c @@ -222,7 +222,7 @@ cm_dnlcLookup (cm_scache_t *adp, cm_lookupSearch_t* sp) ts = 0; tnc_begin = cm_data.nameHash[skey]; - for ( tvc = (cm_scache_t *) NULL, tnc = tnc_begin, safety=0; + for ( tvc = NULL, tnc = tnc_begin, safety=0; tnc; tnc = tnc->next, safety++ ) { if (tnc->dirp == adp) diff --git a/src/WINNT/client_osi/osisleep.c b/src/WINNT/client_osi/osisleep.c index 5d6c4a22c..57cf41d84 100644 --- a/src/WINNT/client_osi/osisleep.c +++ b/src/WINNT/client_osi/osisleep.c @@ -227,8 +227,8 @@ void osi_Init(void) /* initialize critical regions and semaphores */ for(i=0;iv), (struct pfdat *)NULL); + VN_SET_DPAGES(&(avc->v), NULL); osi_Assert((avc->v.v_flag & VINACT) == 0); avc->v.v_flag = 0; osi_Assert(VN_GET_PGCNT(&(avc->v)) == 0); diff --git a/src/afs/OBSD/osi_vnodeops.c b/src/afs/OBSD/osi_vnodeops.c index 5035707bf..a3f572edf 100644 --- a/src/afs/OBSD/osi_vnodeops.c +++ b/src/afs/OBSD/osi_vnodeops.c @@ -197,7 +197,7 @@ struct vnodeopv_entry_desc afs_vnodeop_entries[] = { {&vop_advlock_desc, afs_obsd_advlock}, /* advlock */ {&vop_reallocblks_desc, afs_obsd_reallocblks}, /* reallocblks */ {&vop_bwrite_desc, vop_generic_bwrite}, - {(struct vnodeop_desc *)NULL, (int (*)__P((void *)))NULL} + {NULL, (int (*)__P((void *)))NULL} }; struct vnodeopv_desc afs_vnodeop_opv_desc = { &afs_vnodeop_p, afs_vnodeop_entries }; diff --git a/src/afs/SOLARIS/osi_inode.c b/src/afs/SOLARIS/osi_inode.c index 42c3541d1..2852eee48 100644 --- a/src/afs/SOLARIS/osi_inode.c +++ b/src/afs/SOLARIS/osi_inode.c @@ -258,7 +258,7 @@ afs_syscall_iopen(dev, inode, usrmod, rvp, credp) if (code) { return (code); } - code = falloc((struct vnode *)NULL, FWRITE | FREAD, &fp, &fd); + code = falloc(NULL, FWRITE | FREAD, &fp, &fd); if (code) { rw_enter(&ip->i_contents, RW_READER); AFS_ITIMES(ip); diff --git a/src/afs/afs_axscache.c b/src/afs/afs_axscache.c index 08f233aa0..bff555545 100644 --- a/src/afs/afs_axscache.c +++ b/src/afs/afs_axscache.c @@ -48,10 +48,10 @@ afs_SlowFindAxs(struct axscache **cachep, afs_int32 id) return (j); } } else - return ((struct axscache *)NULL); + return (NULL); i = j->next; } - return ((struct axscache *)NULL); + return (NULL); } diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 350ba78af..3e487235d 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -172,7 +172,7 @@ afs_FlushVCache(struct vcache *avc, int *slept) for (wvc = *uvc; wvc; uvc = &wvc->hnext, wvc = *uvc) { if (avc == wvc) { *uvc = avc->hnext; - avc->hnext = (struct vcache *)NULL; + avc->hnext = NULL; break; } } diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 4fb075852..817d98c8e 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -1335,7 +1335,7 @@ CheckCacheBaseDir(char *dir) if (cp = hasmntopt(&mnt, "dev=")) rdev = - (int)strtol(cp + strlen("dev="), (char **)NULL, + (int)strtol(cp + strlen("dev="), NULL, 16); if ((rdev == 0) && (stat(mnt.mnt_mountp, &statmnt) == 0)) diff --git a/src/afsmonitor/afsmon-parselog.c b/src/afsmonitor/afsmon-parselog.c index faf7fd8f2..fee721db9 100644 --- a/src/afsmonitor/afsmon-parselog.c +++ b/src/afsmonitor/afsmon-parselog.c @@ -734,13 +734,13 @@ main(argc, argv) /* Malloc two blocks of data, one for reading each line from the data file * and the other for coverting data to longs */ - if ((line = malloc(block_size + 256)) == (char *)NULL) { + if ((line = malloc(block_size + 256)) == NULL) { fprintf(stderr, "[ %s ] malloc %d bytes failed\n", rn, block_size + 256); exit(10); } - if ((longs = malloc(block_size)) == (long *)NULL) { + if ((longs = malloc(block_size)) == NULL) { fprintf(stderr, "[ %s ] malloc %d bytes failed\n", rn, block_size); exit(20); } diff --git a/src/afsmonitor/afsmonitor.c b/src/afsmonitor/afsmonitor.c index 0ad6d711e..288a5197f 100644 --- a/src/afsmonitor/afsmonitor.c +++ b/src/afsmonitor/afsmonitor.c @@ -299,7 +299,7 @@ strcasestr(s1, s2) len2 = strlen(s2); if (len1 < len2) - return ((char *)NULL); + return (NULL); ptr = s1; @@ -309,7 +309,7 @@ strcasestr(s1, s2) ptr++; len1--; } - return ((char *)NULL); + return (NULL); } #endif @@ -1158,8 +1158,8 @@ parse_showEntry(char *a_line) /* if it is a section/group name, find it in the fs_categories[] array */ found = 0; - if (strcasestr(arg2, "_section") != (char *)NULL - || strcasestr(arg2, "_group") != (char *)NULL) { + if (strcasestr(arg2, "_section") != NULL + || strcasestr(arg2, "_group") != NULL) { idx = 0; while (idx < FS_NUM_DATA_CATEGORIES) { sscanf(fs_categories[idx], "%s %d %d", catName, &fromIdx, @@ -1182,7 +1182,7 @@ parse_showEntry(char *a_line) /* if it is a group name, read its start/end indices and fill in the * fs_Display_map[]. */ - if (strcasestr(arg2, "_group") != (char *)NULL) { + if (strcasestr(arg2, "_group") != NULL) { if (fromIdx < 0 || toIdx < 0 || fromIdx > NUM_FS_STAT_ENTRIES || toIdx > NUM_FS_STAT_ENTRIES) @@ -1202,7 +1202,7 @@ parse_showEntry(char *a_line) /* if it is a section name, get the count of number of groups in it and * for each group fill in the start/end indices in the fs_Display_map[] */ - if (strcasestr(arg2, "_section") != (char *)NULL) { + if (strcasestr(arg2, "_section") != NULL) { /* fromIdx is actually the number of groups in thi section */ numGroups = fromIdx; /* for each group in section */ @@ -1273,8 +1273,8 @@ parse_showEntry(char *a_line) /* if it is a section/group name, find it in the cm_categories[] array */ found = 0; - if (strcasestr(arg2, "_section") != (char *)NULL - || strcasestr(arg2, "_group") != (char *)NULL) { + if (strcasestr(arg2, "_section") != NULL + || strcasestr(arg2, "_group") != NULL) { idx = 0; while (idx < CM_NUM_DATA_CATEGORIES) { sscanf(cm_categories[idx], "%s %d %d", catName, &fromIdx, @@ -1297,7 +1297,7 @@ parse_showEntry(char *a_line) /* if it is a group name, read its start/end indices and fill in the * cm_Display_map[]. */ - if (strcasestr(arg2, "_group") != (char *)NULL) { + if (strcasestr(arg2, "_group") != NULL) { if (fromIdx < 0 || toIdx < 0 || fromIdx > NUM_CM_STAT_ENTRIES || toIdx > NUM_CM_STAT_ENTRIES) @@ -1317,7 +1317,7 @@ parse_showEntry(char *a_line) /* if it is a section name, get the count of number of groups in it and * for each group fill in the start/end indices in the cm_Display_map[] */ - if (strcasestr(arg2, "_section") != (char *)NULL) { + if (strcasestr(arg2, "_section") != NULL) { /* fromIdx is actually the number of groups in thi section */ numGroups = fromIdx; /* for each group in section */ diff --git a/src/aklog/aklog.c b/src/aklog/aklog.c index ce6476809..687a3c19a 100644 --- a/src/aklog/aklog.c +++ b/src/aklog/aklog.c @@ -2091,8 +2091,8 @@ get_credv5(krb5_context context, char *name, char *inst, char *realm, if ((r = krb5_build_principal(context, &increds.server, strlen(realm), realm, name, - (inst && strlen(inst)) ? inst : (void *) NULL, - (void *) NULL))) { + (inst && strlen(inst)) ? inst : NULL, + NULL))) { return r; } diff --git a/src/butc/tcmain.c b/src/butc/tcmain.c index 3bf6f2dd4..ada509906 100644 --- a/src/butc/tcmain.c +++ b/src/butc/tcmain.c @@ -1226,10 +1226,10 @@ main(int argc, char **argv) ti->next = 0; ti->data = "0"; ts->parms[1].items = ti; - ts->parms[2].items = (struct cmd_item *)NULL; - ts->parms[3].items = (struct cmd_item *)NULL; - ts->parms[4].items = (struct cmd_item *)NULL; - ts->parms[5].items = (struct cmd_item *)NULL; + ts->parms[2].items = NULL; + ts->parms[3].items = NULL; + ts->parms[4].items = NULL; + ts->parms[5].items = NULL; return WorkerBee(ts, NULL); } else return cmd_Dispatch(argc, argv); diff --git a/src/butc/tcudbprocs.c b/src/butc/tcudbprocs.c index 386360a37..5bb0ca148 100644 --- a/src/butc/tcudbprocs.c +++ b/src/butc/tcudbprocs.c @@ -490,7 +490,7 @@ writeDbDump(struct butm_tapeInfo *tapeInfoPtr, afs_uint32 taskId, AFS_SIGSET_RESTORE(); #else code = - LWP_CreateProcess(KeepAlive, 16384, 1, (void *)NULL, + LWP_CreateProcess(KeepAlive, 16384, 1, NULL, "Keep-alive process", &alivePid); #endif /* XXX should we check code here ??? XXX */ diff --git a/src/comerr/compile_et.c b/src/comerr/compile_et.c index 808c92b5b..560cc1b08 100644 --- a/src/comerr/compile_et.c +++ b/src/comerr/compile_et.c @@ -26,7 +26,7 @@ static const char copyright[] = extern char *current_token; extern int table_number, current; char buffer[BUFSIZ]; -char *table_name = (char *)NULL; +char *table_name = NULL; FILE *hfile, *cfile, *msfile; int version = 1; int use_msf = 0; @@ -240,7 +240,7 @@ main(int argc, char **argv) p = strrchr(filename, '/'); - if (p == (char *)NULL) + if (p == NULL) p = filename; else p++; @@ -285,7 +285,7 @@ main(int argc, char **argv) } hfile = fopen(h_file, "w"); - if (hfile == (FILE *) NULL) { + if (hfile == NULL) { perror(h_file); exit(1); } @@ -326,14 +326,14 @@ main(int argc, char **argv) if (use_msf) { msfile = fopen(msf_file, "w"); - if (msfile == (FILE *) NULL) { + if (msfile == NULL) { perror(msf_file); exit(1); } fprintf(msfile, msf_warning, msf_file); } else { cfile = fopen(c_file, "w"); - if (cfile == (FILE *) NULL) { + if (cfile == NULL) { perror(c_file); exit(1); } diff --git a/src/comerr/error_msg.c b/src/comerr/error_msg.c index 413a2e9d8..c5f6d02ed 100644 --- a/src/comerr/error_msg.c +++ b/src/comerr/error_msg.c @@ -33,7 +33,7 @@ static const char copyright[] = static char buffer[64]; -static struct et_list *_et_list = (struct et_list *)NULL; +static struct et_list *_et_list = NULL; #ifdef AFS_PTHREAD_ENV #include diff --git a/src/comerr/error_table.y b/src/comerr/error_table.y index db5692a2c..d143fd478 100644 --- a/src/comerr/error_table.y +++ b/src/comerr/error_table.y @@ -46,7 +46,7 @@ int char_to_num(char c); char *gensym(const char *x); -char *current_token = (char *)NULL; +char *current_token = NULL; extern char *table_name; char *quote(const char *string); @@ -171,7 +171,7 @@ quote(const char *string) afs_int32 table_number = 0; int current = 0; -char **error_codes = (char **)NULL; +char **error_codes = NULL; void add_ec(const char *name, const char *description) { @@ -185,14 +185,14 @@ void add_ec(const char *name, const char *description) } else { fprintf(cfile, "\t\"%s\",\n", description); } - if (error_codes == (char **)NULL) { + if (error_codes == NULL) { error_codes = malloc(sizeof(char *)); - *error_codes = (char *)NULL; + *error_codes = NULL; } error_codes = (char **)realloc((char *)error_codes, (current + 2)*sizeof(char *)); error_codes[current++] = strdup(name); - error_codes[current] = (char *)NULL; + error_codes[current] = NULL; } void add_ec_val(const char *name, const char *val, const char *description) @@ -206,7 +206,7 @@ void add_ec_val(const char *name, const char *val, const char *description) while (ncurrent > current) { if (!msfile) - fputs("\t(char *)NULL,\n", cfile); + fputs("\tNULL,\n", cfile); current++; } if (msfile) { @@ -219,21 +219,21 @@ void add_ec_val(const char *name, const char *val, const char *description) } else { fprintf(cfile, "\t\"%s\",\n", description); } - if (error_codes == (char **)NULL) { + if (error_codes == NULL) { error_codes = malloc(sizeof(char *)); - *error_codes = (char *)NULL; + *error_codes = NULL; } error_codes = (char **)realloc((char *)error_codes, (current + 2)*sizeof(char *)); error_codes[current++] = strdup(name); - error_codes[current] = (char *)NULL; + error_codes[current] = NULL; } void put_ecs(void) { int i; for (i = 0; i < current; i++) { - if (error_codes[i] != (char *)NULL) + if (error_codes[i] != NULL) fprintf(hfile, "#define %-40s (%ldL)\n", error_codes[i], (long int) table_number + i); } diff --git a/src/comerr/error_table_nt.c b/src/comerr/error_table_nt.c index 1d852792f..f5ea2b2be 100755 --- a/src/comerr/error_table_nt.c +++ b/src/comerr/error_table_nt.c @@ -34,7 +34,7 @@ #include "internal.h" -char *current_token = (char *)NULL; +char *current_token = NULL; extern char *table_name; char *quote(const char *string); @@ -987,7 +987,7 @@ quote(const char *string) afs_int32 table_number = 0; int current = 0; -char **error_codes = (char **)NULL; +char **error_codes = NULL; void add_ec(const char *name, const char *description) @@ -1002,13 +1002,13 @@ add_ec(const char *name, const char *description) } else { fprintf(cfile, "\t\"%s\",\n", description); } - if (error_codes == (char **)NULL) { + if (error_codes == NULL) { error_codes = malloc(sizeof(char *)); - *error_codes = (char *)NULL; + *error_codes = NULL; } error_codes = realloc(error_codes, (current + 2) * sizeof(char *)); error_codes[current++] = strdup(name); - error_codes[current] = (char *)NULL; + error_codes[current] = NULL; } void @@ -1022,7 +1022,7 @@ add_ec_val(const char *name, const char *val, const char *description) while (ncurrent > current) { if (!msfile) - fputs("\t(char *)NULL,\n", cfile); + fputs("\tNULL,\n", cfile); current++; } if (msfile) { @@ -1035,13 +1035,13 @@ add_ec_val(const char *name, const char *val, const char *description) } else { fprintf(cfile, "\t\"%s\",\n", description); } - if (error_codes == (char **)NULL) { + if (error_codes == NULL) { error_codes = malloc(sizeof(char *)); - *error_codes = (char *)NULL; + *error_codes = NULL; } error_codes = realloc(error_codes, (current + 2) * sizeof(char *)); error_codes[current++] = strdup(name); - error_codes[current] = (char *)NULL; + error_codes[current] = NULL; } void @@ -1049,7 +1049,7 @@ put_ecs(void) { int i; for (i = 0; i < current; i++) { - if (error_codes[i] != (char *)NULL) + if (error_codes[i] != NULL) fprintf(hfile, "#define %-40s (%ldL)\n", error_codes[i], table_number + i); } diff --git a/src/comerr/test/test.c b/src/comerr/test/test.c index 2babc5fd6..885315f08 100644 --- a/src/comerr/test/test.c +++ b/src/comerr/test/test.c @@ -44,7 +44,7 @@ main() printf("Msg KRB_SKDC_CANT is '%s'\n", afs_error_message(KRB_SKDC_CANT)); printf("Msg 1e6 (8B 64) is '%s'\n", afs_error_message(1000000)); printf("\n\nCOM_ERR tests:\n"); - afs_com_err("whoami", FOO_ERR, (char *)NULL); + afs_com_err("whoami", FOO_ERR, NULL); afs_com_err("whoami", FOO_ERR, " -- message goes %s", "here"); afs_com_err("whoami", 0, NULL); afs_com_err("whoami", 0, "error number %d\n", 0); diff --git a/src/libafscp/afscp_util.c b/src/libafscp/afscp_util.c index d14f5b87c..0e9e3aaaf 100644 --- a/src/libafscp/afscp_util.c +++ b/src/libafscp/afscp_util.c @@ -295,7 +295,7 @@ _GetSecurityObject(struct afscp_cell *cell) match.server = NULL; code = krb5_build_principal(context, &match.server, - strlen(realm), realm, "afs", (void *)NULL); + strlen(realm), realm, "afs", NULL); if (code == 0) code = krb5_get_credentials(context, 0, cc, &match, &cred); if (code != 0) { diff --git a/src/lwp/lwp_nt.c b/src/lwp/lwp_nt.c index 8fc5a3583..b7ee4e9ea 100644 --- a/src/lwp/lwp_nt.c +++ b/src/lwp/lwp_nt.c @@ -491,7 +491,7 @@ static void Initialize_PCB(PROCESS pcb, int priority, int stacksize, pcb->wakevent = 0; pcb->waitcnt = 0; pcb->next = pcb->prev = (PROCESS)NULL; - pcb->iomgrRequest = (struct IoRequest*)NULL; + pcb->iomgrRequest = NULL; pcb->index = lwp_nextindex ++; } diff --git a/src/lwp/test/selclient.c b/src/lwp/test/selclient.c index 852068088..f8479d8fd 100644 --- a/src/lwp/test/selclient.c +++ b/src/lwp/test/selclient.c @@ -285,7 +285,7 @@ sendTest(int sockFD, int delay, int reqOOB, int size) (void)time(&stime); code = IOMGR_Select(sockFD + 1, rfds, wfds, efds, - (struct timeval *)NULL); + NULL); assert(code > 0); if (FD_ISSET(sockFD, wfds)) { diff --git a/src/lwp/test/selserver.c b/src/lwp/test/selserver.c index 121585243..a459ba94c 100644 --- a/src/lwp/test/selserver.c +++ b/src/lwp/test/selserver.c @@ -96,7 +96,7 @@ getClientHandle() } Die(1, "No free client handles!\n"); - return (clientHandle_t *) NULL; /* quiet compiler. */ + return NULL; /* quiet compiler. */ } int nSigIO = 0; @@ -299,7 +299,7 @@ handleRequest(char *arg) FD_SET(ch->ch_fd, &(ch->ch_except)); code = IOMGR_Select(ch->ch_fd + 1, &(ch->ch_read), &(ch->ch_write), - &(ch->ch_except), (struct timeval *)NULL); + &(ch->ch_except), NULL); if (FD_ISSET(ch->ch_fd, &(ch->ch_except))) { Log("Received expception. Read fd_set shows %d\n", FD_ISSET(ch->ch_fd, &(ch->ch_read))); diff --git a/src/pam/afs_auth.c b/src/pam/afs_auth.c index cdeeb0e4f..d41d2f074 100644 --- a/src/pam/afs_auth.c +++ b/src/pam/afs_auth.c @@ -101,7 +101,7 @@ pam_sm_authenticate(pam_handle_t * pamh, int flags, int argc, ignore_uid = 0; } else { ignore_uid = 1; - ignore_uid_id = (uid_t) strtol(argv[i], (char **)NULL, 10); + ignore_uid_id = (uid_t) strtol(argv[i], NULL, 10); if (ignore_uid_id > IGNORE_MAX) { ignore_uid = 0; pam_afs_syslog(LOG_ERR, PAMAFS_IGNOREUID, argv[i]); diff --git a/src/pam/afs_session.c b/src/pam/afs_session.c index 4ff997d36..e4a3620fa 100644 --- a/src/pam/afs_session.c +++ b/src/pam/afs_session.c @@ -54,7 +54,7 @@ pam_sm_close_session(pam_handle_t * pamh, int flags, int argc, } else if (strcasecmp(argv[i], "remainlifetime") == 0) { i++; remain = 1; - remainlifetime = (int)strtol(argv[i], (char **)NULL, 10); + remainlifetime = (int)strtol(argv[i], NULL, 10); if (remainlifetime == 0) { if ((errno == EINVAL) || (errno == ERANGE)) { remainlifetime = REMAINLIFETIME; diff --git a/src/pam/afs_setcred.c b/src/pam/afs_setcred.c index e52d988ec..0bfbb85ae 100644 --- a/src/pam/afs_setcred.c +++ b/src/pam/afs_setcred.c @@ -91,7 +91,7 @@ pam_sm_setcred(pam_handle_t * pamh, int flags, int argc, const char **argv) ignore_uid = 0; } else { ignore_uid = 1; - ignore_uid_id = (uid_t) strtol(argv[i], (char **)NULL, 10); + ignore_uid_id = (uid_t) strtol(argv[i], NULL, 10); if (ignore_uid_id > IGNORE_MAX) { ignore_uid = 0; pam_afs_syslog(LOG_ERR, PAMAFS_IGNOREUID, argv[i]); diff --git a/src/ptserver/ptuser.c b/src/ptserver/ptuser.c index 33e4e4a13..1505402e4 100644 --- a/src/ptserver/ptuser.c +++ b/src/ptserver/ptuser.c @@ -181,7 +181,7 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell) afs_int32 code; struct rx_connection *serverconns[MAXSERVERS]; struct rx_securityClass *sc = NULL; - static struct afsconf_dir *tdir = (struct afsconf_dir *)NULL; /* only do this once */ + static struct afsconf_dir *tdir = NULL; /* only do this once */ static char tconfDir[100] = ""; static char tcell[64] = ""; afs_int32 scIndex; @@ -237,9 +237,9 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell) */ if (tdir && !gottdir) { afsconf_Close(tdir); - tdir = (struct afsconf_dir *)NULL; + tdir = NULL; } - pruclient = (struct ubik_client *)NULL; + pruclient = NULL; refresh = 1; } diff --git a/src/rxgen/rpc_main.c b/src/rxgen/rpc_main.c index 790d0e251..d0e167ac6 100644 --- a/src/rxgen/rpc_main.c +++ b/src/rxgen/rpc_main.c @@ -582,7 +582,7 @@ s_output(int argc, char *argv[], char *infile, char *define, int extend, return; } if (nomain) { - write_programs((char *)NULL); + write_programs(NULL); } else { write_most(); do_registers(argc, argv); diff --git a/src/sgistuff/rcmd.c b/src/sgistuff/rcmd.c index da632729d..6e471da3b 100644 --- a/src/sgistuff/rcmd.c +++ b/src/sgistuff/rcmd.c @@ -586,7 +586,7 @@ _checkhost(rhost, lhost, len) return (0); } ldomain[MAXHOSTNAMELEN] = '\0'; - if ((domainp = strchr(ldomain, '.')) == (char *)NULL) { + if ((domainp = strchr(ldomain, '.')) == NULL) { nodomain = 1; return (0); } diff --git a/src/sys/pioctl_nt.c b/src/sys/pioctl_nt.c index 7654fc5fb..2d51ebb9d 100644 --- a/src/sys/pioctl_nt.c +++ b/src/sys/pioctl_nt.c @@ -172,7 +172,7 @@ RDR_Ready(void) MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US), buf, 4096, - (va_list *) NULL + NULL ) ) { fprintf(stderr,"RDR_Ready CreateFile(%S) failed: 0x%X\r\n\t[%s]\r\n", @@ -215,7 +215,7 @@ RDR_Ready(void) MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US), buf, 4096, - (va_list *) NULL + NULL ) ) { fprintf(stderr,"RDR_Ready CreateFile(%s) failed: 0x%X\r\n\t[%s]\r\n", @@ -846,7 +846,7 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep) MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US), buf, 4096, - (va_list *) NULL + NULL ) ) { fprintf(stderr,"pioctl GetFileAttributes(%s) failed: 0x%X\r\n\t[%s]\r\n", @@ -921,7 +921,7 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep) MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US), buf, 4096, - (va_list *) NULL + NULL ) ) { fprintf(stderr,"pioctl GetFileAttributes(%s) failed: 0x%X\r\n\t[%s]\r\n", @@ -990,7 +990,7 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep) MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US), buf, 4096, - (va_list *) NULL + NULL ) ) { fprintf(stderr,"pioctl GetFileAttributes(%s) failed: 0x%X\r\n\t[%s]\r\n", @@ -1053,7 +1053,7 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep) MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US), buf, 4096, - (va_list *) NULL + NULL ) ) { fprintf(stderr,"pioctl GetFileAttributes(%s) failed: 0x%X\r\n\t[%s]\r\n", diff --git a/src/tsm41/aix_aklog.c b/src/tsm41/aix_aklog.c index a450a9fe3..49d677afc 100644 --- a/src/tsm41/aix_aklog.c +++ b/src/tsm41/aix_aklog.c @@ -230,8 +230,8 @@ get_credv5(krb5_context context, char *user, if ((r = krb5_build_principal(context, &increds.server, strlen(realm), realm, name, - (inst && strlen(inst)) ? inst : (void *) NULL, - (void *) NULL))) { + (inst && strlen(inst)) ? inst : NULL, + NULL))) { return r; } r = krb5_cc_default(context, &_krb425_ccache); diff --git a/src/ubik/disk.c b/src/ubik/disk.c index e9c81e603..2cff7ffd1 100644 --- a/src/ubik/disk.c +++ b/src/ubik/disk.c @@ -829,7 +829,7 @@ udisk_begin(struct ubik_dbase *adbase, int atype, struct ubik_trans **atrans) afs_int32 code; struct ubik_trans *tt; - *atrans = (struct ubik_trans *)NULL; + *atrans = NULL; if (atype == UBIK_WRITETRANS) { if (adbase->flags & DBWRITING) return USYNC; diff --git a/src/ubik/ubik.c b/src/ubik/ubik.c index 0c3cc2d53..b42bf4c34 100644 --- a/src/ubik/ubik.c +++ b/src/ubik/ubik.c @@ -641,7 +641,7 @@ BeginTrans(struct ubik_dbase *dbase, afs_int32 transMode, /* create the transaction */ code = udisk_begin(dbase, transMode, &jt); /* can't take address of register var */ tt = jt; /* move to a register */ - if (code || tt == (struct ubik_trans *)NULL) { + if (code || tt == NULL) { DBRELE(dbase); return code; } diff --git a/src/uss/uss.c b/src/uss/uss.c index c3394bc3d..c9afaf54b 100644 --- a/src/uss/uss.c +++ b/src/uss/uss.c @@ -1803,7 +1803,7 @@ main(int argc, char *argv[]) sigaction(SIGSEGV, &nsa, NULL); #endif strcpy(uss_whoami, argv[0]); - yyin = (FILE *) NULL; + yyin = NULL; uss_fs_InBuff = malloc(USS_FS_MAX_SIZE); /*Cache Manager input buff */ uss_fs_OutBuff = malloc(USS_FS_MAX_SIZE); /*Cache Manager output buff */ diff --git a/src/util/fstab.c b/src/util/fstab.c index 439c69536..1606d4ba8 100644 --- a/src/util/fstab.c +++ b/src/util/fstab.c @@ -58,7 +58,7 @@ mntinfo(struct statfs **mntbuffer) return (mntsize); } -static struct statfs *mntbuf = (struct statfs *)NULL; +static struct statfs *mntbuf = NULL; static struct statfs *mntent; static int mntcnt; static struct fstab fstabent; @@ -67,7 +67,7 @@ struct fstab * getfsent(void) { if (((!mntbuf) && !setfsent()) || mntcnt == 0) - return ((struct fstab *)NULL); + return (NULL); fstabent.fs_file = mntent->f_mntonname; fstabent.fs_freq = fstabent.fs_passno = 0; fstabent.fs_mntops = mntent->f_fstypename; diff --git a/src/venus/fs.c b/src/venus/fs.c index 382d3cdfc..9dc26badd 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -296,7 +296,7 @@ Parent(char *apath) tp = strrchr(tspace, '/'); if (tp == (char *)tspace) tp++; - else if (tp == (char *)NULL) { + else if (tp == NULL) { tp = (char *)tspace; *(tp++) = '.'; } diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 3f765ac8b..69873fe4b 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -449,7 +449,7 @@ delTree(char *root, char *tree, int *errp) cp = tree + strlen(tree); /* move cp to the end of string tree */ /* now delete all entries in this dir */ - if ((ds = opendir(root)) != (DIR *) NULL) { + if ((ds = opendir(root)) != NULL) { errno = 0; while ((dirp = readdir(ds))) { /* ignore . and .. */