Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Setsugennoao committed Nov 2, 2023
1 parent 9e39554 commit 4f50a26
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/shared/WobblyProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ std::array<int32_t, 3> WobblyProject::getMMetrics(int frame) const {
if (frame < 0 || frame >= getNumFrames(PostSource))
throw WobblyException("Can't get the mmetrics for frame " + std::to_string(frame) + ": frame number out of range.");

if (mmetrics.size() && frame < mmetrics.size() - 1)
if (mmetrics.size() && frame < (int)mmetrics.size() - 1)
return { mmetrics[frame][0], mmetrics[frame][1], mmetrics[frame + 1][0] };
if (mmetrics.size())
return { mmetrics[frame][0], mmetrics[frame][1], mmetrics[frame][1] };
Expand All @@ -1750,7 +1750,7 @@ std::array<int32_t, 3>WobblyProject::getVMetrics(int frame) const {
if (frame < 0 || frame >= getNumFrames(PostSource))
throw WobblyException("Can't get the vmetrics for frame " + std::to_string(frame) + ": frame number out of range.");

if (vmetrics.size() && frame < vmetrics.size() - 1)
if (vmetrics.size() && frame < (int)vmetrics.size() - 1)
return { vmetrics[frame][0], vmetrics[frame][1], vmetrics[frame + 1][0] };
if (vmetrics.size())
return { vmetrics[frame][0], vmetrics[frame][1], vmetrics[frame][1] };
Expand Down
10 changes: 8 additions & 2 deletions src/shared/WobblyProject.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,34 @@ SOFTWARE.
static inline uint8_t matchCharToIndex(char match) {
if (match == 'p')
return 0;

if (match == 'c')
return 1;

if (match == 'n')
return 2;

if (match == 'b')
return 3;

if (match == 'u')
return 4;

return 255;
return 0; // never reaches this
}


static inline uint8_t matchCharToIndexDMetrics(char match) {
if (match == 'c')
return 1;

if (match == 'n')
return 2;

if (match == 'b')
return 0;

return 255;
return 0; // never reaches this
}

struct UndoStep {
Expand Down
13 changes: 7 additions & 6 deletions src/shared/WobblyShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ struct PluginDetectionInfo {

static PluginDetectionInfo requiredPlugins[] = {
{"VIVTC", "org.ivtc.v", "VFM", "VDecimate"},
{"DMetrics", "com.vapoursynth.dmetrics", "DMetrics"},
{"SCXVID", "com.nodame.scxvid", "Scxvid"},
{"FieldHint", "com.nodame.fieldhint", "FieldHint"},
{"TDeintMod", "com.holywu.tdeintmod", "IsCombed"},
{"d2vsource", "com.sources.d2vsource", "Source"},
{"DMetrics", "com.vapoursynth.dmetrics", "DMetrics", nullptr},
{"SCXVID", "com.nodame.scxvid", "Scxvid", nullptr},
{"FieldHint", "com.nodame.fieldhint", "FieldHint", nullptr},
{"TDeintMod", "com.holywu.tdeintmod", "IsCombed", nullptr},
{"d2vsource", "com.sources.d2vsource", "Source", nullptr},
{"L-SMASH-Works", "systems.innocent.lsmas", "LibavSMASHSource", "LWLibavSource"},
{"DGDecNV", "com.vapoursynth.dgdecodenv", "DGSource"} };
{"DGDecNV", "com.vapoursynth.dgdecodenv", "DGSource", nullptr}
};

static FilterState checkIfFiltersExists(const VSAPI *vsapi, VSCore *vscore, const char *id, const char *function_name1, const char *function_name2) {
VSPlugin *plugin = vsapi->getPluginByID(id, vscore);
Expand Down
4 changes: 2 additions & 2 deletions src/wibbly/WibblyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,8 @@ void WibblyWindow::createCropWindow() {

jobs[row].setCrop(crop_spin[0]->value(), crop_spin[1]->value(), crop_spin[2]->value(), crop_spin[3]->value());

for (int i = 0; i < 4; i++)
settings_last_crop[i] = crop_spin[i]->value();
for (int j = 0; j < 4; j++)
settings_last_crop[j] = crop_spin[j]->value();

QList<QVariant> crop_list = { crop_spin[0]->value(), crop_spin[1]->value(), crop_spin[2]->value(), crop_spin[3]->value() };
settings.setValue(KEY_LAST_CROP, crop_list);
Expand Down

0 comments on commit 4f50a26

Please sign in to comment.