OSDN Git Service

[Build][Qt] Fix FTBFSs with llvm-clang.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 2 Mar 2016 14:35:19 +0000 (23:35 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 2 Mar 2016 14:35:19 +0000 (23:35 +0900)
source/src/debugger.cpp
source/src/qt/gui/display_statusbar.cpp
source/src/qt/gui/qt_input.cpp
source/src/vm/fm7/fm7.h
source/src/vm/fm7/fm7_mainio.cpp
source/src/vm/fm7/fm7_mainio.h

index 0359768..8f40c80 100644 (file)
@@ -810,7 +810,7 @@ int debugger_thread(void *lpx)
        _TCHAR buffer[1024];
        bool cp932 = (p->osd->get_console_code_page() == 932);
        
-       p->osd->open_console(create_string(_T("Debugger - %s"), _T(DEVICE_NAME)));
+       p->osd->open_console((_TCHAR *)create_string(_T("Debugger - %s"), _T(DEVICE_NAME)));
        p->osd->set_console_text_attribute(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
        cpu->debug_regs_info(buffer, 1024);
        my_printf(p->osd, _T("%s\n"), buffer);
@@ -875,7 +875,7 @@ int debugger_thread(void *lpx)
                }
                // process command
                if(!p->request_terminate && enter_done) {
-                       if(debugger_command(p, command, prev_command, cp932) < 0) break;
+                       if(debugger_command((debugger_thread_t *)p, command, prev_command, cp932) < 0) break;
                }
        }
    
index 454619b..70dd6ee 100644 (file)
@@ -33,12 +33,14 @@ void Ui_MainWindow::initStatusBar(void)
        //dummyStatusArea1 = new QWidget;
        QSize size1, size2, size3;
        QString tmpstr;
+       QString n_s;
+       QString tmps_n;
        //   QHBoxLayout *layout = new QHBoxLayout();
        
        //statusbar->addWidget(layout, 0);
        messagesStatusBar->setFixedWidth(400);
        statusbar->addPermanentWidget(messagesStatusBar, 0);
-       messagesStatusBar->font().setPointSize(12);
+       messagesStatusBar->setStyleSheet("font: 12pt \"Sans\";");
        dummyStatusArea1 = new QWidget;
        statusbar->addPermanentWidget(dummyStatusArea1, 1);
        
@@ -71,10 +73,13 @@ void Ui_MainWindow::initStatusBar(void)
        osd_led_data = 0x00000000;
 #endif   
 
