]> git.tdb.fi Git - libs/core.git/blobdiff - examples/ls.cpp
Fix signedness errors from MSVC
[libs/core.git] / examples / ls.cpp
index fd4d71f382bd6212c8e8d9ec0adb3c74636be12d..3e873180d57bf04b72e53b40281bf9088693a2c2 100644 (file)
@@ -31,9 +31,9 @@ Ls::Ls(int argc, char **argv):
 {
        GetOpt getopt;
        getopt.add_option('l', "long", long_format, GetOpt::NO_ARG);
+       getopt.add_argument("file", args, GetOpt::OPTIONAL_ARG);
        getopt(argc, argv);
 
-       args = getopt.get_args();
        if(args.empty())
                args.push_back(".");
 }
@@ -122,7 +122,7 @@ void Ls::print_rows(const list<Row> &rows)
                if(row.size()>col_width.size())
                        col_width.resize(row.size(), 0);
                for(unsigned j=0; j<row.size(); ++j)
-                       col_width[j] = max(col_width[j], row[j].size());
+                       col_width[j] = max<unsigned>(col_width[j], row[j].size());
        }
 
        for(list<Row>::const_iterator i=rows.begin(); i!=rows.end(); ++i)