mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
fixes for gcc warnings wrt 64 bit platforms
This commit is contained in:
parent
30969671e5
commit
2170797544
4 changed files with 12 additions and 8 deletions
|
@ -1537,7 +1537,7 @@ static int emith_cond_check(int cond, int *r)
|
||||||
#define emith_abijump_reg_c(cond, r) \
|
#define emith_abijump_reg_c(cond, r) \
|
||||||
emith_abijump_reg(r)
|
emith_abijump_reg(r)
|
||||||
#define emith_abicall(target) do { \
|
#define emith_abicall(target) do { \
|
||||||
emith_move_r_imm(CR, target); \
|
emith_move_r_ptr_imm(CR, target); \
|
||||||
emith_branch(MIPS_JALR(LR, CR)); \
|
emith_branch(MIPS_JALR(LR, CR)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define emith_abicall_cond(cond, target) \
|
#define emith_abicall_cond(cond, target) \
|
||||||
|
|
|
@ -205,7 +205,8 @@ static int write_chunk(chunk_name_e name, int len, void *data, void *file)
|
||||||
|
|
||||||
#define CHECKED_WRITE(name,len,data) { \
|
#define CHECKED_WRITE(name,len,data) { \
|
||||||
if (PicoStateProgressCB && name < CHUNK_DEFAULT_COUNT && chunk_names[name]) { \
|
if (PicoStateProgressCB && name < CHUNK_DEFAULT_COUNT && chunk_names[name]) { \
|
||||||
strncpy(sbuff + 9, chunk_names[name], sizeof(sbuff) - 9); \
|
strncpy(sbuff + 9, chunk_names[name], sizeof(sbuff)-1 - 9); \
|
||||||
|
sbuff[sizeof(sbuff)-1] = '\0'; \
|
||||||
PicoStateProgressCB(sbuff); \
|
PicoStateProgressCB(sbuff); \
|
||||||
} \
|
} \
|
||||||
if (data == buf2 && len > CHUNK_LIMIT_W) \
|
if (data == buf2 && len > CHUNK_LIMIT_W) \
|
||||||
|
@ -216,7 +217,8 @@ static int write_chunk(chunk_name_e name, int len, void *data, void *file)
|
||||||
|
|
||||||
#define CHECKED_WRITE_BUFF(name,buff) { \
|
#define CHECKED_WRITE_BUFF(name,buff) { \
|
||||||
if (PicoStateProgressCB && name < CHUNK_DEFAULT_COUNT && chunk_names[name]) { \
|
if (PicoStateProgressCB && name < CHUNK_DEFAULT_COUNT && chunk_names[name]) { \
|
||||||
strncpy(sbuff + 9, chunk_names[name], sizeof(sbuff) - 9); \
|
strncpy(sbuff + 9, chunk_names[name], sizeof(sbuff)-1 - 9); \
|
||||||
|
sbuff[sizeof(sbuff)-1] = '\0'; \
|
||||||
PicoStateProgressCB(sbuff); \
|
PicoStateProgressCB(sbuff); \
|
||||||
} \
|
} \
|
||||||
if (!write_chunk(name, sizeof(buff), &buff, file)) \
|
if (!write_chunk(name, sizeof(buff), &buff, file)) \
|
||||||
|
|
|
@ -124,13 +124,15 @@ int config_write(const char *fname)
|
||||||
const char **names = (const char **)me->data;
|
const char **names = (const char **)me->data;
|
||||||
for (t = 0; names[t] != NULL; t++) {
|
for (t = 0; names[t] != NULL; t++) {
|
||||||
if (*(int *)me->var == t) {
|
if (*(int *)me->var == t) {
|
||||||
strncpy(line, names[t], sizeof(line));
|
strncpy(line, names[t], sizeof(line)-1);
|
||||||
|
line[sizeof(line)-1] = '\0';
|
||||||
goto write_line;
|
goto write_line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (me->generate_name != NULL) {
|
else if (me->generate_name != NULL) {
|
||||||
strncpy(line, me->generate_name(0, &dummy), sizeof(line));
|
strncpy(line, me->generate_name(0, &dummy), sizeof(line)-1);
|
||||||
|
line[sizeof(line)-1] = '\0';
|
||||||
goto write_line;
|
goto write_line;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -238,9 +240,9 @@ int config_readlrom(const char *fname)
|
||||||
tmp++;
|
tmp++;
|
||||||
mystrip(tmp);
|
mystrip(tmp);
|
||||||
|
|
||||||
len = sizeof(rom_fname_loaded);
|
len = sizeof(rom_fname_loaded)-1;
|
||||||
strncpy(rom_fname_loaded, tmp, len);
|
strncpy(rom_fname_loaded, tmp, len);
|
||||||
rom_fname_loaded[len-1] = 0;
|
rom_fname_loaded[len] = 0;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ void host_dasm(void *addr, int len)
|
||||||
|
|
||||||
insn = *(unsigned long *)addr;
|
insn = *(unsigned long *)addr;
|
||||||
printf(" %08lx %08lx ", (long)addr, insn);
|
printf(" %08lx %08lx ", (long)addr, insn);
|
||||||
if(disasm((unsigned)addr, insn, buf, sizeof(buf), &symaddr))
|
if(disasm((uintptr_t)addr, insn, buf, sizeof(buf), &symaddr))
|
||||||
{
|
{
|
||||||
if (symaddr)
|
if (symaddr)
|
||||||
name = lookup_name((void *)symaddr);
|
name = lookup_name((void *)symaddr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue