From 6d3c04f691ee8ab98610a3bd7c47c7ef42576f8d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 18 Jun 2010 17:56:21 +0200 Subject: [PATCH] Use int for functions potentially returning negative results --- src/mmg/tabs/input.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mmg/tabs/input.cpp b/src/mmg/tabs/input.cpp index f89238938..0d48b478e 100644 --- a/src/mmg/tabs/input.cpp +++ b/src/mmg/tabs/input.cpp @@ -323,7 +323,6 @@ tab_input::add_file(const wxString &file_name, wxString name, command, video_track_name, opt_file_name; wxArrayString output, errors; std::vector args, pair; - size_t pos; int new_file_pos, result; unsigned int i, k; wxFile *opt_file; @@ -378,7 +377,8 @@ tab_input::add_file(const wxString &file_name, if (3 == result) { wxString container = Z("unknown"); - if (output.Count() && (0 <= (pos = output[0].Find(wxT("container:"))))) + int pos; + if (output.Count() && (wxNOT_FOUND != (pos = output[0].Find(wxT("container:"))))) container = output[0].Mid(pos + 11); wxString info; @@ -433,6 +433,8 @@ tab_input::add_file(const wxString &file_name, default_track_found_for['s'] = -1 != default_track_checked('s'); for (i = 0; i < output.Count(); i++) { + int pos; + if (output[i].Find(wxT("Track")) == 0) { mmg_track_cptr track(new mmg_track_t); @@ -535,7 +537,7 @@ tab_input::add_file(const wxString &file_name, cfg->Flush(); } - } else if ((pos = output[i].Find(wxT("container:"))) > 0) { + } else if ((pos = output[i].Find(wxT("container:"))) != wxNOT_FOUND) { wxString container = output[i].Mid(pos + 11).BeforeFirst(wxT(' ')); wxString info = output[i].Mid(pos + 11).AfterFirst(wxT('[')).BeforeLast(wxT(']'));