summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-05-06 06:30:51 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-05-06 06:30:51 +0000
commitf46306945c95adc9a6232ce86f908f2a51a771dd (patch)
tree7cfaba83c1935bc6624472e44d94f38ced09039c /mdk-stage1
parentab69c718222a8ad2f0fd91d26c6ca8dde5e5e797 (diff)
downloaddrakx-f46306945c95adc9a6232ce86f908f2a51a771dd.tar
drakx-f46306945c95adc9a6232ce86f908f2a51a771dd.tar.gz
drakx-f46306945c95adc9a6232ce86f908f2a51a771dd.tar.bz2
drakx-f46306945c95adc9a6232ce86f908f2a51a771dd.tar.xz
drakx-f46306945c95adc9a6232ce86f908f2a51a771dd.zip
Stage 1 compilation fixes for gcc 4.0 :
* more casts signed<->unsigned types * make choose_iso_in_directory()'s return type "void" * change order of .h files in network.c so strndup is included correctly * newt: initialize some variables properly * compile pcmcia and ppp with -Wno-deprecated-declarations, since they use deprecated types such as u_int32_t
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/config-stage1.h3
-rw-r--r--mdk-stage1/dhcp.c6
-rw-r--r--mdk-stage1/directory.c4
-rw-r--r--mdk-stage1/network.c6
-rw-r--r--mdk-stage1/newt/button.c2
-rw-r--r--mdk-stage1/newt/checkbox.c2
-rw-r--r--mdk-stage1/newt/entry.c2
-rw-r--r--mdk-stage1/newt/newt.c4
-rw-r--r--mdk-stage1/pcmcia_/Makefile2
-rw-r--r--mdk-stage1/ppp/pppd/Makefile2
-rw-r--r--mdk-stage1/rp-pppoe/src/common.c2
11 files changed, 22 insertions, 13 deletions
diff --git a/mdk-stage1/config-stage1.h b/mdk-stage1/config-stage1.h
index 99d773d67..3fd918ec7 100644
--- a/mdk-stage1/config-stage1.h
+++ b/mdk-stage1/config-stage1.h
@@ -15,6 +15,9 @@
#ifndef _CONFIG_STAGE1_H_
#define _CONFIG_STAGE1_H_
+#ifdef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
#define _GNU_SOURCE 1
diff --git a/mdk-stage1/dhcp.c b/mdk-stage1/dhcp.c
index b0c913e41..f5de6543e 100644
--- a/mdk-stage1/dhcp.c
+++ b/mdk-stage1/dhcp.c
@@ -220,7 +220,7 @@ static void parse_reply(struct bootp_request * breq, struct interface_info * int
memcpy(&intf->ip, &breq->yiaddr, 4);
- chptr = breq->vendor;
+ chptr = (unsigned char *) breq->vendor;
chptr += 4;
while (*chptr != 0xFF && (void *) chptr < (void *) breq->vendor + DHCP_VENDOR_LENGTH) {
char tmp_str[500];
@@ -307,7 +307,7 @@ static int get_vendor_code(struct bootp_request * bresp, unsigned char option, v
unsigned char * chptr;
unsigned int length, theOption;
- chptr = bresp->vendor + 4;
+ chptr = (unsigned char*) bresp->vendor + 4;
while (*chptr != 0xFF && *chptr != option) {
theOption = *chptr++;
if (!theOption)
@@ -483,7 +483,7 @@ static void add_vendor_code(struct bootp_request * breq, unsigned char option, u
unsigned char * chptr;
int theOption, theLength;
- chptr = breq->vendor;
+ chptr = (unsigned char*) breq->vendor;
chptr += 4;
while (*chptr != 0xFF && *chptr != option) {
theOption = *chptr++;
diff --git a/mdk-stage1/directory.c b/mdk-stage1/directory.c
index 3f0c4ed0a..6115b600c 100644
--- a/mdk-stage1/directory.c
+++ b/mdk-stage1/directory.c
@@ -45,7 +45,7 @@ char * extract_list_directory(char * direct)
return strdup(tmp);
}
-static enum return_type choose_iso_in_directory(char *directory, char *location_full)
+static void choose_iso_in_directory(char *directory, char *location_full)
{
char **file;
char *stage2_isos[100] = { "Use directory as a mirror tree", "-----" };
@@ -90,7 +90,7 @@ static enum return_type choose_iso_in_directory(char *directory, char *location_
DISTRIB_NAME " Distribution.",
stage2_isos, file);
if (results == RETURN_BACK) {
- return RETURN_BACK;
+ return;
} else if (results == RETURN_OK) {
if (!strcmp(*file, stage2_isos[0])) {
/* use directory as a mirror tree */
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c
index 5239b4bee..1d65acdaf 100644
--- a/mdk-stage1/network.c
+++ b/mdk-stage1/network.c
@@ -20,6 +20,9 @@
*/
#include <stdlib.h>
+/* define _GNU_SOURCE so strndup is available */
+#define _GNU_SOURCE
+#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -48,9 +51,6 @@
#include "directory.h"
#include "wireless.h"
-/* include it after config-stage1.h so that _GNU_SOURCE is defined and strndup is available */
-#include <string.h>
-
static void error_message_net(void) /* reduce code size */
{
stg1_error_message("Could not configure network.");
diff --git a/mdk-stage1/newt/button.c b/mdk-stage1/newt/button.c
index 1ff360dc5..d7da58175 100644
--- a/mdk-stage1/newt/button.c
+++ b/mdk-stage1/newt/button.c
@@ -136,6 +136,8 @@ static struct eventResult buttonEvent(newtComponent co,
struct event ev) {
struct eventResult er;
struct button * bu = co->data;
+ er.result = ER_IGNORED;
+ er.u.focus = NULL;
if (ev.when == EV_NORMAL) {
switch (ev.event) {
diff --git a/mdk-stage1/newt/checkbox.c b/mdk-stage1/newt/checkbox.c
index eee514c98..643609d34 100644
--- a/mdk-stage1/newt/checkbox.c
+++ b/mdk-stage1/newt/checkbox.c
@@ -193,6 +193,8 @@ struct eventResult cbEvent(newtComponent co, struct event ev) {
struct checkbox * cb = co->data;
struct eventResult er;
const char * cur;
+ er.result = ER_IGNORED;
+ er.u.focus = NULL;
if (ev.when == EV_NORMAL) {
switch (ev.event) {
diff --git a/mdk-stage1/newt/entry.c b/mdk-stage1/newt/entry.c
index 1b33f1c6f..0ee449cf9 100644
--- a/mdk-stage1/newt/entry.c
+++ b/mdk-stage1/newt/entry.c
@@ -197,6 +197,8 @@ static struct eventResult entryEvent(newtComponent co,
struct entry * en = co->data;
struct eventResult er;
int ch;
+ er.result = ER_IGNORED;
+ er.u.focus = NULL;
if (ev.when == EV_NORMAL) {
switch (ev.event) {
diff --git a/mdk-stage1/newt/newt.c b/mdk-stage1/newt/newt.c
index d6cb3cd96..a41b7900b 100644
--- a/mdk-stage1/newt/newt.c
+++ b/mdk-stage1/newt/newt.c
@@ -397,7 +397,7 @@ int newtOpenWindow(int left, int top, int width, int height,
n = 0;
for (j = 0; j < height + 3; j++, row++) {
SLsmg_gotorc(row, col);
- SLsmg_read_raw(currentWindow->buffer + n,
+ SLsmg_read_raw((SLsmg_Char_Type *)currentWindow->buffer + n,
currentWindow->width + 3);
n += currentWindow->width + 3;
}
@@ -462,7 +462,7 @@ void newtPopWindow(void) {
col = currentWindow->left - 1;
for (j = 0; j < currentWindow->height + 3; j++, row++) {
SLsmg_gotorc(row, col);
- SLsmg_write_raw(currentWindow->buffer + n,
+ SLsmg_write_raw((SLsmg_Char_Type *)currentWindow->buffer + n,
currentWindow->width + 3);
n += currentWindow->width + 3;
}
diff --git a/mdk-stage1/pcmcia_/Makefile b/mdk-stage1/pcmcia_/Makefile
index b7850a5f3..9cecc8784 100644
--- a/mdk-stage1/pcmcia_/Makefile
+++ b/mdk-stage1/pcmcia_/Makefile
@@ -23,7 +23,7 @@ all: libpcmcia.a
clean:
rm -f *.o libpcmcia.a
-FLAGS = -D__linux__ -Wall -Werror -Os -fomit-frame-pointer -pipe -c -I.. -D_BSD_SOURCE
+FLAGS = -D__linux__ -Wall -Werror -Wno-deprecated-declarations -Os -fomit-frame-pointer -pipe -c -I.. -D_BSD_SOURCE
OBJS = probe.o cardmgr.o lex_config.o yacc_config.o
diff --git a/mdk-stage1/ppp/pppd/Makefile b/mdk-stage1/ppp/pppd/Makefile
index 0f566a8d8..3544dd19d 100644
--- a/mdk-stage1/ppp/pppd/Makefile
+++ b/mdk-stage1/ppp/pppd/Makefile
@@ -28,7 +28,7 @@ all: $(TARGETS)
clean:
rm -f *.o *.a $(BINTARGET) pppd
-FLAGS = -Wall -Werror -Os -fomit-frame-pointer -DDO_BSD_COMPRESS=0 -D_linux_=1 -DHAVE_MMAP -DNO_DRAND48 -D_BSD_SOURCE -D_GNU_SOURCE
+FLAGS = -Wall -Wno-deprecated-declarations -Werror -Os -fomit-frame-pointer -DDO_BSD_COMPRESS=0 -D_linux_=1 -DHAVE_MMAP -DNO_DRAND48 -D_BSD_SOURCE -D_GNU_SOURCE
INCS = -I../include -I.
diff --git a/mdk-stage1/rp-pppoe/src/common.c b/mdk-stage1/rp-pppoe/src/common.c
index b27302104..b6e43996b 100644
--- a/mdk-stage1/rp-pppoe/src/common.c
+++ b/mdk-stage1/rp-pppoe/src/common.c
@@ -418,7 +418,7 @@ sendPADT(PPPoEConnection *conn, char const *msg)
size_t elen = strlen(msg);
err.type = htons(TAG_GENERIC_ERROR);
err.length = htons(elen);
- strcpy(err.payload, msg);
+ strcpy((char *)err.payload, msg);
memcpy(cursor, &err, elen + TAG_HDR_SIZE);
cursor += elen + TAG_HDR_SIZE;
plen += elen + TAG_HDR_SIZE;