SCP: Fix various compiler warnings
This commit is contained in:
parent
3a9a15f3a9
commit
0e544b71ff
4 changed files with 74 additions and 83 deletions
112
scp.c
112
scp.c
|
@ -2222,70 +2222,70 @@ static const char simh_help[] =
|
||||||
|
|
||||||
|
|
||||||
static CTAB cmd_table[] = {
|
static CTAB cmd_table[] = {
|
||||||
{ "RESET", &reset_cmd, 0, HLP_RESET },
|
{ "RESET", &reset_cmd, 0, HLP_RESET, NULL, NULL },
|
||||||
{ "EXAMINE", &exdep_cmd, EX_E, HLP_EXAMINE },
|
{ "EXAMINE", &exdep_cmd, EX_E, HLP_EXAMINE, NULL, NULL },
|
||||||
{ "IEXAMINE", &exdep_cmd, EX_E+EX_I, HLP_IEXAMINE },
|
{ "IEXAMINE", &exdep_cmd, EX_E+EX_I, HLP_IEXAMINE, NULL, NULL },
|
||||||
{ "DEPOSIT", &exdep_cmd, EX_D, HLP_DEPOSIT },
|
{ "DEPOSIT", &exdep_cmd, EX_D, HLP_DEPOSIT, NULL, NULL },
|
||||||
{ "IDEPOSIT", &exdep_cmd, EX_D+EX_I, HLP_IDEPOSIT },
|
{ "IDEPOSIT", &exdep_cmd, EX_D+EX_I, HLP_IDEPOSIT, NULL, NULL },
|
||||||
{ "EVALUATE", &eval_cmd, 0, HLP_EVALUATE },
|
{ "EVALUATE", &eval_cmd, 0, HLP_EVALUATE, NULL, NULL },
|
||||||
{ "RUN", &run_cmd, RU_RUN, HLP_RUN, NULL, &run_cmd_message },
|
{ "RUN", &run_cmd, RU_RUN, HLP_RUN, NULL, &run_cmd_message },
|
||||||
{ "GO", &run_cmd, RU_GO, HLP_GO, NULL, &run_cmd_message },
|
{ "GO", &run_cmd, RU_GO, HLP_GO, NULL, &run_cmd_message },
|
||||||
{ "STEP", &run_cmd, RU_STEP, HLP_STEP, NULL, &run_cmd_message },
|
{ "STEP", &run_cmd, RU_STEP, HLP_STEP, NULL, &run_cmd_message },
|
||||||
{ "NEXT", &run_cmd, RU_NEXT, HLP_NEXT, NULL, &run_cmd_message },
|
{ "NEXT", &run_cmd, RU_NEXT, HLP_NEXT, NULL, &run_cmd_message },
|
||||||
{ "CONTINUE", &run_cmd, RU_CONT, HLP_CONTINUE, NULL, &run_cmd_message },
|
{ "CONTINUE", &run_cmd, RU_CONT, HLP_CONTINUE, NULL, &run_cmd_message },
|
||||||
{ "BOOT", &run_cmd, RU_BOOT, HLP_BOOT, NULL, &run_cmd_message },
|
{ "BOOT", &run_cmd, RU_BOOT, HLP_BOOT, NULL, &run_cmd_message },
|
||||||
{ "BREAK", &brk_cmd, SSH_ST, HLP_BREAK },
|
{ "BREAK", &brk_cmd, SSH_ST, HLP_BREAK, NULL, NULL },
|
||||||
{ "NOBREAK", &brk_cmd, SSH_CL, HLP_NOBREAK },
|
{ "NOBREAK", &brk_cmd, SSH_CL, HLP_NOBREAK, NULL, NULL },
|
||||||
{ "DEBUG", &debug_cmd, 1, HLP_DEBUG},
|
{ "DEBUG", &debug_cmd, 1, HLP_DEBUG, NULL, NULL },
|
||||||
{ "NODEBUG", &debug_cmd, 0, HLP_NODEBUG },
|
{ "NODEBUG", &debug_cmd, 0, HLP_NODEBUG, NULL, NULL },
|
||||||
{ "ATTACH", &attach_cmd, 0, HLP_ATTACH },
|
{ "ATTACH", &attach_cmd, 0, HLP_ATTACH, NULL, NULL },
|
||||||
{ "DETACH", &detach_cmd, 0, HLP_DETACH },
|
{ "DETACH", &detach_cmd, 0, HLP_DETACH, NULL, NULL },
|
||||||
{ "ASSIGN", &assign_cmd, 0, HLP_ASSIGN },
|
{ "ASSIGN", &assign_cmd, 0, HLP_ASSIGN, NULL, NULL },
|
||||||
{ "DEASSIGN", &deassign_cmd, 0, HLP_DEASSIGN },
|
{ "DEASSIGN", &deassign_cmd, 0, HLP_DEASSIGN, NULL, NULL },
|
||||||
{ "SAVE", &save_cmd, 0, HLP_SAVE },
|
{ "SAVE", &save_cmd, 0, HLP_SAVE, NULL, NULL },
|
||||||
{ "RESTORE", &restore_cmd, 0, HLP_RESTORE },
|
{ "RESTORE", &restore_cmd, 0, HLP_RESTORE, NULL, NULL },
|
||||||
{ "GET", &restore_cmd, 0, NULL },
|
{ "GET", &restore_cmd, 0, NULL, NULL, NULL },
|
||||||
{ "LOAD", &load_cmd, 0, HLP_LOAD },
|
{ "LOAD", &load_cmd, 0, HLP_LOAD, NULL, NULL },
|
||||||
{ "DUMP", &load_cmd, 1, HLP_DUMP },
|
{ "DUMP", &load_cmd, 1, HLP_DUMP, NULL, NULL },
|
||||||
{ "EXIT", &exit_cmd, 0, HLP_EXIT },
|
{ "EXIT", &exit_cmd, 0, HLP_EXIT, NULL, NULL },
|
||||||
{ "QUIT", &exit_cmd, 0, NULL },
|
{ "QUIT", &exit_cmd, 0, NULL, NULL, NULL },
|
||||||
{ "BYE", &exit_cmd, 0, NULL },
|
{ "BYE", &exit_cmd, 0, NULL, NULL, NULL },
|
||||||
{ "CD", &set_default_cmd, 0, HLP_CD },
|
{ "CD", &set_default_cmd, 0, HLP_CD, NULL, NULL },
|
||||||
{ "PWD", &pwd_cmd, 0, HLP_PWD },
|
{ "PWD", &pwd_cmd, 0, HLP_PWD, NULL, NULL },
|
||||||
{ "DIR", &dir_cmd, 0, HLP_DIR },
|
{ "DIR", &dir_cmd, 0, HLP_DIR, NULL, NULL },
|
||||||
{ "LS", &dir_cmd, 0, HLP_LS },
|
{ "LS", &dir_cmd, 0, HLP_LS, NULL, NULL },
|
||||||
{ "TYPE", &type_cmd, 0, HLP_TYPE },
|
{ "TYPE", &type_cmd, 0, HLP_TYPE, NULL, NULL },
|
||||||
{ "CAT", &type_cmd, 0, HLP_CAT },
|
{ "CAT", &type_cmd, 0, HLP_CAT, NULL, NULL },
|
||||||
{ "DELETE", &delete_cmd, 0, HLP_DELETE },
|
{ "DELETE", &delete_cmd, 0, HLP_DELETE, NULL, NULL },
|
||||||
{ "RM", &delete_cmd, 0, HLP_RM },
|
{ "RM", &delete_cmd, 0, HLP_RM, NULL, NULL },
|
||||||
{ "COPY", ©_cmd, 0, HLP_COPY },
|
{ "COPY", ©_cmd, 0, HLP_COPY, NULL, NULL },
|
||||||
{ "CP", ©_cmd, 0, HLP_CP },
|
{ "CP", ©_cmd, 0, HLP_CP, NULL, NULL },
|
||||||
{ "SET", &set_cmd, 0, HLP_SET },
|
{ "SET", &set_cmd, 0, HLP_SET, NULL, NULL },
|
||||||
{ "SHOW", &show_cmd, 0, HLP_SHOW },
|
{ "SHOW", &show_cmd, 0, HLP_SHOW, NULL, NULL },
|
||||||
{ "DO", &do_cmd, 1, HLP_DO },
|
{ "DO", &do_cmd, 1, HLP_DO, NULL, NULL },
|
||||||
{ "GOTO", &goto_cmd, 1, HLP_GOTO },
|
{ "GOTO", &goto_cmd, 1, HLP_GOTO, NULL, NULL },
|
||||||
{ "RETURN", &return_cmd, 0, HLP_RETURN },
|
{ "RETURN", &return_cmd, 0, HLP_RETURN, NULL, NULL },
|
||||||
{ "SHIFT", &shift_cmd, 0, HLP_SHIFT },
|
{ "SHIFT", &shift_cmd, 0, HLP_SHIFT, NULL, NULL },
|
||||||
{ "CALL", &call_cmd, 0, HLP_CALL },
|
{ "CALL", &call_cmd, 0, HLP_CALL, NULL, NULL },
|
||||||
{ "ON", &on_cmd, 0, HLP_ON },
|
{ "ON", &on_cmd, 0, HLP_ON, NULL, NULL },
|
||||||
{ "IF", &assert_cmd, 0, HLP_IF },
|
{ "IF", &assert_cmd, 0, HLP_IF, NULL, NULL },
|
||||||
{ "ELSE", &assert_cmd, 2, HLP_IF },
|
{ "ELSE", &assert_cmd, 2, HLP_IF, NULL, NULL },
|
||||||
{ "PROCEED", &noop_cmd, 0, HLP_PROCEED },
|
{ "PROCEED", &noop_cmd, 0, HLP_PROCEED, NULL, NULL },
|
||||||
{ "IGNORE", &noop_cmd, 0, HLP_IGNORE },
|
{ "IGNORE", &noop_cmd, 0, HLP_IGNORE, NULL, NULL },
|
||||||
{ "ECHO", &echo_cmd, 0, HLP_ECHO },
|
{ "ECHO", &echo_cmd, 0, HLP_ECHO, NULL, NULL },
|
||||||
{ "ECHOF", &echof_cmd, 0, HLP_ECHOF },
|
{ "ECHOF", &echof_cmd, 0, HLP_ECHOF, NULL, NULL },
|
||||||
{ "ASSERT", &assert_cmd, 1, HLP_ASSERT },
|
{ "ASSERT", &assert_cmd, 1, HLP_ASSERT, NULL, NULL },
|
||||||
{ "SEND", &send_cmd, 1, HLP_SEND },
|
{ "SEND", &send_cmd, 1, HLP_SEND, NULL, NULL },
|
||||||
{ "NOSEND", &send_cmd, 0, HLP_SEND },
|
{ "NOSEND", &send_cmd, 0, HLP_SEND, NULL, NULL },
|
||||||
{ "EXPECT", &expect_cmd, 1, HLP_EXPECT },
|
{ "EXPECT", &expect_cmd, 1, HLP_EXPECT, NULL, NULL },
|
||||||
{ "NOEXPECT", &expect_cmd, 0, HLP_EXPECT },
|
{ "NOEXPECT", &expect_cmd, 0, HLP_EXPECT, NULL, NULL },
|
||||||
{ "SLEEP", &sleep_cmd, 0, HLP_SLEEP },
|
{ "SLEEP", &sleep_cmd, 0, HLP_SLEEP, NULL, NULL },
|
||||||
{ "!", &spawn_cmd, 0, HLP_SPAWN },
|
{ "!", &spawn_cmd, 0, HLP_SPAWN, NULL, NULL },
|
||||||
{ "HELP", &help_cmd, 0, HLP_HELP },
|
{ "HELP", &help_cmd, 0, HLP_HELP, NULL, NULL },
|
||||||
#if defined(USE_SIM_VIDEO)
|
#if defined(USE_SIM_VIDEO)
|
||||||
{ "SCREENSHOT", &screenshot_cmd,0, HLP_SCREENSHOT },
|
{ "SCREENSHOT", &screenshot_cmd,0, HLP_SCREENSHOT, NULL, NULL },
|
||||||
#endif
|
#endif
|
||||||
{ NULL, NULL, 0 }
|
{ NULL, NULL, 0, NULL, NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
static CTAB set_glob_tab[] = {
|
static CTAB set_glob_tab[] = {
|
||||||
|
|
22
sim_defs.h
22
sim_defs.h
|
@ -960,12 +960,12 @@ struct MEMFILE {
|
||||||
_REGDATANF(#nm,&(loc),rdx,wd,off,dep,desc,NULL,0,siz),((fl) | REG_STRUCT)
|
_REGDATANF(#nm,&(loc),rdx,wd,off,dep,desc,NULL,0,siz),((fl) | REG_STRUCT)
|
||||||
#define STRDATADF(nm,loc,rdx,wd,off,dep,siz,fl,desc,flds) \
|
#define STRDATADF(nm,loc,rdx,wd,off,dep,siz,fl,desc,flds) \
|
||||||
_REGDATANF(#nm,&(loc),rdx,wd,off,dep,desc,flds,0,siz),((fl) | REG_STRUCT)
|
_REGDATANF(#nm,&(loc),rdx,wd,off,dep,desc,flds,0,siz),((fl) | REG_STRUCT)
|
||||||
#define BIT(nm) {#nm, 0xffffffff, 1} /* Single Bit definition */
|
#define BIT(nm) {#nm, 0xffffffff, 1, NULL, NULL} /* Single Bit definition */
|
||||||
#define BITNC {"", 0xffffffff, 1} /* Don't care Bit definition */
|
#define BITNC {"", 0xffffffff, 1, NULL, NULL} /* Don't care Bit definition */
|
||||||
#define BITF(nm,sz) {#nm, 0xffffffff, sz} /* Bit Field definition */
|
#define BITF(nm,sz) {#nm, 0xffffffff, sz, NULL, NULL} /* Bit Field definition */
|
||||||
#define BITNCF(sz) {"", 0xffffffff, sz} /* Don't care Bit Field definition */
|
#define BITNCF(sz) {"", 0xffffffff, sz, NULL, NULL} /* Don't care Bit Field definition */
|
||||||
#define BITFFMT(nm,sz,fmt) {#nm, 0xffffffff, sz, NULL, #fmt}/* Bit Field definition with Output format */
|
#define BITFFMT(nm,sz,fmt) {#nm, 0xffffffff, sz, NULL, #fmt} /* Bit Field definition with Output format */
|
||||||
#define BITFNAM(nm,sz,names) {#nm, 0xffffffff, sz, names} /* Bit Field definition with value->name map */
|
#define BITFNAM(nm,sz,names) {#nm, 0xffffffff, sz, names,NULL} /* Bit Field definition with value->name map */
|
||||||
#else /* For non-STD-C compiler which can't stringify macro arguments with # */
|
#else /* For non-STD-C compiler which can't stringify macro arguments with # */
|
||||||
/* Generic Register declaration for all fields.
|
/* Generic Register declaration for all fields.
|
||||||
If the register structure is extended, this macro will be retained and a
|
If the register structure is extended, this macro will be retained and a
|
||||||
|
@ -1037,12 +1037,12 @@ struct MEMFILE {
|
||||||
_REGDATANF("nm",&(loc),rdx,wd,off,dep,desc,NULL,0,siz),((fl) | REG_STRUCT)
|
_REGDATANF("nm",&(loc),rdx,wd,off,dep,desc,NULL,0,siz),((fl) | REG_STRUCT)
|
||||||
#define STRDATADF(nm,loc,rdx,wd,off,dep,siz,fl,desc,flds) \
|
#define STRDATADF(nm,loc,rdx,wd,off,dep,siz,fl,desc,flds) \
|
||||||
_REGDATANF("nm",&(loc),rdx,wd,off,dep,desc,flds,0,siz),((fl) | REG_STRUCT)
|
_REGDATANF("nm",&(loc),rdx,wd,off,dep,desc,flds,0,siz),((fl) | REG_STRUCT)
|
||||||
#define BIT(nm) {"nm", 0xffffffff, 1} /* Single Bit definition */
|
#define BIT(nm) {"nm", 0xffffffff, 1, NULL, NULL} /* Single Bit definition */
|
||||||
#define BITNC {"", 0xffffffff, 1} /* Don't care Bit definition */
|
#define BITNC {"", 0xffffffff, 1, NULL, NULL} /* Don't care Bit definition */
|
||||||
#define BITF(nm,sz) {"nm", 0xffffffff, sz} /* Bit Field definition */
|
#define BITF(nm,sz) {"nm", 0xffffffff, sz, NULL, NULL} /* Bit Field definition */
|
||||||
#define BITNCF(sz) {"", 0xffffffff, sz} /* Don't care Bit Field definition */
|
#define BITNCF(sz) {"", 0xffffffff, sz, NULL, NULL} /* Don't care Bit Field definition */
|
||||||
#define BITFFMT(nm,sz,fmt) {"nm", 0xffffffff, sz, NULL, "fmt"}/* Bit Field definition with Output format */
|
#define BITFFMT(nm,sz,fmt) {"nm", 0xffffffff, sz, NULL, "fmt"}/* Bit Field definition with Output format */
|
||||||
#define BITFNAM(nm,sz,names) {"nm", 0xffffffff, sz, names} /* Bit Field definition with value->name map */
|
#define BITFNAM(nm,sz,names) {"nm", 0xffffffff, sz, names,NULL} /* Bit Field definition with value->name map */
|
||||||
#endif
|
#endif
|
||||||
#define ENDBITS {NULL} /* end of bitfield list */
|
#define ENDBITS {NULL} /* end of bitfield list */
|
||||||
|
|
||||||
|
|
15
sim_disk.c
15
sim_disk.c
|
@ -217,7 +217,7 @@ static void _disk_completion_dispatch (UNIT *uptr)
|
||||||
struct disk_context *ctx = (struct disk_context *)uptr->disk_ctx;
|
struct disk_context *ctx = (struct disk_context *)uptr->disk_ctx;
|
||||||
DISK_PCALLBACK callback = ctx->callback;
|
DISK_PCALLBACK callback = ctx->callback;
|
||||||
|
|
||||||
sim_debug_unit (ctx->dbit, uptr, "_disk_completion_dispatch(unit=%d, dop=%d, callback=%p)\n", (int)(uptr-ctx->dptr->units), ctx->io_dop, ctx->callback);
|
sim_debug_unit (ctx->dbit, uptr, "_disk_completion_dispatch(unit=%d, dop=%d, callback=%p)\n", (int)(uptr-ctx->dptr->units), ctx->io_dop, (void *)(ctx->callback));
|
||||||
|
|
||||||
if (ctx->io_dop != DOP_DONE)
|
if (ctx->io_dop != DOP_DONE)
|
||||||
abort(); /* horribly wrong, stop */
|
abort(); /* horribly wrong, stop */
|
||||||
|
@ -302,7 +302,7 @@ static struct sim_disk_fmt fmts[] = {
|
||||||
{ "SIMH", 0, DKUF_F_STD, NULL},
|
{ "SIMH", 0, DKUF_F_STD, NULL},
|
||||||
{ "RAW", 0, DKUF_F_RAW, sim_os_disk_implemented_raw},
|
{ "RAW", 0, DKUF_F_RAW, sim_os_disk_implemented_raw},
|
||||||
{ "VHD", 0, DKUF_F_VHD, sim_vhd_disk_implemented},
|
{ "VHD", 0, DKUF_F_VHD, sim_vhd_disk_implemented},
|
||||||
{ NULL, 0, 0}
|
{ NULL, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Set disk format */
|
/* Set disk format */
|
||||||
|
@ -1096,7 +1096,6 @@ static uint16
|
||||||
ODSChecksum (void *Buffer, uint16 WordCount)
|
ODSChecksum (void *Buffer, uint16 WordCount)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
uint16 Sum = 0;
|
|
||||||
uint16 CheckSum = 0;
|
uint16 CheckSum = 0;
|
||||||
uint16 *Buf = (uint16 *)Buffer;
|
uint16 *Buf = (uint16 *)Buffer;
|
||||||
|
|
||||||
|
@ -2106,7 +2105,7 @@ for (i = 0; (stat == SCPE_OK) && (i < sec) && (i < 10); i++, da += wds)
|
||||||
stat = SCPE_IOERR;
|
stat = SCPE_IOERR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (wds != sim_fwrite (buf, sizeof (uint16), wds, uptr->fileref))
|
if ((size_t)wds != sim_fwrite (buf, sizeof (uint16), wds, uptr->fileref))
|
||||||
stat = SCPE_IOERR;
|
stat = SCPE_IOERR;
|
||||||
}
|
}
|
||||||
free (buf);
|
free (buf);
|
||||||
|
@ -3883,10 +3882,10 @@ void *handle;
|
||||||
handle = dlopen("libuuid." S__STR(HAVE_DLOPEN), RTLD_NOW|RTLD_GLOBAL);
|
handle = dlopen("libuuid." S__STR(HAVE_DLOPEN), RTLD_NOW|RTLD_GLOBAL);
|
||||||
if (handle)
|
if (handle)
|
||||||
uuid_generate_c = (void (*)(void *))((size_t)dlsym(handle, "uuid_generate"));
|
uuid_generate_c = (void (*)(void *))((size_t)dlsym(handle, "uuid_generate"));
|
||||||
if (uuid_generate_c)
|
if (uuid_generate_c)
|
||||||
uuid_generate_c(uuidaddr);
|
uuid_generate_c(uuidaddr);
|
||||||
else
|
else
|
||||||
_rand_uuid_gen (uuidaddr);
|
_rand_uuid_gen (uuidaddr);
|
||||||
if (handle)
|
if (handle)
|
||||||
dlclose(handle);
|
dlclose(handle);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1122,14 +1122,6 @@ static void load_function(const char* function, _func* func_ptr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void try_load_function(const char* function, _func* func_ptr) {
|
|
||||||
#ifdef _WIN32
|
|
||||||
*func_ptr = (_func)((size_t)GetProcAddress(hLib, function));
|
|
||||||
#else
|
|
||||||
*func_ptr = (_func)((size_t)dlsym(hLib, function));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* load wpcap.dll as required */
|
/* load wpcap.dll as required */
|
||||||
int load_pcap(void) {
|
int load_pcap(void) {
|
||||||
switch(lib_loaded) {
|
switch(lib_loaded) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue