Ignore:
Timestamp:
02/01/15 01:08:50 (9 years ago)
Author:
Maciej Komosinski
Message:

Fixed compilation warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/stl-util.cpp

    r286 r319  
    2121{
    2222        string s; //clang crashed when this declaration was in s=buf
    23         long size = 256;
     23        int size = 256;
    2424        char* buf;
    2525        va_list ap_copy; // "va_list ap" can only by used once by printf-type functions as they advance the current argument pointer (crashed on linux x86_64)
     
    151151string stripExt(const string& filename)
    152152{
    153         int dot = filename.rfind('.');
     153        size_t dot = filename.rfind('.');
    154154        if (dot == string::npos) return filename;
    155         int sep = filename.rfind(PATH_SEPARATOR_CHAR);
     155        size_t sep = filename.rfind(PATH_SEPARATOR_CHAR);
    156156        if ((sep == string::npos) || (sep < dot))
    157157                return filename.substr(0, dot);
     
    161161string getFileExt(const string& filename)
    162162{
    163         int dot = filename.rfind('.');
     163        size_t dot = filename.rfind('.');
    164164        if (dot == string::npos) return string("");
    165         int sep = filename.rfind(PATH_SEPARATOR_CHAR);
     165        size_t sep = filename.rfind(PATH_SEPARATOR_CHAR);
    166166        if ((sep == string::npos) || (sep < dot))
    167167                return filename.substr(dot);
     
    171171string getFileDir(const string& filename)
    172172{
    173         int slash = filename.rfind(PATH_SEPARATOR_CHAR);
     173        size_t slash = filename.rfind(PATH_SEPARATOR_CHAR);
    174174        if (slash == string::npos) return string("");
    175175        return filename.substr(0, slash);
Note: See TracChangeset for help on using the changeset viewer.