diff options
author | Jeremy Katz <katzj@redhat.com> | 2005-06-13 19:09:23 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2005-06-13 19:09:23 +0000 |
commit | efd4daedfbe9d1cd0809f08c244c419231575436 (patch) | |
tree | 17e936613588a0ad9262c9dbfac3d21c3b7f96e9 /loader2 | |
parent | d6ddca580702b6c469f3952966a96bc54f4a0836 (diff) | |
download | anaconda-efd4daedfbe9d1cd0809f08c244c419231575436.tar.gz anaconda-efd4daedfbe9d1cd0809f08c244c419231575436.tar.xz anaconda-efd4daedfbe9d1cd0809f08c244c419231575436.zip |
2005-06-13 Jeremy Katz <katzj@redhat.com>
* Makefile Makefile.inc mini-wm.c xmouse.c xutils.c isys/Makefile
isys/isys.c isys/lang.c isys/smp.c isys/uncpio.c
isys/gzlib/Makefile isys/gzlib/inflate.c loader2/Makefile
loader2/driverdisk.c loader2/driverselect.c loader2/hdinstall.c
loader2/init.c loader2/kickstart.c loader2/loader.c
loader2/loadermisc.c loader2/moduleinfo.h loader2/modules.c
loader2/net.c loader2/nfsinstall.c loader2/telnet.c
loader2/undomounts.c loader2/urlinstall.c utils/Makefile
utils/genhdlist.c utils/mapshdr.c utils/snarffont.c: Define cflags
in one place (Makefile.inc) and use a consistent set
everywhere. Fix up some of the compile warnings this uncovered.
Also fix a few more things that -Wextra turned up.
Diffstat (limited to 'loader2')
-rw-r--r-- | loader2/Makefile | 16 | ||||
-rw-r--r-- | loader2/driverdisk.c | 8 | ||||
-rw-r--r-- | loader2/driverselect.c | 5 | ||||
-rw-r--r-- | loader2/hdinstall.c | 8 | ||||
-rw-r--r-- | loader2/init.c | 2 | ||||
-rw-r--r-- | loader2/kickstart.c | 8 | ||||
-rw-r--r-- | loader2/loader.c | 14 | ||||
-rw-r--r-- | loader2/loadermisc.c | 2 | ||||
-rw-r--r-- | loader2/moduleinfo.h | 3 | ||||
-rw-r--r-- | loader2/modules.c | 4 | ||||
-rw-r--r-- | loader2/net.c | 33 | ||||
-rw-r--r-- | loader2/nfsinstall.c | 6 | ||||
-rw-r--r-- | loader2/telnet.c | 2 | ||||
-rw-r--r-- | loader2/undomounts.c | 2 | ||||
-rw-r--r-- | loader2/urlinstall.c | 7 |
15 files changed, 61 insertions, 59 deletions
diff --git a/loader2/Makefile b/loader2/Makefile index 54d6f4812..d71987df9 100644 --- a/loader2/Makefile +++ b/loader2/Makefile @@ -35,9 +35,7 @@ else HWLIBS += -lpci endif -DEBUG = -ggdb -COPTS = $(DEBUG) -Os -Wall -DUSE_LOGDEV -DVERSION='"$(VERSION)"' -Werror -D_FORTIFY_SOURCE=2 -CFLAGS = $(COPTS) -ffunction-sections -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DHAVE_LIBIO_H +CFLAGS += -DUSE_LOGDEV -DVERSION='"$(VERSION)"' STATIC = -static REALCC=gcc @@ -94,22 +92,22 @@ linuxrc.s390: @echo "Nothing to do for $@" init: init.o undomounts.o shutdown.o - $(CC) $(STATIC) $(COPTS) $(LDFLAGS) -o $@ $^ + $(CC) $(STATIC) $(CFLAGS) $(LDFLAGS) -o $@ $^ shutdown: shutdown.o undomounts.o - $(CC) $(STATIC) $(COPTS) $(SHUTDOWNOPTS) $(LDFLAGS) -o $@ $^ + $(CC) $(STATIC) $(CFLAGS) $(SHUTDOWNOPTS) $(LDFLAGS) -o $@ $^ init.o: init.c - $(CC) $(COPTS) -c -o init.o init.c + $(CC) $(CFLAGS) -c -o init.o init.c undomounts.o: undomounts.c - $(CC) $(COPTS) -c -o undomounts.o undomounts.c + $(CC) $(CFLAGS) -c -o undomounts.o undomounts.c shutdown.o: shutdown.c - $(CC) $(COPTS) $(SHUTDOWNOPTS) -c -o shutdown.o shutdown.c + $(CC) $(CFLAGS) $(SHUTDOWNOPTS) -c -o shutdown.o shutdown.c mkctype: mkctype.c - $(REALCC) $(COPTS) -o mkctype mkctype.c + $(REALCC) $(CFLAGS) -o mkctype mkctype.c ctype.c: mkctype ./mkctype > ctype.c diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c index 66125ae91..e08995bc0 100644 --- a/loader2/driverdisk.c +++ b/loader2/driverdisk.c @@ -610,10 +610,10 @@ void useKickstartDD(struct loaderData_s * loaderData, int rc; int flags = *flagsPtr; struct poptOption ksDDOptions[] = { - { "type", '\0', POPT_ARG_STRING, &fstype, 0 }, - { "source", '\0', POPT_ARG_STRING, &src, 0 }, - { "biospart", '\0', POPT_ARG_NONE, &usebiosdev, 0 }, - { 0, 0, 0, 0, 0 } + { "type", '\0', POPT_ARG_STRING, &fstype, 0, NULL, NULL }, + { "source", '\0', POPT_ARG_STRING, &src, 0, NULL, NULL }, + { "biospart", '\0', POPT_ARG_NONE, &usebiosdev, 0, NULL, NULL }, + { 0, 0, 0, 0, 0, 0, 0 } }; optCon = poptGetContext(NULL, argc, (const char **) argv, ksDDOptions, 0); diff --git a/loader2/driverselect.c b/loader2/driverselect.c index f2cc4a000..2d19ad82f 100644 --- a/loader2/driverselect.c +++ b/loader2/driverselect.c @@ -162,7 +162,7 @@ int chooseManualDriver(int class, moduleList modLoaded, (class == CLASS_CDROM) || (class == CLASS_IDE)) type = DRIVER_SCSI; else if (class == CLASS_UNSPEC) - type = -1; + type = DRIVER_ANY; else { logMessage("unknown device class %d specified; aborting manual " "selection", class); @@ -176,7 +176,8 @@ int chooseManualDriver(int class, moduleList modLoaded, for (i = 0; i < modInfo->numModules; i++) { if (mlModuleInList(modInfo->moduleList[i].moduleName, modLoaded) || !modInfo->moduleList[i].description || - ((type != -1) && (type != modInfo->moduleList[i].major))) + ((type != DRIVER_ANY) && + (type != modInfo->moduleList[i].major))) continue; sortedOrder[numSorted].index = i; sortedOrder[numSorted++].modInfo = modInfo; diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c index a99c41909..219511f75 100644 --- a/loader2/hdinstall.c +++ b/loader2/hdinstall.c @@ -456,10 +456,10 @@ void setKickstartHD(struct loaderData_s * loaderData, int argc, int rc; struct poptOption ksHDOptions[] = { - { "biospart", '\0', POPT_ARG_STRING, &biospart, 0 }, - { "partition", '\0', POPT_ARG_STRING, &partition, 0 }, - { "dir", '\0', POPT_ARG_STRING, &dir, 0 }, - { 0, 0, 0, 0, 0 } + { "biospart", '\0', POPT_ARG_STRING, &biospart, 0, NULL, NULL }, + { "partition", '\0', POPT_ARG_STRING, &partition, 0, NULL, NULL }, + { "dir", '\0', POPT_ARG_STRING, &dir, 0, NULL, NULL }, + { 0, 0, 0, 0, 0, 0, 0 } }; diff --git a/loader2/init.c b/loader2/init.c index 91e19b1c9..8fb550c11 100644 --- a/loader2/init.c +++ b/loader2/init.c @@ -767,7 +767,7 @@ int main(int argc, char **argv) { signal(SIGINT, sigintHandler); if ((fd = open("/proc/sys/kernel/cad_pid", O_WRONLY)) != -1) { char buf[7]; - int count; + size_t count; sprintf(buf, "%d", getpid()); count = write(fd, buf, strlen(buf)); close(fd); diff --git a/loader2/kickstart.c b/loader2/kickstart.c index 197f4e4a8..aec7f633d 100644 --- a/loader2/kickstart.c +++ b/loader2/kickstart.c @@ -396,10 +396,10 @@ static void setShutdown(struct loaderData_s * loaderData, int argc, int rc; struct poptOption ksOptions[] = { - { "reboot", 'r', POPT_ARG_NONE, &reboot, 0 }, - { "halt", 'h', POPT_ARG_NONE, &halt, 0 }, - { "poweroff", 'p', POPT_ARG_NONE, &poweroff, 0 }, - { 0, 0, 0, 0, 0 } + { "reboot", 'r', POPT_ARG_NONE, &reboot, 0, NULL, NULL }, + { "halt", 'h', POPT_ARG_NONE, &halt, 0, NULL, NULL }, + { "poweroff", 'p', POPT_ARG_NONE, &poweroff, 0, NULL, NULL }, + { 0, 0, 0, 0, 0, 0, 0 } }; optCon = poptGetContext(NULL, argc, (const char **) argv, ksOptions, 0); diff --git a/loader2/loader.c b/loader2/loader.c index 7f341fc74..36672f169 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -1024,7 +1024,7 @@ static int manualDeviceCheck(moduleInfoSet modInfo, moduleList modLoaded, char ** devices; int i, j, rc, num = 0; struct moduleInfo * mi; - int width = 40; + unsigned int width = 40; char * buf; do { @@ -1140,12 +1140,12 @@ int main(int argc, char ** argv) { char * virtpcon = NULL; poptContext optCon; struct poptOption optionTable[] = { - { "cmdline", '\0', POPT_ARG_STRING, &cmdLine, 0 }, - { "ksfile", '\0', POPT_ARG_STRING, &ksFile, 0 }, - { "test", '\0', POPT_ARG_NONE, &testing, 0 }, - { "mediacheck", '\0', POPT_ARG_NONE, &mediacheck, 0}, - { "virtpconsole", '\0', POPT_ARG_STRING, &virtpcon, 0 }, - { 0, 0, 0, 0, 0 } + { "cmdline", '\0', POPT_ARG_STRING, &cmdLine, 0, NULL, NULL }, + { "ksfile", '\0', POPT_ARG_STRING, &ksFile, 0, NULL, NULL }, + { "test", '\0', POPT_ARG_NONE, &testing, 0, NULL, NULL }, + { "mediacheck", '\0', POPT_ARG_NONE, &mediacheck, 0, NULL, NULL}, + { "virtpconsole", '\0', POPT_ARG_STRING, &virtpcon, 0, NULL, NULL }, + { 0, 0, 0, 0, 0, 0, 0 } }; /* Make sure sort order is right. */ diff --git a/loader2/loadermisc.c b/loader2/loadermisc.c index 276bf2f71..eab3dbb70 100644 --- a/loader2/loadermisc.c +++ b/loader2/loadermisc.c @@ -189,7 +189,7 @@ char * sdupprintf(const char *format, ...) { char *buf = NULL; char c; va_list args; - size_t size = 0; + int size = 0; va_start(args, format); diff --git a/loader2/moduleinfo.h b/loader2/moduleinfo.h index 8c6bd3966..6c719a6bc 100644 --- a/loader2/moduleinfo.h +++ b/loader2/moduleinfo.h @@ -2,7 +2,8 @@ #define MODULEINFO_H enum driverMajor { DRIVER_NONE = 0, DRIVER_SCSI, DRIVER_NET, DRIVER_CDROM, - DRIVER_PCMCIA, DRIVER_FS, DRIVER_IDE, DRIVER_OTHER = 1000}; + DRIVER_PCMCIA, DRIVER_FS, DRIVER_IDE, DRIVER_OTHER = 1000, + DRIVER_ANY = 5000 }; enum driverMinor { DRIVER_MINOR_NONE = 0, DRIVER_MINOR_ETHERNET, DRIVER_MINOR_PLIP, DRIVER_MINOR_TR }; diff --git a/loader2/modules.c b/loader2/modules.c index 6d9760ec3..d190b153a 100644 --- a/loader2/modules.c +++ b/loader2/modules.c @@ -971,8 +971,8 @@ void loadKickstartModule(struct loaderData_s * loaderData, int argc, int rc; int flags = *flagsPtr; struct poptOption ksDeviceOptions[] = { - { "opts", '\0', POPT_ARG_STRING, &opts, 0 }, - { 0, 0, 0, 0, 0 } + { "opts", '\0', POPT_ARG_STRING, &opts, 0, NULL, NULL }, + { 0, 0, 0, 0, 0, 0, 0 } }; optCon = poptGetContext(NULL, argc, (const char **) argv, diff --git a/loader2/net.c b/loader2/net.c index 39a90bfce..cc4b5a2a5 100644 --- a/loader2/net.c +++ b/loader2/net.c @@ -850,21 +850,21 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc, poptContext optCon; struct poptOption ksOptions[] = { - { "bootproto", '\0', POPT_ARG_STRING, &bootProto, 0 }, - { "device", '\0', POPT_ARG_STRING, &device, 0 }, - { "dhcpclass", '\0', POPT_ARG_STRING, &class, 0 }, - { "gateway", '\0', POPT_ARG_STRING, NULL, 'g' }, - { "ip", '\0', POPT_ARG_STRING, NULL, 'i' }, - { "nameserver", '\0', POPT_ARG_STRING, NULL, 'n' }, - { "netmask", '\0', POPT_ARG_STRING, NULL, 'm' }, - { "nodns", '\0', POPT_ARG_NONE, &noDns, 0 }, - { "hostname", '\0', POPT_ARG_STRING, NULL, 'h'}, - { "ethtool", '\0', POPT_ARG_STRING, ðtool, 0 }, - { "essid", '\0', POPT_ARG_STRING, &essid, 0 }, - { "wepkey", '\0', POPT_ARG_STRING, &wepkey, 0 }, - { "onboot", '\0', POPT_ARG_STRING, &onboot, 0 }, - { "notksdevice", '\0', POPT_ARG_NONE, &noksdev, 0 }, - { 0, 0, 0, 0, 0 } + { "bootproto", '\0', POPT_ARG_STRING, &bootProto, 0, NULL, NULL }, + { "device", '\0', POPT_ARG_STRING, &device, 0, NULL, NULL }, + { "dhcpclass", '\0', POPT_ARG_STRING, &class, 0, NULL, NULL }, + { "gateway", '\0', POPT_ARG_STRING, NULL, 'g', NULL, NULL }, + { "ip", '\0', POPT_ARG_STRING, NULL, 'i', NULL, NULL }, + { "nameserver", '\0', POPT_ARG_STRING, NULL, 'n', NULL, NULL }, + { "netmask", '\0', POPT_ARG_STRING, NULL, 'm', NULL, NULL }, + { "nodns", '\0', POPT_ARG_NONE, &noDns, 0, NULL, NULL }, + { "hostname", '\0', POPT_ARG_STRING, NULL, 'h', NULL, NULL}, + { "ethtool", '\0', POPT_ARG_STRING, ðtool, 0, NULL, NULL }, + { "essid", '\0', POPT_ARG_STRING, &essid, 0, NULL, NULL }, + { "wepkey", '\0', POPT_ARG_STRING, &wepkey, 0, NULL, NULL }, + { "onboot", '\0', POPT_ARG_STRING, &onboot, 0, NULL, NULL }, + { "notksdevice", '\0', POPT_ARG_NONE, &noksdev, 0, NULL, NULL }, + { 0, 0, 0, 0, 0, 0, 0 } }; optCon = poptGetContext(NULL, argc, (const char **) argv, @@ -964,7 +964,8 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc, /* NOTE - uses kickstart data available in loaderData */ int chooseNetworkInterface(struct loaderData_s * loaderData, int flags) { - int i, rc, max = 40; + int i, rc; + unsigned int max = 40; int deviceNums = 0; int deviceNum; char ** devices; diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c index 9b5d5593e..6a702d0e6 100644 --- a/loader2/nfsinstall.c +++ b/loader2/nfsinstall.c @@ -236,9 +236,9 @@ void setKickstartNfs(struct loaderData_s * loaderData, int argc, poptContext optCon; int rc; struct poptOption ksNfsOptions[] = { - { "server", '\0', POPT_ARG_STRING, &host, 0 }, - { "dir", '\0', POPT_ARG_STRING, &dir, 0 }, - { 0, 0, 0, 0, 0 } + { "server", '\0', POPT_ARG_STRING, &host, 0, NULL, NULL }, + { "dir", '\0', POPT_ARG_STRING, &dir, 0, NULL, NULL }, + { 0, 0, 0, 0, 0, 0, 0 } }; logMessage("kickstartFromNfs"); diff --git a/loader2/telnet.c b/loader2/telnet.c index 473acfeb4..28946000d 100644 --- a/loader2/telnet.c +++ b/loader2/telnet.c @@ -119,7 +119,7 @@ telnet_negotiate(int socket, char ** term_type_ptr, int * heightPtr, termType[termLength++] = tolower(ch); } else if (state == ST_WINDOWSIZE) { - if ((sizePtr - sizeBuf) < sizeof(sizeBuf)) + if ((sizePtr - sizeBuf) < (int)sizeof(sizeBuf)) *sizePtr++ = ch; } diff --git a/loader2/undomounts.c b/loader2/undomounts.c index 92d8cdbb4..d562837ea 100644 --- a/loader2/undomounts.c +++ b/loader2/undomounts.c @@ -48,7 +48,7 @@ static void printstr(char * string) { } void undoMount(struct unmountInfo * fs, int numFs, int this) { - int len = strlen(fs[this].name); + size_t len = strlen(fs[this].name); int i; if (!fs[this].mounted) return; diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c index c344086a0..701b83093 100644 --- a/loader2/urlinstall.c +++ b/loader2/urlinstall.c @@ -372,7 +372,8 @@ int getFileFromUrl(char * url, char * dest, ehdrs = NULL; if (proto == URL_METHOD_HTTP && FL_KICKSTART_SEND_MAC(flags)) { /* find all ethernet devices and make a header entry for each one */ - int i, hdrlen; + int i; + unsigned int hdrlen; char *dev, *mac, tmpstr[128]; struct device ** devices; @@ -431,8 +432,8 @@ void setKickstartUrl(struct loaderData_s * loaderData, int argc, poptContext optCon; int rc; struct poptOption ksUrlOptions[] = { - { "url", '\0', POPT_ARG_STRING, &url, 0 }, - { 0, 0, 0, 0, 0 } + { "url", '\0', POPT_ARG_STRING, &url, 0, NULL, NULL }, + { 0, 0, 0, 0, 0, 0, 0 } }; logMessage("kickstartFromUrl"); |