+       tmps_n = QString::fromUtf8("font: ");
+       n_s.setNum(12);
+       tmps_n = tmps_n + n_s + QString::fromUtf8("pt \"Sans\";");
 #ifdef USE_FD1
        for(i = 0; i < MAX_FD; i++) { // Will Fix
                fd_StatusBar[i] = new QLabel;
-               fd_StatusBar[i]->font().setPointSize(12);
+               fd_StatusBar[i]->setStyleSheet(tmps_n);
                fd_StatusBar[i]->setFixedWidth((wfactor > 200) ? 200 : wfactor);
                //      fd_StatusBar[i]->setAlignment(Qt::AlignRight);
                statusbar->addPermanentWidget(fd_StatusBar[i]);
@@ -83,7 +88,7 @@ void Ui_MainWindow::initStatusBar(void)
 #ifdef USE_QD1
        for(i = 0; i < MAX_QD; i++) {
                qd_StatusBar[i] = new QLabel;
-               qd_StatusBar[i]->font().setPointSize(12);
+               qd_StatusBar[i]->setStyleSheet(tmps_n);
                qd_StatusBar[i]->setFixedWidth((wfactor > 150) ? 150 : wfactor);
                //     qd_StatusBar[i]->setAlignment(Qt::AlignRight);
                statusbar->addPermanentWidget(qd_StatusBar[i]);
@@ -92,7 +97,7 @@ void Ui_MainWindow::initStatusBar(void)
 #ifdef USE_TAPE
        cmt_StatusBar = new QLabel;
        cmt_StatusBar->setFixedWidth(100);
-       cmt_StatusBar->font().setPointSize(12);
+       cmt_StatusBar->setStyleSheet(tmps_n);;
        statusbar->addPermanentWidget(cmt_StatusBar);
 #endif
        dummyStatusArea2 = new QWidget;
@@ -106,11 +111,11 @@ void Ui_MainWindow::initStatusBar(void)
        
        led_gScene = new QGraphicsScene(0.0f, 0.0f, (float)dummyStatusArea2->width(), (float)dummyStatusArea2->height());
        QPen pen;
-       QBrush bbrush(QColor(Qt::black));
+       QBrush bbrush = QBrush(QColor(Qt::black));
        led_graphicsView->setBackgroundBrush(bbrush);
        connect(this, SIGNAL(sig_led_update(QRectF)), led_graphicsView, SLOT(updateSceneRect(QRectF)));
        {
-               QBrush rbrush(QColor(Qt::red));
+               QBrush rbrush = QBrush(QColor(Qt::red));
                float bitwidth = (float)dummyStatusArea2->width() / ((float)USE_LED_DEVICE * 2.0);
                float start = -(float)dummyStatusArea2->width()  / 2.0f + bitwidth * 3.0f;
 
@@ -152,6 +157,8 @@ void Ui_MainWindow::resize_statusbar(int w, int h)
        int i;
        int qd_width, fd_width;
        int sfactor = 0;;
+       QString n_s;
+       QString tmps;
 
        nowSize = messagesStatusBar->size();
        height = (double)(nowSize.height());
@@ -163,7 +170,11 @@ void Ui_MainWindow::resize_statusbar(int w, int h)
        if(pt < 4) pt = 4;
        sfactor = (int)(400.0 * scaleFactor);
        messagesStatusBar->setFixedWidth((int)(400.0 * scaleFactor));
-       messagesStatusBar->font().setPointSize(pt);
+       
+       tmps = QString::fromUtf8("font: ");
+       n_s.setNum(pt);
+       tmps = tmps + n_s + QString::fromUtf8("pt \"Sans\";");
+       messagesStatusBar->setStyleSheet(tmps);
    
 #if defined(USE_FD1) && defined(USE_QD1) && defined(USE_TAPE)
        wfactor = (1280 - 400 - 100 - 100) / (MAX_FD + MAX_QD);
@@ -190,7 +201,7 @@ void Ui_MainWindow::resize_statusbar(int w, int h)
 #ifdef USE_FD1
        ww = (int)(scaleFactor * (double)fd_width);
        for(i = 0; i < MAX_FD; i++) { // Will Fix
-               fd_StatusBar[i]->font().setPointSize(pt);
+               fd_StatusBar[i]->setStyleSheet(tmps);
                fd_StatusBar[i]->setFixedWidth(ww);
                sfactor += ww;
        }
@@ -198,14 +209,14 @@ void Ui_MainWindow::resize_statusbar(int w, int h)
 #ifdef USE_QD1
        ww = (int)(scaleFactor * (double)fd_width);
        for(i = 0; i < MAX_QD; i++) { // Will Fix
-               qd_StatusBar[i]->font().setPointSize(pt);
+               qd_StatusBar[i]->setStyleSheet(tmps);
                qd_StatusBar[i]->setFixedWidth(ww);
                sfactor += ww;
        }
 #endif
 #ifdef USE_TAPE
        cmt_StatusBar->setFixedWidth((int)(100.0 * scaleFactor));
-       cmt_StatusBar->font().setPointSize(pt);
+       cmt_StatusBar->setStyleSheet(tmps);
        sfactor += (int)(100.0 * scaleFactor);
 #endif
 #ifdef USE_LED_DEVICE
@@ -224,8 +235,8 @@ void Ui_MainWindow::resize_statusbar(int w, int h)
 #ifdef USE_LED_DEVICE
        {
                QPen pen;
-               QBrush rbrush(QColor(Qt::red));
-               QBrush bbrush(QColor(Qt::black));
+               QBrush rbrush = QBrush(QColor(Qt::red));
+               QBrush bbrush = QBrush(QColor(Qt::black));
                float bitwidth = (float)dummyStatusArea2->width() / ((float)USE_LED_DEVICE * 2.0);
                float start = -(float)dummyStatusArea2->width()  / 2.0f + bitwidth * 3.0f;
 
index 8466072..640c94f 100644 (file)
@@ -343,7 +343,7 @@ int GLDrawClass::get_key_table_size(void)
        if(key_table) {
                return key_table->get_key_table_size();
        }
-       return NULL;
+       return 0;
 }
 
 
@@ -357,15 +357,17 @@ void GLDrawClass::do_update_keyboard_scan_code(uint32_t vk, uint32_t scan)
 uint32_t GLDrawClass::get_vk_from_index(int index)
 {
        if(key_table) {
-               key_table->get_vk_from_index(index);
+               return key_table->get_vk_from_index(index);
        }
+       return 0;
 }
 
 uint32_t GLDrawClass::get_scan_from_index(int index)
 {
        if(key_table) {
-               key_table->get_scan_from_index(index);
+               return key_table->get_scan_from_index(index);
        }
+       return 0;
 }
 
 const char *GLDrawClass::get_key_vk_name(int index)
index 2d9d242..895d3dc 100644 (file)
 #define DIPSWITCH_DEFAULT 0x8000000d 
 
 #endif
-#define DIPSWITCH_DEFAULT 0x8000000d 
 
 #if defined(_FM8)
 #define USE_SOUND_DEVICE_TYPE   2
 #define HAS_CYCLESTEAL
 #define CAPABLE_Z80
 #endif
-#define DIPSWITCH_DEFAULT 0x8000000d 
 
 #if defined(_FM77_VARIANTS)
 #define USE_BOOT_MODE         4
index 9f75a33..1c28d2d 100644 (file)
@@ -333,15 +333,15 @@ uint8_t FM7_MAINIO::get_port_fd00(void)
   
 void FM7_MAINIO::set_port_fd00(uint8_t data)
 {
-       drec->write_signal(SIG_DATAREC_MIC, data, 0x01);
-          drec->set_remote(((data & 0x02) != 0));
-          lpt_slctin = ((data & 0x80) == 0);
-          lpt_strobe = ((data & 0x40) != 0);
-          this->write_signals(&printer_strobe_bus, lpt_strobe ? 0xffffffff : 0);
-          this->write_signals(&printer_select_bus, lpt_slctin ? 0xffffffff : 0);
-          if((lpt_type == 0) && (lpt_slctin)) {
-                  printer->write_signal(SIG_PRINTER_STROBE, lpt_strobe ? 0xff : 0x00, 0xff);
-          }
+       drec->write_signal(SIG_DATAREC_MIC, data, 0x01);
+       drec->set_remote(((data & 0x02) != 0));
+       lpt_slctin = ((data & 0x80) == 0);
+       lpt_strobe = ((data & 0x40) != 0);
+       this->write_signals(&printer_strobe_bus, lpt_strobe ? 0xffffffff : 0);
+       this->write_signals(&printer_select_bus, lpt_slctin ? 0xffffffff : 0);
+       if((lpt_type == 0) && (lpt_slctin)) {
+               printer->write_signal(SIG_PRINTER_STROBE, lpt_strobe ? 0xff : 0x00, 0xff);
+       }
 }
    
 uint8_t FM7_MAINIO::get_port_fd02(void)
index c60dfcb..3633563 100644 (file)
@@ -15,6 +15,7 @@
 #include "../mc6809.h"
 #include "../z80.h"
 #include "../ym2203.h"
+#include "../datarec.h"
 
 #include "fm7_common.h"
 #include "./joystick.h"
@@ -338,7 +339,7 @@ class FM7_MAINIO : public DEVICE {
 #else  
        YM2203* opn[4]; // 0=OPN 1=WHG 2=THG 3=PSG
 #endif
-       DEVICE* drec;
+       DATAREC* drec;
        DEVICE* pcm1bit;
        DEVICE* joystick;
        
@@ -412,7 +413,7 @@ class FM7_MAINIO : public DEVICE {
                pcm1bit = p;
                //beep = p;
        }
-       void set_context_datarec(DEVICE *p)
+       void set_context_datarec(DATAREC *p)
        {
                drec = p;
        }