]> git.tdb.fi Git - libs/core.git/blobdiff - source/utils.cpp
Fix compile erorrs on 64-bit systems
[libs/core.git] / source / utils.cpp
index baf1333138b82807864df7bb1f04ebc7365e3f33..675a2b1094b44f05d44b8cdb3e25cd732b2f72a0 100644 (file)
@@ -139,13 +139,13 @@ vector<string> split(const string &str, const string &sep, bool allow_empty)
 {
        vector<string> result;
        
-       unsigned start=0;
+       string::size_type start=0;
        if(!allow_empty)
                start=str.find_first_not_of(sep);
        
        while(start<str.size())
        {
-               unsigned end=str.find_first_of(sep, start);
+               string::size_type end=str.find_first_of(sep, start);
                result.push_back(str.substr(start, end-start));
                
                if(end==string::npos)
@@ -301,7 +301,7 @@ string c_escape(const string &str, bool escape_8bit)
                        result+="\\\\";
                else if(static_cast<unsigned char>(*i)<' ' || (escape_8bit && (*i&0x80)))
                {
-                       char buf[4]={'\\', '0'+((*i>>6)&7), '0'+((*i>>3)&7), '0'+(*i&7)};
+                       char buf[4]={'\\', '0'+((*i>>6)&3), '0'+((*i>>3)&7), '0'+(*i&7)};
                        result.append(buf, 4);
                }
                else