OSDN Git Service

[BUILD][VM][FM7] Reduce warnings when building with "-Wall".
authorK.Ohta <whatisthis.sowhat@gmail.com>
Thu, 2 Feb 2017 11:38:19 +0000 (20:38 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Thu, 2 Feb 2017 11:38:19 +0000 (20:38 +0900)
source/src/qt/machines/fm7/MainWindow.cpp
source/src/vm/fm7/display.cpp
source/src/vm/fm7/fm7.cpp
source/src/vm/fm7/joystick.cpp
source/src/vm/fm7/vram.cpp

index 0f5a37b..25f0fa9 100644 (file)
@@ -352,7 +352,7 @@ void META_MainWindow::setupUI_Emu(void)
                actionFrameSkip[i]->fm7_binds->setValue1(i);
                actionGroup_FrameSkip->addAction(actionFrameSkip[i]);
                menuFrameSkip->addAction(actionFrameSkip[i]);
-               if(i == skip) actionFrameSkip[i]->setChecked(true);
+               if((uint32_t)i == skip) actionFrameSkip[i]->setChecked(true);
                connect(actionFrameSkip[i], SIGNAL(triggered()), actionFrameSkip[i], SLOT(do_set_frameskip()));
        }
        menuMachine->addAction(menuFrameSkip->menuAction());
