Fix some string conversion warnings.

This commit is contained in:
Alexei Svitkine 2017-12-02 12:21:13 -05:00
parent 1503c84266
commit b150b42fc6
16 changed files with 27 additions and 27 deletions

View File

@ -176,7 +176,7 @@ static void sigsegv_dump_state(sigsegv_info_t *sip)
#endif
VideoQuitFullScreen();
#ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
#endif
QuitEmulator();
@ -550,7 +550,7 @@ static void sigint_handler(...)
extern void m68k_dumpstate(uaecptr *nextpc);
m68k_dumpstate(&nextpc);
VideoQuitFullScreen();
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
QuitEmulator();
}

View File

@ -292,7 +292,7 @@ static void sigsegv_dump_state(sigsegv_info_t *sip)
#endif
VideoQuitFullScreen();
#ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
#endif
QuitEmulator();
@ -958,7 +958,7 @@ static void sigint_handler(...)
m68k_dumpstate(&nextpc);
#endif
VideoQuitFullScreen();
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
QuitEmulator();
}
@ -1505,7 +1505,7 @@ ill: printf("SIGILL num %d, code %d\n", sig, code);
VideoQuitFullScreen();
#ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
#endif
QuitEmulator();

View File

@ -181,7 +181,7 @@ static void sigsegv_dump_state(sigsegv_info_t *sip)
#endif
VideoQuitFullScreen();
#ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
QuitEmulator();
#endif

View File

@ -70,7 +70,7 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
r->sr);
VideoQuitFullScreen();
#ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
#endif
QuitEmulator();
@ -575,7 +575,7 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7],
r->sr);
#ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
#endif
break;
@ -592,7 +592,7 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7],
r->sr);
#ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
#endif
QuitEmulator();

View File

@ -6533,7 +6533,7 @@ void disasm_block(int target, uint8 * start, size_t length)
mon_read_byte = mon_read_byte_jit;
mon_write_byte = mon_write_byte_jit;
char *arg[5] = {"mon", "-m", "-r", disasm_str, NULL};
const char *arg[5] = {"mon", "-m", "-r", disasm_str, NULL};
mon(4, arg);
mon_read_byte = old_mon_read_byte;

View File

@ -206,7 +206,7 @@ static __inline__ void m68k_setpc (uaecptr newpc)
if (IS_BREAK_POINT(newpc)) {
printf("Stopped at break point address: %08lx. Last PC: %08lx\n", newpc, previous_pc);
m68k_dumpstate(NULL);
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
}
#endif // end of #if ENABLE_MON
@ -223,7 +223,7 @@ static __inline__ void m68k_incpc (uae_s32 delta)
if (IS_BREAK_POINT(next_pc)) {
printf("Stopped at break point address: %08lx. Last PC: %08lx\n", next_pc, previous_pc);
m68k_dumpstate(NULL);
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
}
#endif // end of #if ENABLE_MON

View File

@ -1402,7 +1402,7 @@ static void *tick_func(void *arg)
#ifdef ENABLE_MON
// Start up mon in real-mode
printf("Welcome to the sheep factory.\n");
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
#endif
return NULL;

View File

@ -212,7 +212,7 @@ static void dump(void)
// Start up mon in real-mode
#if ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
#endif
QuitEmulator();

View File

@ -83,7 +83,7 @@ static void enter_mon(void)
{
// Start up mon in real-mode
#if ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
#endif
}

View File

@ -527,7 +527,7 @@ bool powerpc_cpu::check_spcflags()
spcflags().clear(SPCFLAG_CPU_ENTER_MON);
#if ENABLE_MON
// Start up mon in real-mode
char *arg[] = {
const char *arg[] = {
"mon",
#ifdef SHEEPSHAVER
"-m",

View File

@ -67,7 +67,7 @@ void powerpc_cpu::execute_illegal(uint32 opcode)
disass_ppc(stdout, pc(), opcode);
// Start up mon in real-mode
char *arg[4] = {"mon", "-m", "-r", NULL};
const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg);
#endif
abort();

View File

@ -95,7 +95,7 @@ static void disasm_block(int target, uint8 *start, uint32 length)
target == TARGET_POWERPC ? "d" : "x",
start, start + length - 1);
char *arg[] = {"mon",
const char *arg[] = {"mon",
#ifdef SHEEPSHAVER
"-m",
#endif

View File

@ -418,7 +418,7 @@ Here's how to do it (all functions are defined in the mon.h header file):
arguments and the mon_read/write_*() functions to access memory.
5. To enter cxmon, call the mon() function like this:
char *args[3] = {"mon", "-r", NULL};
const char *args[3] = {"mon", "-r", NULL};
mon(2, args);
6. If you're done with cxmon, call mon_exit().

View File

@ -872,7 +872,7 @@ static void help_or_hunt()
}
fprintf(monout, "x Quit mon\n"
"h This help text\n");
fprintf(monout, cmd_help);
fprintf(monout, "%s", cmd_help);
}
@ -1180,7 +1180,7 @@ void mon_exit()
* Main function, read-execute loop
*/
void mon(int argc, char **argv)
void mon(int argc, const char **argv)
{
bool done = false, interactive = true;

View File

@ -31,7 +31,7 @@
void mon_init();
void mon_exit();
void mon(int argc, char **argv);
void mon(int argc, const char **argv);
// Break points prompt
const char STR_ACTIVE_BREAK_POINTS[] = "Active Break Points:\n";

View File

@ -187,7 +187,7 @@ static void disass31(FILE *f, unsigned int adr, unsigned int w);
static void disass59(FILE *f, unsigned int adr, unsigned int w);
static void disass63(FILE *f, unsigned int adr, unsigned int w);
static unsigned int mbme2mask(int mb, int me);
static char *get_spr(int reg);
static const char *get_spr(int reg);
/*
@ -279,7 +279,7 @@ void disass_ppc(FILE *f, unsigned int adr, unsigned int w)
case 16: {
int target = short(imm & 0xfffc);
char *form;
const char *form;
if (w & 1)
if (w & 2)
form = "la";
@ -817,7 +817,7 @@ static void disass31(FILE *f, unsigned int adr, unsigned int w)
else if ((ra | (rb << 5)) == 256)
fprintf(f, "mfvrsave\tr%d\n", rd);
else {
char *spr = get_spr(ra | (rb << 5));
const char *spr = get_spr(ra | (rb << 5));
if (spr)
fprintf(f, "mfspr\tr%d,%s\n", rd, spr);
else
@ -894,7 +894,7 @@ static void disass31(FILE *f, unsigned int adr, unsigned int w)
else if ((ra | (rb << 5)) == 256)
fprintf(f, "mtvrsave\tr%d\n", rd);
else {
char *spr = get_spr(ra | (rb << 5));
const char *spr = get_spr(ra | (rb << 5));
if (spr)
fprintf(f, "mtspr\t%s,r%d\n", spr, rd);
else
@ -1058,7 +1058,7 @@ static unsigned int mbme2mask(int mb, int me)
* Convert SPR number to register name
*/
char *get_spr(int reg)
const char *get_spr(int reg)
{
switch (reg) {
case 1: return "xer";