]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/file.cpp
Add an intermediate Seekable interface class
[libs/core.git] / source / io / file.cpp
index 727542fe1d15baa3fbdcdc6678be9914e82d0ade..74930baaf497286f32925ee395641147813daf58 100644 (file)
@@ -189,7 +189,7 @@ void File::sync()
 #endif
 }
 
-int File::seek(int off, SeekType st)
+unsigned File::seek(int off, SeekType st)
 {
        check_access(M_NONE);
 
@@ -201,8 +201,8 @@ int File::seek(int off, SeekType st)
        if(ret==INVALID_SET_FILE_POINTER)
                throw system_error("SetFilePointer");
 #else
-       int ret = lseek(handle, off, type);
-       if(ret==-1)
+       off_t ret = lseek(handle, off, type);
+       if(ret==(off_t)-1)
                throw system_error("lseek");
 #endif
 
@@ -211,7 +211,7 @@ int File::seek(int off, SeekType st)
        return ret;
 }
 
-int File::tell() const
+unsigned File::tell() const
 {
        check_access(M_NONE);
 
@@ -220,8 +220,8 @@ int File::tell() const
        if(ret==INVALID_SET_FILE_POINTER)
                throw system_error("SetFilePointer");
 #else
-       int ret = lseek(handle, 0, SEEK_CUR);
-       if(ret==-1)
+       off_t ret = lseek(handle, 0, SEEK_CUR);
+       if(ret==(off_t)-1)
                throw system_error("lseek");
 #endif