]> git.sesse.net Git - nageru/commitdiff
Fix some GCC warnings.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 18 Dec 2018 23:34:14 +0000 (00:34 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 18 Dec 2018 23:34:14 +0000 (00:34 +0100)
futatabi/clip_list.cpp
futatabi/clip_list.h
futatabi/mainwindow.cpp

index b456c75ca77ee4ee2a3beb029b6b62d5ada8275b..c586b1a93dcd719db43e79221a24324d1fd74533 100644 (file)
@@ -220,7 +220,7 @@ QVariant ClipList::headerData(int section, Qt::Orientation orientation, int role
        case Column::DURATION:
                return "Duration";
        default:
-               if (section >= int(Column::CAMERA_1) && section < int(Column::CAMERA_1) + num_cameras) {
+               if (is_camera_column(section)) {
                        return QString::fromStdString("Camera " + to_string(section - int(Column::CAMERA_1) + 1));
                } else {
                        return "";
@@ -329,7 +329,7 @@ bool PlayList::setData(const QModelIndex &index, const QVariant &value, int role
        case Column::CAMERA: {
                bool ok;
                int camera_idx = value.toInt(&ok);
-               if (!ok || camera_idx < 1 || camera_idx > num_cameras) {
+               if (!ok || camera_idx < 1 || camera_idx > int(num_cameras)) {
                        return false;
                }
                clips[row].stream_idx = camera_idx - 1;
index 0768c76cdbc1acdb67c37032eddefd331dd2b358..a42720b0d49be1c6b20c153f81b37ac13a09ee44 100644 (file)
@@ -84,7 +84,7 @@ public:
 
        bool is_camera_column(int column) const
        {
-               return (column >= int(Column::CAMERA_1) && column < int(Column::CAMERA_1) + num_cameras);
+               return (column >= int(Column::CAMERA_1) && column < int(Column::CAMERA_1) + int(num_cameras));
        }
 
 signals:
index 8982b5f369142d0c21c32017fc8554af1358dbe9..212c5c4d7733b0b3b04766580e374f7e5e857aee 100644 (file)
@@ -1012,7 +1012,7 @@ void MainWindow::quality_toggled(int quality, bool checked)
 void MainWindow::highlight_camera_input(int stream_idx)
 {
        for (unsigned i = 0; i < num_cameras; ++i) {
-               if (stream_idx == i) {
+               if (unsigned(stream_idx) == i) {
                        displays[i].frame->setStyleSheet("background: rgb(0,255,0)");
                } else {
                        displays[i].frame->setStyleSheet("");