Fixed assorted misuses of NULL in integer context.

This commit is contained in:
Bruce Evans 2004-03-11 11:58:16 +00:00
parent 8153ab0e6f
commit 03f0d9e8ae
12 changed files with 16 additions and 16 deletions

View File

@ -1342,7 +1342,7 @@ DMenu MenuConfigure = {
NULL, dmenuSubmenu, NULL, &MenuMedia },
#ifdef WITH_MICE
{ " Mouse", "Configure your mouse",
NULL, dmenuSubmenu, NULL, &MenuMouse, NULL },
NULL, dmenuSubmenu, NULL, &MenuMouse },
#endif
{ " Networking", "Configure additional network services",
NULL, dmenuSubmenu, NULL, &MenuNetworking },

View File

@ -871,7 +871,7 @@ extern void slice_wizard(Disk *d);
/*
* Macros. Please find a better place for us!
*/
#define DEVICE_INIT(d) ((d) != NULL ? (d)->init((d)) : NULL)
#define DEVICE_INIT(d) ((d) != NULL ? (d)->init((d)) : (Boolean)0)
#define DEVICE_GET(d, b, f) ((d) != NULL ? (d)->get((d), (b), (f)) : NULL)
#define DEVICE_SHUTDOWN(d) ((d) != NULL ? (d)->shutdown((d)) : (void)0)

View File

@ -140,7 +140,7 @@ systemInitialize(int argc, char **argv)
globalsInit();
i = sizeof(boothowto);
if (!sysctlbyname("debug.boothowto", &boothowto, &i, NULL, NULL) &&
if (!sysctlbyname("debug.boothowto", &boothowto, &i, NULL, 0) &&
(i == sizeof(boothowto)) && (boothowto & RB_VERBOSE))
variable_set2(VAR_DEBUG, "YES", 0);

View File

@ -205,7 +205,7 @@ variable_check2(char *data)
*cp3 = '\0';
cp2 = variable_get(tmp);
if (cp2 != NULL) {
if (*cp == NULL)
if (*cp == '\0')
return 2;
else
return strcmp(cp, cp2) == 0 ? 1 : 0;

View File

@ -115,7 +115,7 @@ static Layout layout[] = {
{ 19, 35, 0, 0,
"CANCEL", "Select this if you wish to cancel this screen",
&cancelbutton, BUTTONOBJ, NULL },
{ NULL },
{ 0 },
};
static int

View File

@ -89,7 +89,7 @@ dhcpParseLeases(char *file, char *hostname, char *domain, char *nameserver,
continue;
}
if ((tptr = (char *)strchr(tempbuf, ';')) && (*(tptr + 1) == 0)) {
*tptr = NULL;
*tptr = '\0';
endedflag = 1;
}
if (!isalnum(tempbuf[0])) {
@ -114,7 +114,7 @@ dhcpParseLeases(char *file, char *hostname, char *domain, char *nameserver,
continue;
}
if ((tptr = (char *)strchr(tempbuf, ';')) && (*(tptr + 1) == 0)) {
*tptr = NULL;
*tptr = '\0';
endedflag = 1;
}
if (tempbuf[0] == '"') {
@ -135,14 +135,14 @@ dhcpParseLeases(char *file, char *hostname, char *domain, char *nameserver,
strcpy(ipaddr, optbuf);
} else if (!strcasecmp("routers", optname)) {
if((tptr = (char *)strchr(optbuf, ',')))
*tptr = NULL;
*tptr = '\0';
strcpy(gateway, optbuf);
} else if (!strcasecmp("subnet-mask", optname)) {
strcpy(netmask, optbuf);
} else if (!strcasecmp("domain-name-servers", optname)) {
/* <jkh> ...one value per property */
if((tptr = (char *)strchr(optbuf, ',')))
*tptr = NULL;
*tptr = '\0';
strcpy(nameserver, optbuf);
}
if (endedflag) {

View File

@ -1342,7 +1342,7 @@ DMenu MenuConfigure = {
NULL, dmenuSubmenu, NULL, &MenuMedia },
#ifdef WITH_MICE
{ " Mouse", "Configure your mouse",
NULL, dmenuSubmenu, NULL, &MenuMouse, NULL },
NULL, dmenuSubmenu, NULL, &MenuMouse },
#endif
{ " Networking", "Configure additional network services",
NULL, dmenuSubmenu, NULL, &MenuNetworking },

View File

@ -871,7 +871,7 @@ extern void slice_wizard(Disk *d);
/*
* Macros. Please find a better place for us!
*/
#define DEVICE_INIT(d) ((d) != NULL ? (d)->init((d)) : NULL)
#define DEVICE_INIT(d) ((d) != NULL ? (d)->init((d)) : (Boolean)0)
#define DEVICE_GET(d, b, f) ((d) != NULL ? (d)->get((d), (b), (f)) : NULL)
#define DEVICE_SHUTDOWN(d) ((d) != NULL ? (d)->shutdown((d)) : (void)0)

View File

@ -140,7 +140,7 @@ systemInitialize(int argc, char **argv)
globalsInit();
i = sizeof(boothowto);
if (!sysctlbyname("debug.boothowto", &boothowto, &i, NULL, NULL) &&
if (!sysctlbyname("debug.boothowto", &boothowto, &i, NULL, 0) &&
(i == sizeof(boothowto)) && (boothowto & RB_VERBOSE))
variable_set2(VAR_DEBUG, "YES", 0);

View File

@ -103,7 +103,7 @@ static Layout layout[] = {
{ 19, 35, 0, 0,
"CANCEL", "Select this if you wish to cancel this screen",
&cancelbutton, BUTTONOBJ, NULL },
{ NULL },
{ 0 },
};
#define _validByte(b) ((b) >= 0 && (b) <= 255)

View File

@ -102,7 +102,7 @@ static Layout groupLayout[] = {
{ 18, 35, 0, 0,
"CANCEL", "Select this if you wish to cancel this screen",
&cancelbutton, BUTTONOBJ, NULL },
{ NULL },
{ 0 },
};
/* The user configuration menu. */
@ -147,7 +147,7 @@ static Layout userLayout[] = {
{ 18, 35, 0, 0,
"CANCEL", "Select this if you wish to cancel this screen",
&cancelbutton, BUTTONOBJ, NULL },
{ NULL },
{ 0 },
};
/* whine */

View File

@ -205,7 +205,7 @@ variable_check2(char *data)
*cp3 = '\0';
cp2 = variable_get(tmp);
if (cp2 != NULL) {
if (*cp == NULL)
if (*cp == '\0')
return 2;
else
return strcmp(cp, cp2) == 0 ? 1 : 0;