index 55ad65c..b68525f 100644 (file)
@@ -173,7 +173,6 @@ void DISPLAY::reset_cpuonly()
 void DISPLAY::reset()
 {
        int i;
-       
        memset(io_w_latch, 0xff, sizeof(io_w_latch));
        halt_flag = false;
        vram_accessflag = true;
@@ -1683,10 +1682,11 @@ void DISPLAY::write_dma_data8(uint32_t addr, uint32_t data)
                if(display_mode == DISPLAY_MODE_8_400L) {
                        color = vram_bank & 0x03;
                        if(color > 2) color = 0;
-               } else {
+               } else
+# endif
+               {
                        color = (addr >> 14) & 0x03;
                }
-# endif
 #if !defined(_FM8)             
                if((multimode_accessmask & (1 << color)) != 0) return;
 #endif         
@@ -1895,10 +1895,11 @@ uint32_t DISPLAY::read_dma_data8(uint32_t addr)
                if(display_mode == DISPLAY_MODE_8_400L) {
                        color = vram_bank & 0x03;
                        if(color > 2) color = 0;
-               } else {
+               } else
+# endif
+               {
                        color = (addr >> 14) & 0x03;
                }
-# endif
 # if !defined(_FM8)            
                if((multimode_accessmask & (1 << color)) != 0) return 0xff;
 # endif                
index ded9635..adf1097 100644 (file)
@@ -461,9 +461,6 @@ void VM::connect_bus(void)
 
 void VM::update_config()
 {
-       uint32_t vol1, vol2, tmpv;
-       int ii, i_limit;
-
        for(DEVICE* device = first_device; device; device = device->next_device) {
                device->update_config();
        }
@@ -872,7 +869,6 @@ void VM::save_state(FILEIO* state_fio)
 bool VM::load_state(FILEIO* state_fio)
 {
        uint32_t version = state_fio->FgetUint32_BE();
-       int i = 1;
        if(version != STATE_VERSION) {
                return false;
        }
index 63dd108..e22ebc3 100644 (file)
@@ -43,7 +43,6 @@ void JOYSTICK::initialize()
 
 void JOYSTICK::reset()
 {
-       int i;
        joydata[0] = joydata[1] = 0xff;
        lpt_type = config.printer_device_type;
 #if !defined(_FM8)
@@ -260,9 +259,8 @@ void JOYSTICK::write_signal(int id, uint32_t data, uint32_t mask)
 
 void JOYSTICK::update_config(void)
 {
-       int i;
 #if !defined(_FM8)
-       if(mouse_type == config.device_type) return;
+       if(mouse_type == (uint32_t)config.device_type) return;
        mouse_type = config.device_type;
        switch(mouse_type & 0x03){
        case 1:
@@ -318,7 +316,7 @@ void JOYSTICK::save_state(FILEIO *state_fio)
 bool JOYSTICK::load_state(FILEIO *state_fio)
 {
        uint32_t version = state_fio->FgetUint32_BE();
-       uint32_t devid = state_fio->FgetInt32_BE();
+       int32_t devid = state_fio->FgetInt32_BE();
        bool stat = false;
        int ch;
        this->out_debug_log("Load State: JOYSTICK: id=%d ver=%d\n", devid, version);
index 54a84c5..0b5a2be 100644 (file)
@@ -54,8 +54,7 @@ void DISPLAY::write_vram_l4_400l(uint32_t addr, uint32_t offset, uint32_t data)
 void DISPLAY::GETVRAM_8_200L(int yoff, scrntype_t *p, uint32_t mask,
                                                                        bool window_inv = false)
 {
-       register uint8_t b, r, g;
-       register uint32_t dot;
+       uint8_t b, r, g;
        uint32_t yoff_d;
 #if defined(_FM77AV40EX) || defined(_FM77AV40SX)
        int dpage = vram_display_block;
@@ -96,6 +95,7 @@ void DISPLAY::GETVRAM_8_200L(int yoff, scrntype_t *p, uint32_t mask,
                p[i] = dpalette_pixel[tmp_d[i]];
        }
 #else  
+       uint32_t dot;
        dot = ((g & 0x80) >> 5) | ((r & 0x80) >> 6) | ((b & 0x80) >> 7);
        p[0] = dpalette_pixel[dot];
        dot = ((g & 0x40) >> 4) | ((r & 0x40) >> 5) | ((b & 0x40) >> 6);
@@ -120,8 +120,8 @@ void DISPLAY::GETVRAM_8_200L(int yoff, scrntype_t *p, uint32_t mask,
 void DISPLAY::GETVRAM_8_400L(int yoff, scrntype_t *p, uint32_t mask,
                                                         bool window_inv = false)
 {
-       register uint8_t b, r, g;
-       register uint32_t dot;
+       uint8_t b, r, g;
+       uint32_t dot;
        uint32_t yoff_d;
 # if defined(_FM77AV40EX) || defined(_FM77AV40SX)
        int dpage = vram_display_block;
@@ -179,11 +179,11 @@ void DISPLAY::GETVRAM_8_400L(int yoff, scrntype_t *p, uint32_t mask,
 
 void DISPLAY::GETVRAM_256k(int yoff, scrntype_t *p, uint32_t mask)
 {
-       register uint32_t b3, r3, g3;
-       register uint32_t b4, r4, g4;
-       register uint32_t btmp, rtmp, gtmp;
+       uint32_t b3, r3, g3;
+       uint32_t b4, r4, g4;
+       uint32_t btmp, rtmp, gtmp;
        
-       register scrntype_t b, r, g;
+       scrntype_t b, r, g;
        scrntype_t pixel;
        uint32_t _bit;
        int _shift;
@@ -537,8 +537,8 @@ void DISPLAY::draw_screen2()
        int y;
        int x;
        scrntype_t *p, *pp;
-       register int yoff;
-       register uint32_t rgbmask;
+       int yoff;
+       uint32_t rgbmask;
        uint32_t yoff_d1, yoff_d2;
        uint16_t wx_begin, wx_end, wy_low, wy_high;
        
@@ -560,7 +560,7 @@ void DISPLAY::draw_screen2()
        frame_skip_count++;
 #if defined(_FM77AV_VARIANTS)
        {
-               int factor = (config.dipswitch & FM7_DIPSW_FRAMESKIP) >> 28;
+               uint32_t factor = (config.dipswitch & FM7_DIPSW_FRAMESKIP) >> 28;
                if(frame_skip_count < factor) return;
                frame_skip_count = 0;
        }
@@ -568,7 +568,7 @@ void DISPLAY::draw_screen2()
        yoff_d1 = 0;
 #else
        {
-               int factor = (config.dipswitch & FM7_DIPSW_FRAMESKIP) >> 28;
+               uint32_t factor = (config.dipswitch & FM7_DIPSW_FRAMESKIP) >> 28;
                if((frame_skip_count < factor) || !(vram_wrote_shadow)) return;
                frame_skip_count = 0;
        }