]> git.sesse.net Git - pistorm/commitdiff
Silence some compile warnings
authorshanshe <shanshe@gmail.com>
Tue, 13 Apr 2021 07:24:32 +0000 (09:24 +0200)
committershanshe <shanshe@gmail.com>
Tue, 13 Apr 2021 07:28:50 +0000 (09:28 +0200)
13 files changed:
config_file/config_file.c
config_file/config_file.h
emulator.c
input/input.c
m68kconf.h
m68kdasm.c
memory_mapped.c
platforms/amiga/Gayle.c
platforms/amiga/amiga-platform.c
platforms/amiga/gayle-ide/ide.c
platforms/amiga/net/pi-net.c
platforms/amiga/rtg/rtg-gfx.c
platforms/amiga/rtg/rtg.c

index 1c8ef09acc72ab1814baf7255140aba043ee200f..2436ffd492cf54fbe1ef3f666096ece63e8d1a24 100644 (file)
@@ -287,7 +287,7 @@ struct emulator_config *load_config_file(char *filename) {
         break;
       case CONFITEM_MAP: {
         unsigned int maptype = 0, mapsize = 0, mapaddr = 0;
-        int mirraddr = -1;
+        unsigned int mirraddr = ((unsigned int)-1);
         char mapfile[128], mapid[128];
         memset(mapfile, 0x00, 128);
         memset(mapid, 0x00, 128);
index 37cb0ce80242149d69557491051d9f75f9c7ea0e..b9fe43876fb2a2eb03224e07b0c6b77ce5a64233 100644 (file)
@@ -55,12 +55,12 @@ struct emulator_config {
   unsigned int cpu_type;
 
   unsigned char map_type[MAX_NUM_MAPPED_ITEMS];
-  long map_offset[MAX_NUM_MAPPED_ITEMS];
-  long map_high[MAX_NUM_MAPPED_ITEMS];
+  unsigned long map_offset[MAX_NUM_MAPPED_ITEMS];
+  unsigned long map_high[MAX_NUM_MAPPED_ITEMS];
   unsigned int map_size[MAX_NUM_MAPPED_ITEMS];
   unsigned int rom_size[MAX_NUM_MAPPED_ITEMS];
   unsigned char *map_data[MAX_NUM_MAPPED_ITEMS];
-  int map_mirror[MAX_NUM_MAPPED_ITEMS];
+  unsigned int map_mirror[MAX_NUM_MAPPED_ITEMS];
   char *map_id[MAX_NUM_MAPPED_ITEMS];
 
   struct platform_config *platform;
index 167e0141cfc56d8fda426489c6d7b36b3765a8d7..1cf79f3f899b4283a5bdd5818ff091db173ff8fc 100644 (file)
@@ -230,7 +230,7 @@ cpu_loop:
   }
   goto cpu_loop;
 
-stop_cpu_emulation:
+//stop_cpu_emulation:
   printf("[CPU] End of CPU thread\n");
 }
 
@@ -332,6 +332,7 @@ key_loop:
 
 key_end:
   printf("[KBD] Keyboard thread ending\n");
+  return (void*)NULL;
 }
 
 void stop_cpu_emulation(uint8_t disasm_cur) {
index bb5a725c30da38993613ec3ad812232895947e4e..bc596073676bfb6060d1b25266b13ec9ba4334aa 100644 (file)
@@ -11,7 +11,7 @@
 
 #define NONE 0x80
 
-static int lshift = 0, rshift = 0, lctrl = 0, rctrl = 0, lalt = 0, altgr = 0;
+static int lshift = 0, rshift = 0,/* lctrl = 0, rctrl = 0,*/ lalt = 0, altgr = 0;
 extern int mouse_fd;
 extern int keyboard_fd;
 
index 0e3557587baed975b13d56dd2c10fe55d1dc2d92..4122af09d347dda85eac130f99fbbc9c19759f8c 100644 (file)
 
 /* ======================================================================== */
 /* ============================== END OF FILE ============================= */
-/* =======================================x================================= */
+/* ======================================================================== */
 
 #endif /* M68KCONF__HEADER */
index fbbde31c0e60aee6669cbe9414058ff2530e9f70..68d025a5073929325c67d036632d3671324ab2a0 100644 (file)
@@ -404,7 +404,7 @@ static char* make_signed_hex_str_32(uint val)
 /* make string of immediate value */
 static char* get_imm_str_s(uint size)
 {
-       static char str[15];
+       static char str[25];
        if(size == 0)
                sprintf(str, "#%s", make_signed_hex_str_8(read_imm_8()));
        else if(size == 1)
@@ -416,7 +416,7 @@ static char* get_imm_str_s(uint size)
 
 static char* get_imm_str_u(uint size)
 {
-       static char str[15];
+       static char str[25];
        if(size == 0)
                sprintf(str, "#$%x", read_imm_8() & 0xff);
        else if(size == 1)
@@ -3773,7 +3773,7 @@ unsigned int m68k_disassemble(char* str_buff, unsigned int pc, unsigned int cpu_
 
 char* m68ki_disassemble_quick(unsigned int pc, unsigned int cpu_type)
 {
-       static char buff[100];
+       static char buff[1000];
        buff[0] = 0;
        m68k_disassemble(buff, pc, cpu_type);
        return buff;
index 3764631f2c9d8bbf6cd81c6b4df1e2d0bb9efe4c..95b2cc85299c75d41a4f1307ab551255a5b010c2 100644 (file)
@@ -24,7 +24,7 @@ inline int handle_mapped_read(struct emulator_config *cfg, unsigned int addr, un
     if (cfg->map_type[i] == MAPTYPE_NONE)
       continue;
     else if (ovl && cfg->map_type[i] == MAPTYPE_ROM) {
-      if (cfg->map_mirror[i] != -1 && CHKRANGE(addr, cfg->map_mirror[i], cfg->map_size[i])) {
+      if (cfg->map_mirror[i] != ((unsigned int)-1) && CHKRANGE(addr, cfg->map_mirror[i], cfg->map_size[i])) {
         read_addr = cfg->map_data[i] + ((addr - cfg->map_mirror[i]) % cfg->rom_size[i]);
         goto read_value;
       }
index 55da51ad6407b1297fd8692edbdfe5639fad57e2..b7c3011bd66fb1eb6c3db8dcbb5f312393c828ba 100644 (file)
@@ -165,6 +165,7 @@ void writeGayleB(unsigned int address, unsigned int value) {
           goto idewrite8;
         case GIRQ_4000_OFFSET:
           gayle_a4k_irq = value;
+        /* Fallthrough */
         case GIRQ_OFFSET:
           gayle_irq = (gayle_irq & value) | (value & (GAYLE_IRQ_RESET | GAYLE_IRQ_BERR));
           return;
index 1ea192f0e569a8d7759b317a150ba3eb1101ae18..a5c8c095cae8c49d867f3513ca9223d545c760e7 100644 (file)
@@ -476,7 +476,7 @@ void create_platform_amiga(struct platform_config *cfg, char *subsys) {
     if (subsys) {
         cfg->subsys = malloc(strlen(subsys) + 1);
         strcpy(cfg->subsys, subsys);
-        for (int i = 0; i < strlen(cfg->subsys); i++) {
+        for (unsigned int i = 0; i < strlen(cfg->subsys); i++) {
             cfg->subsys[i] = tolower(cfg->subsys[i]);
         }
     }
index 9263201bbeead2d9bbd11e11f48fcb5f0c4f06f7..8a70931d00950fe1f233ef565fec6676d70b7388 100644 (file)
@@ -77,7 +77,7 @@
 const uint8_t ide_magic[9] = {
   '1','D','E','D','1','5','C','0',0x00
 };
-
+/*
 static char *charmap(uint8_t v)
 {
   static char cbuf[3];
@@ -108,7 +108,7 @@ static void hexdump(uint8_t *bp)
     fprintf(stderr, "\n");
   }
 }
-
+*/
 /* FIXME: use proper endian convertors! */
 static uint16_t le16(uint16_t v)
 {
@@ -524,6 +524,7 @@ static uint16_t ide_data_in(struct ide_drive *d, int len)
 
 static void ide_data_out(struct ide_drive *d, uint16_t v, int len)
 {
+  (void)len;
   if (d->state != IDE_DATA_OUT) {
     ide_fault(d, "bad data write");
     d->taskfile.data = v;
@@ -624,6 +625,8 @@ uint8_t ide_read8(struct ide_controller *c, uint8_t r)
       return c->lba4 | ((c->selected) ? 0x10 : 0x00);
     case ide_status_r:
       d->intrq = 0;            /* Acked */
+      /* Fallthrough */
+      /* no break */
     case ide_altst_r:
       return t->status;
     default:
@@ -649,7 +652,7 @@ void ide_write8(struct ide_controller *c, uint8_t r, uint8_t v)
     }
   }
 
-  uint8_t ve;
+//  uint8_t ve;
 
   switch(r) {
     case ide_data:
@@ -876,7 +879,11 @@ static void make_ascii(uint16_t *p, const char *t, int len)
 {
   int i;
   char *d = (char *)p;
+//  strncpy(d, t, len);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
   strncpy(d, t, len);
+#pragma GCC diagnostic pop
 
   for (i = 0; i < len; i += 2) {
     char c = *d;
index f19bae1db61c9a153de523f56588d3d9ebf5d140..8eec08c86150552b37527a2676dc46c73bafc6dc 100644 (file)
@@ -18,13 +18,14 @@ static const char *op_type_names[4] = {
 
 void pinet_init(char *dev) {
     // Initialize them nets.
+    (void)dev;
 }
 
 uint8_t PI_MAC[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
 uint8_t PI_IP[4] = { 192, 168, 1, 9 };
 
 void handle_pinet_write(uint32_t addr, uint32_t val, uint8_t type) {
-    int32_t r;
+//    int32_t r;
 
     switch (addr & 0xFFFF) {
         case PINET_CMD_READ:
index 8cd177fa3845a392b0ef61c61099204f36a0c5eb..959ab164328693cc2f33ef877c2abc5c08e04db3 100644 (file)
@@ -281,7 +281,7 @@ void rtg_blittemplate(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint32_t s
         if (i != -1) {
             sptr = &cfg->map_data[i][src_addr - cfg->map_offset[i]];
             if (realtime_graphics_debug) {
-                printf("Grabbing data from maping %d - offset %.8X\nData:\n", i, src_addr - cfg->map_offset[i]);
+                printf("Grabbing data from maping %d - offset %.8lX\nData:\n", i, src_addr - cfg->map_offset[i]);
                 for (int i = 0; i < h; i++) {
                     for (int j = 0; j < t_pitch; j++) {
                         printf("%.2X", sptr[j + (i * t_pitch)]);
index a4be06952d528bd5aa9392ca16ac390ae247b5bc..78cc9fa65524ce20b923f41c5233b301b30a69fb 100644 (file)
@@ -28,11 +28,11 @@ uint32_t framebuffer_addr = 0;
 uint32_t framebuffer_addr_adj = 0;
 
 static void handle_rtg_command(uint32_t cmd);
-static struct timespec f1, f2;
+//static struct timespec f1, f2;
 
 uint8_t realtime_graphics_debug = 0;
 extern int cpu_emulation_running;
-
+/*
 static const char *op_type_names[OP_TYPE_NUM] = {
     "BYTE",
     "WORD",
@@ -46,7 +46,7 @@ static const char *rtg_format_names[RTGFMT_NUM] = {
     "32BPP RGB (RGBA)",
     "15BPP RGB (555)",
 };
-
+*/
 int init_rtg_data() {
     rtg_mem = calloc(1, 40 * SIZE_MEGA);
     if (!rtg_mem) {
@@ -57,8 +57,8 @@ int init_rtg_data() {
     return 1;
 }
 
-extern uint8_t busy, rtg_on;
-void rtg_update_screen();
+//extern uint8_t busy, rtg_on;
+//void rtg_update_screen();
 
 unsigned int rtg_read(uint32_t address, uint8_t mode) {
     //printf("%s read from RTG: %.8X\n", op_type_names[mode], address);