Mercurial > hg > octave-terminal
changeset 15458:1cc42df8ede7
mkoctfile.in.cc: Change variable types to stop compilation warnings.
* mkoctfile.in.cc: Change variable types to stop compilation warnings about
signed/unsigned comparisons. Remove unused variable len.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 29 Sep 2012 23:40:00 -0700 |
parents | dd086145f4a6 |
children | abf34bbcd053 7f36f7dc25b2 |
files | src/mkoctfile.in.cc |
diffstat | 1 files changed, 5 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/mkoctfile.in.cc +++ b/src/mkoctfile.in.cc @@ -73,7 +73,7 @@ get_line (FILE *fp) { static vector<char> buf (100); - int idx = 0; + unsigned int idx = 0; char c; while (true) @@ -436,7 +436,6 @@ for (int i = 1; i < argc; i++) { string arg = argv[i]; - size_t len = arg.length (); if (ends_with (arg, ".c")) { @@ -608,13 +607,13 @@ FILE *fd = popen (cmd.c_str (), "r"); ofstream fo (dfile.c_str ()); - int pos; + size_t pos; while (!feof (fd)) { line = get_line (fd); if ((pos = line.rfind (".o:")) != string::npos) { - int spos = line.rfind ('/', pos); + size_t spos = line.rfind ('/', pos); string ofile = (spos == string::npos ? line.substr (0, pos+2) : line.substr (spos+1, pos-spos+1)); fo << "pic/" << ofile << " " << ofile << " " << dfile << line.substr (pos) << endl; } @@ -636,13 +635,13 @@ FILE *fd = popen (cmd.c_str (), "r"); ofstream fo (dfile.c_str ()); - int pos; + size_t pos; while (!feof (fd)) { line = get_line (fd); if ((pos = line.rfind (".o:")) != string::npos) { - int spos = line.rfind ('/', pos); + size_t spos = line.rfind ('/', pos); string ofile = (spos == string::npos ? line.substr (0, pos+2) : line.substr (spos+1, pos-spos+1)); fo << "pic/" << ofile << " " << ofile << " " << dfile << line.substr (pos+2) << endl; }