]> git.tdb.fi Git - libs/core.git/commitdiff
Fix compile errors on 64-bit systems
authorMikko Rasa <tdb@tdb.fi>
Sun, 20 Sep 2009 16:18:06 +0000 (16:18 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sun, 20 Sep 2009 16:18:06 +0000 (16:18 +0000)
source/path.cpp
source/path.h
source/utils.cpp

index 5424cb1c79e31936a7628cef52a85f1eb74306d0..d8a2c71e830f08052d9b45573546ba241a4c4df9 100644 (file)
@@ -141,12 +141,12 @@ Path::Iterator Path::end() const
 
 void Path::init(const string &p)
 {
-       unsigned start=0;
+       string::size_type start=0;
        if(p[0]=='/' || p[0]=='\\')
                add_component(string(1, DIRSEP));
        while(1)
        {
-               unsigned slash=p.find_first_of("/\\", start);
+               string::size_type slash=p.find_first_of("/\\", start);
                if(slash>start)
                        add_component(p.substr(start, slash-start));
                if(slash==string::npos)
@@ -191,8 +191,8 @@ void Path::add_component(const string &comp)
 #endif
                else
                {
-                       unsigned slash=path.rfind(DIRSEP);
-                       unsigned start=(slash==string::npos ? 0 : slash+1);
+                       string::size_type slash=path.rfind(DIRSEP);
+                       string::size_type start=(slash==string::npos ? 0 : slash+1);
                        if(!path.compare(start, string::npos, ".."))
                        {
                                // If the last component already is a .., add another
index 751c0e3d2f66a3580e590402322d4a6aa1fb6af6..0b946fdcdb18bb00ab79ffe189249946fc5bc8be 100644 (file)
@@ -37,7 +37,7 @@ public:
 
        private:
                const Path &path;
-               unsigned   start,end;
+               std::string::size_type start,end;
 
                Iterator(const Path &);
        public:
index abe0d2563125d9288dbdb2cdc5c6ee6b291e856f..22fe1acab7f1a2bd2293204cbcd0d70152366c77 100644 (file)
@@ -47,7 +47,7 @@ string basepart(const string &fn)
 
 string extpart(const string &fn)
 {
-       unsigned dot=fn.rfind('.');
+       string::size_type dot=fn.rfind('.');
        if(dot==string::npos)
                return string();
        return fn.substr(dot);