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)
/* initialize critical regions and semaphores */
for(i=0;i<OSI_SLEEPHASHSIZE; i++) {
InitializeCriticalSection(&osi_critSec[i]);
- osi_sleepers[i] = (osi_sleepInfo_t *) NULL;
- osi_sleepersEnd[i] = (osi_sleepInfo_t *) NULL;
+ osi_sleepers[i] = NULL;
+ osi_sleepersEnd[i] = NULL;
}
/* free list CS */
{VOPPREF(blktooff_desc), (VOPFUNC)afs_vop_blktooff}, /* blktooff */
{VOPPREF(offtoblk_desc), (VOPFUNC)afs_vop_offtoblk}, /* offtoblk */
{VOPPREF(bwrite_desc), (VOPFUNC)vn_bwrite},
- {(struct vnodeop_desc *)NULL, (void (*)())NULL}
+ {NULL, (void (*)())NULL}
};
struct vnodeopv_desc afs_vnodeop_opv_desc =
{ &afs_vnodeop_p, afs_vnodeop_entries };
{VOPPREF(blktooff_desc), (VOPFUNC)err_blktooff}, /* blktooff */
{VOPPREF(offtoblk_desc), (VOPFUNC)err_offtoblk}, /* offtoblk */
{VOPPREF(bwrite_desc), (VOPFUNC)err_bwrite},
- {(struct vnodeop_desc *)NULL, (void (*)())NULL}
+ {NULL, (void (*)())NULL}
};
struct vnodeopv_desc afs_dead_vnodeop_opv_desc =
{ &afs_dead_vnodeop_p, afs_dead_vnodeop_entries };
/* Try to remove the directory if this is a volume
* special file. It's ok to fail.
*/
- AFS_VOP_LOOKUP(dvp, "..", &ddvp, (struct pathname *)NULL,
+ AFS_VOP_LOOKUP(dvp, "..", &ddvp, NULL,
0, OSI_GET_CURRENT_RDIR(),
OSI_GET_CURRENT_CRED(), code2);
if (!code2) {
* only if it's an IP27 or IP35.
*/
pinv =
- find_inventory((inventory_t *) NULL, INV_PROCESSOR,
+ find_inventory(NULL, INV_PROCESSOR,
INV_CPUBOARD, -1, -1, -1);
if (!pinv)
code = ENODEV;
vSetVfsp(avc, afs_globalVFS);
vSetType(avc, VREG);
- VN_SET_DPAGES(&(avc->v), (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);
{&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 };
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);
return (j);
}
} else
- return ((struct axscache *)NULL);
+ return (NULL);
i = j->next;
}
- return ((struct axscache *)NULL);
+ return (NULL);
}
for (wvc = *uvc; wvc; uvc = &wvc->hnext, wvc = *uvc) {
if (avc == wvc) {
*uvc = avc->hnext;
- avc->hnext = (struct vcache *)NULL;
+ avc->hnext = NULL;
break;
}
}
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))
/* 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);
}
len2 = strlen(s2);
if (len1 < len2)
- return ((char *)NULL);
+ return (NULL);
ptr = s1;
ptr++;
len1--;
}
- return ((char *)NULL);
+ return (NULL);
}
#endif
/* 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,
/* 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)
/* 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 */
/* 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,
/* 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)
/* 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 */
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;
}
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);
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 */
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;
p = strrchr(filename, '/');
- if (p == (char *)NULL)
+ if (p == NULL)
p = filename;
else
p++;
}
hfile = fopen(h_file, "w");
- if (hfile == (FILE *) NULL) {
+ if (hfile == NULL) {
perror(h_file);
exit(1);
}
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);
}
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 <pthread.h>
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);
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)
{
} 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)
while (ncurrent > current) {
if (!msfile)
- fputs("\t(char *)NULL,\n", cfile);
+ fputs("\tNULL,\n", cfile);
current++;
}
if (msfile) {
} 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);
}
#include "internal.h"
-char *current_token = (char *)NULL;
+char *current_token = NULL;
extern char *table_name;
char *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)
} 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
while (ncurrent > current) {
if (!msfile)
- fputs("\t(char *)NULL,\n", cfile);
+ fputs("\tNULL,\n", cfile);
current++;
}
if (msfile) {
} 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
{
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);
}
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);
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) {
pcb->wakevent = 0;
pcb->waitcnt = 0;
pcb->next = pcb->prev = (PROCESS)NULL;
- pcb->iomgrRequest = (struct IoRequest*)NULL;
+ pcb->iomgrRequest = NULL;
pcb->index = lwp_nextindex ++;
}
(void)time(&stime);
code =
IOMGR_Select(sockFD + 1, rfds, wfds, efds,
- (struct timeval *)NULL);
+ NULL);
assert(code > 0);
if (FD_ISSET(sockFD, wfds)) {
}
Die(1, "No free client handles!\n");
- return (clientHandle_t *) NULL; /* quiet compiler. */
+ return NULL; /* quiet compiler. */
}
int nSigIO = 0;
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)));
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]);
} 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;
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]);
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;
*/
if (tdir && !gottdir) {
afsconf_Close(tdir);
- tdir = (struct afsconf_dir *)NULL;
+ tdir = NULL;
}
- pruclient = (struct ubik_client *)NULL;
+ pruclient = NULL;
refresh = 1;
}
return;
}
if (nomain) {
- write_programs((char *)NULL);
+ write_programs(NULL);
} else {
write_most();
do_registers(argc, argv);
return (0);
}
ldomain[MAXHOSTNAMELEN] = '\0';
- if ((domainp = strchr(ldomain, '.')) == (char *)NULL) {
+ if ((domainp = strchr(ldomain, '.')) == NULL) {
nodomain = 1;
return (0);
}
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",
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",
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",
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",
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",
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",
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);
afs_int32 code;
struct ubik_trans *tt;
- *atrans = (struct ubik_trans *)NULL;
+ *atrans = NULL;
if (atype == UBIK_WRITETRANS) {
if (adbase->flags & DBWRITING)
return USYNC;
/* 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;
}
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 */
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;
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;
tp = strrchr(tspace, '/');
if (tp == (char *)tspace)
tp++;
- else if (tp == (char *)NULL) {
+ else if (tp == NULL) {
tp = (char *)tspace;
*(tp++) = '.';
}
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 .. */