More compile warning fixes
This commit is contained in:
@@ -892,10 +892,9 @@ pc_init_modules(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!video_card_available(gfxcard_2)) {
|
if (!video_card_available(gfxcard_2)) {
|
||||||
char temp[1024] = { 0 };
|
char tempc[512] = { 0 };
|
||||||
char tempc[1024] = { 0 };
|
|
||||||
device_get_name(video_card_getdevice(gfxcard_2), 0, tempc);
|
device_get_name(video_card_getdevice(gfxcard_2), 0, tempc);
|
||||||
snprintf(temp, sizeof(temp), "Video card #2 \"%s\" is not available due to missing ROMs in the roms/video directory. Disabling the second video card.", tempc);
|
swprintf(temp, sizeof(temp), (wchar_t *) "Video card #2 \"%hs\" is not available due to missing ROMs in the roms/video directory. Disabling the second video card.", tempc);
|
||||||
ui_msgbox_header(MBX_INFO, (wchar_t *) IDS_2128, temp);
|
ui_msgbox_header(MBX_INFO, (wchar_t *) IDS_2128, temp);
|
||||||
gfxcard_2 = 0;
|
gfxcard_2 = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,12 @@
|
|||||||
* Copyright 2022 RichardG.
|
* Copyright 2022 RichardG.
|
||||||
*/
|
*/
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
#ifndef _LARGEFILE_SOURCE
|
||||||
#define _LARGEFILE_SOURCE
|
#define _LARGEFILE_SOURCE
|
||||||
|
#endif
|
||||||
|
#ifndef _LARGEFILE64_SOURCE
|
||||||
#define _LARGEFILE64_SOURCE
|
#define _LARGEFILE64_SOURCE
|
||||||
|
#endif
|
||||||
#define __STDC_FORMAT_MACROS
|
#define __STDC_FORMAT_MACROS
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|||||||
@@ -713,7 +713,7 @@ load_network(void)
|
|||||||
ini_section_t cat = ini_find_section(config, "Network");
|
ini_section_t cat = ini_find_section(config, "Network");
|
||||||
char *p;
|
char *p;
|
||||||
char temp[512];
|
char temp[512];
|
||||||
int c = 0, min = 0;
|
uint16_t c = 0, min = 0;
|
||||||
|
|
||||||
/* Handle legacy configuration which supported only one NIC */
|
/* Handle legacy configuration which supported only one NIC */
|
||||||
p = ini_section_get_string(cat, "net_card", NULL);
|
p = ini_section_get_string(cat, "net_card", NULL);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ extern void ini_section_set_double(ini_section_t section, char *name, double
|
|||||||
extern void ini_section_set_hex16(ini_section_t section, char *name, int val);
|
extern void ini_section_set_hex16(ini_section_t section, char *name, int val);
|
||||||
extern void ini_section_set_hex20(ini_section_t section, char *name, int val);
|
extern void ini_section_set_hex20(ini_section_t section, char *name, int val);
|
||||||
extern void ini_section_set_mac(ini_section_t section, char *name, int val);
|
extern void ini_section_set_mac(ini_section_t section, char *name, int val);
|
||||||
extern void ini_section_set_string(ini_section_t section, char *name, char *val);
|
extern void ini_section_set_string(ini_section_t section, const char *name, const char *val);
|
||||||
extern void ini_section_set_wstring(ini_section_t section, char *name, wchar_t *val);
|
extern void ini_section_set_wstring(ini_section_t section, char *name, wchar_t *val);
|
||||||
|
|
||||||
#define ini_delete_var(ini, head, name) ini_section_delete_var(ini_find_section(ini, head), name)
|
#define ini_delete_var(ini, head, name) ini_section_delete_var(ini_find_section(ini, head), name)
|
||||||
|
|||||||
@@ -89,14 +89,14 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int device_num;
|
uint16_t device_num;
|
||||||
int net_type;
|
int net_type;
|
||||||
char host_dev_name[128];
|
char host_dev_name[128];
|
||||||
uint32_t link_state;
|
uint32_t link_state;
|
||||||
} netcard_conf_t;
|
} netcard_conf_t;
|
||||||
|
|
||||||
extern netcard_conf_t net_cards_conf[NET_CARD_MAX];
|
extern netcard_conf_t net_cards_conf[NET_CARD_MAX];
|
||||||
extern int net_card_current;
|
extern uint16_t net_card_current;
|
||||||
|
|
||||||
typedef int (*NETRXCB)(void *, uint8_t *, int);
|
typedef int (*NETRXCB)(void *, uint8_t *, int);
|
||||||
typedef int (*NETSETLINKSTATE)(void *, uint32_t link_state);
|
typedef int (*NETSETLINKSTATE)(void *, uint32_t link_state);
|
||||||
@@ -135,7 +135,7 @@ struct _netcard_t {
|
|||||||
mutex_t *tx_mutex;
|
mutex_t *tx_mutex;
|
||||||
mutex_t *rx_mutex;
|
mutex_t *rx_mutex;
|
||||||
pc_timer_t timer;
|
pc_timer_t timer;
|
||||||
int card_num;
|
uint16_t card_num;
|
||||||
double byte_period;
|
double byte_period;
|
||||||
uint32_t led_timer;
|
uint32_t led_timer;
|
||||||
uint32_t led_state;
|
uint32_t led_state;
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ ini_rename_section(ini_section_t section, char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static entry_t *
|
static entry_t *
|
||||||
find_entry(section_t *section, char *name)
|
find_entry(section_t *section, const char *name)
|
||||||
{
|
{
|
||||||
entry_t *ent;
|
entry_t *ent;
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ ini_find_or_create_section(ini_t ini, char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static entry_t *
|
static entry_t *
|
||||||
create_entry(section_t *section, char *name)
|
create_entry(section_t *section, const char *name)
|
||||||
{
|
{
|
||||||
entry_t *ne = malloc(sizeof(entry_t));
|
entry_t *ne = malloc(sizeof(entry_t));
|
||||||
|
|
||||||
@@ -750,7 +750,7 @@ ini_section_set_mac(ini_section_t self, char *name, int val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ini_section_set_string(ini_section_t self, char *name, char *val)
|
ini_section_set_string(ini_section_t self, const char *name, const char *val)
|
||||||
{
|
{
|
||||||
section_t *section = (section_t *) self;
|
section_t *section = (section_t *) self;
|
||||||
entry_t *ent;
|
entry_t *ent;
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <slirp/libslirp.h>
|
|
||||||
#define HAVE_STDARG_H
|
#define HAVE_STDARG_H
|
||||||
#include <86box/86box.h>
|
#include <86box/86box.h>
|
||||||
#include <86box/device.h>
|
#include <86box/device.h>
|
||||||
@@ -38,6 +37,10 @@
|
|||||||
#include <86box/ini.h>
|
#include <86box/ini.h>
|
||||||
#include <86box/config.h>
|
#include <86box/config.h>
|
||||||
#include <86box/video.h>
|
#include <86box/video.h>
|
||||||
|
|
||||||
|
# define _SSIZE_T_DEFINED
|
||||||
|
#include <slirp/libslirp.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
@@ -414,7 +417,7 @@ net_slirp_init(const netcard_t *card, const uint8_t *mac_addr, void *priv)
|
|||||||
/* Set up port forwarding. */
|
/* Set up port forwarding. */
|
||||||
int udp, external, internal, i = 0;
|
int udp, external, internal, i = 0;
|
||||||
char category[32];
|
char category[32];
|
||||||
snprintf(category, sizeof(category), "SLiRP Port Forwarding #%i", card->card_num + 1);
|
snprintf(category, sizeof(category), "SLiRP Port Forwarding #%d", card->card_num + 1);
|
||||||
char key[20];
|
char key[20];
|
||||||
while (1) {
|
while (1) {
|
||||||
sprintf(key, "%d_protocol", i);
|
sprintf(key, "%d_protocol", i);
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ static const device_t *net_cards[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
netcard_conf_t net_cards_conf[NET_CARD_MAX];
|
netcard_conf_t net_cards_conf[NET_CARD_MAX];
|
||||||
int net_card_current = 0;
|
uint16_t net_card_current = 0;
|
||||||
|
|
||||||
/* Global variables. */
|
/* Global variables. */
|
||||||
int network_ndev;
|
int network_ndev;
|
||||||
|
|||||||
@@ -2663,7 +2663,6 @@ static void
|
|||||||
svga_t *svga = svga_get_pri();
|
svga_t *svga = svga_get_pri();
|
||||||
xga_t *xga = &svga->xga;
|
xga_t *xga = &svga->xga;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
uint32_t temp;
|
|
||||||
uint32_t initial_bios_addr = device_get_config_hex20("init_bios_addr");
|
uint32_t initial_bios_addr = device_get_config_hex20("init_bios_addr");
|
||||||
uint8_t *rom = NULL;
|
uint8_t *rom = NULL;
|
||||||
|
|
||||||
@@ -2683,13 +2682,11 @@ static void
|
|||||||
|
|
||||||
f = rom_fopen(xga->type ? XGA2_BIOS_PATH : XGA_BIOS_PATH, "rb");
|
f = rom_fopen(xga->type ? XGA2_BIOS_PATH : XGA_BIOS_PATH, "rb");
|
||||||
(void) fseek(f, 0L, SEEK_END);
|
(void) fseek(f, 0L, SEEK_END);
|
||||||
temp = ftell(f);
|
|
||||||
(void) fseek(f, 0L, SEEK_SET);
|
(void) fseek(f, 0L, SEEK_SET);
|
||||||
|
|
||||||
rom = malloc(xga->bios_rom.sz);
|
rom = malloc(xga->bios_rom.sz);
|
||||||
memset(rom, 0xff, xga->bios_rom.sz);
|
memset(rom, 0xff, xga->bios_rom.sz);
|
||||||
(void) !fread(rom, xga->bios_rom.sz, 1, f);
|
(void) !fread(rom, xga->bios_rom.sz, 1, f);
|
||||||
temp -= xga->bios_rom.sz;
|
|
||||||
(void) fclose(f);
|
(void) fclose(f);
|
||||||
|
|
||||||
xga->bios_rom.rom = rom;
|
xga->bios_rom.rom = rom;
|
||||||
|
|||||||
Reference in New Issue
Block a user