From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 09/19] setup: Fix compilation issues with GCC 14 Date: Mon, 19 Aug 2024 10:05:58 +0000 Message-ID: <20240819100608.991138-10-michael.tremer@ipfire.org> In-Reply-To: <20240819100608.991138-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4906768456811497498==" List-Id: --===============4906768456811497498== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Signed-off-by: Michael Tremer --- src/setup/dhcp.c | 2 +- src/setup/main.c | 1 - src/setup/misc.c | 1 - src/setup/netstuff.c | 19 +++++++++---------- src/setup/networking.c | 9 ++------- 5 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/setup/dhcp.c b/src/setup/dhcp.c index 22f471851..48381f72f 100644 --- a/src/setup/dhcp.c +++ b/src/setup/dhcp.c @@ -38,7 +38,7 @@ void dhcpdialogcallbackdhcp(newtComponent cm, void *data); =20 int handledhcp(void) { - char *results[MAX_BOXES]; + const char *results[MAX_BOXES]; char enabledresult; char startenabled; struct newtExitStruct es; diff --git a/src/setup/main.c b/src/setup/main.c index adb98a231..c51c6e8fe 100644 --- a/src/setup/main.c +++ b/src/setup/main.c @@ -30,7 +30,6 @@ int main(int argc, char *argv[]) struct keyvalue *kv; char lang[STRING_SIZE] =3D "en_US.utf8"; char title[STRING_SIZE]; - int langcounter; int autook =3D 0; =20 /* Log file/terminal stuff. */ diff --git a/src/setup/misc.c b/src/setup/misc.c index f9ba39b8c..6c1033598 100644 --- a/src/setup/misc.c +++ b/src/setup/misc.c @@ -21,7 +21,6 @@ extern int automode; =20 int writehostsfiles(void) {=09 - char message[1000]; struct keyvalue *kv; char hostname[STRING_SIZE]; char domainname[STRING_SIZE] =3D "localdomain"; diff --git a/src/setup/netstuff.c b/src/setup/netstuff.c index 1e196dc1e..60e27242f 100644 --- a/src/setup/netstuff.c +++ b/src/setup/netstuff.c @@ -52,11 +52,11 @@ static int ip_input_filter(newtComponent entry, void * da= ta, int ch, int cursor) int changeaddress(struct keyvalue *kv, char *colour, int typeflag, char *defaultdhcphostname) { - char *addressresult; - char *netmaskresult; - char *gatewayresult; - char *dhcphostnameresult; - char *dhcpforcemturesult; + const char *addressresult; + const char *netmaskresult; + const char *gatewayresult; + const char *dhcphostnameresult; + const char *dhcpforcemturesult; struct newtExitStruct es; newtComponent header; newtComponent addresslabel; @@ -480,14 +480,14 @@ char* readmac(char *card) { char* find_nic4mac(char *findmac) { DIR *dir; struct dirent *dirzeiger; - char temp[STRING_SIZE], temp2[STRING_SIZE]; + char temp[STRING_SIZE] =3D ""; + char temp2[STRING_SIZE] =3D ""; =20 if((dir=3Dopendir(SYSDIR)) =3D=3D NULL) { fprintf(flog,"Fehler bei opendir (find_name4nic) ...\n"); return NULL; } =20 - sprintf(temp, ""); while((dirzeiger=3Dreaddir(dir)) !=3D NULL) { if(*((*dirzeiger).d_name) !=3D '.' & strcmp(((*dirzeiger).d_name), "lo") != =3D 0) { sprintf(temp2, "%s", readmac((*dirzeiger).d_name) ); @@ -550,7 +550,6 @@ int rename_nics(void) { =20 int write_configs_netudev(int card , int colour) {=09 - char commandstring[STRING_SIZE]; struct keyvalue *kv =3D initkeyvalues(); char temp1[STRING_SIZE], temp2[STRING_SIZE], temp3[STRING_SIZE]; char ucolour[STRING_SIZE]; @@ -586,7 +585,7 @@ int write_configs_netudev(int card , int colour) int scan_network_cards(void) { FILE *fp; - char driver[STRING_SIZE], description[STRING_SIZE], macaddr[STRING_SIZE], t= emp_line[STRING_SIZE]; + char temp_line[STRING_SIZE]; int count =3D 0; const char _driver[]=3D"driver: "; const char _desc[]=3D"desc: "; @@ -732,7 +731,7 @@ int ask_clear_card_entry(int card) sprintf(message, _("Do you really want to remove the assigned %s interface?= "), ucolourcard[card]); rc =3D newtWinChoice(_("Warning"), _("OK"), _("Cancel"), message); =20 - if ( rc =3D 0 || rc =3D=3D 1) { + if ( rc =3D=3D 0 || rc =3D=3D 1) { clear_card_entry(card); } else return 1; =20 diff --git a/src/setup/networking.c b/src/setup/networking.c index 9dd5205e5..8d398f365 100644 --- a/src/setup/networking.c +++ b/src/setup/networking.c @@ -385,7 +385,7 @@ int drivermenu(void) if (strcmp(knics[i].macaddr, "")) kcount++; =20 - if (neednics =3D kcount) + if (neednics =3D=3D kcount) { strcat(message, "\n"); strcat(message, _("Do you wish to change these settings?")); @@ -403,11 +403,6 @@ int drivermenu(void) return 1; } =20 -int set_menu_entry_for(int *nr, int *card) -{ - -} - int changedrivers(void) { struct keyvalue *kv =3D initkeyvalues(); @@ -438,7 +433,7 @@ int changedrivers(void) { green =3D 1; red =3D 1; blue =3D 1; } else if (configtype =3D=3D 4) { green =3D 1; red=3D1; orange=3D1; blue =3D 1; } - else if (configtype =3D=3D "") + else { green =3D 1; red =3D 1; } =20 do --=20 2.39.2 --===============4906768456811497498==--