From: Tsuda kageyu Date: Thu, 18 Apr 2013 10:52:52 +0000 (+0900) Subject: Fix some GCC specific warnings X-Git-Tag: v1.9~59^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a71749a6b57d1db3cee871df664105478504e3ba;p=taglib Fix some GCC specific warnings --- diff --git a/taglib/toolkit/tfilestream.cpp b/taglib/toolkit/tfilestream.cpp index 52252023..da9311e3 100644 --- a/taglib/toolkit/tfilestream.cpp +++ b/taglib/toolkit/tfilestream.cpp @@ -369,6 +369,9 @@ void FileStream::seek(long offset, Position p) case End: whence = FILE_END; break; + default: + debug("FileStream::seek() -- Invalid Position value."); + return; } SetFilePointer(d->file, offset, NULL, whence); @@ -386,6 +389,9 @@ void FileStream::seek(long offset, Position p) case End: whence = SEEK_END; break; + default: + debug("FileStream::seek() -- Invalid Position value."); + return; } fseek(d->file, offset, whence); @@ -429,10 +435,10 @@ long FileStream::length() if(!d->file) return 0; - long curpos = tell(); + const long curpos = tell(); seek(0, End); - long endpos = tell(); + const long endpos = tell(); seek(curpos, Beginning); @@ -448,7 +454,7 @@ void FileStream::truncate(long length) { #ifdef _WIN32 - long currentPos = tell(); + const long currentPos = tell(); seek(length); SetEndOfFile(d->file); @@ -457,7 +463,10 @@ void FileStream::truncate(long length) #else - ftruncate(fileno(d->file), length); + const int error = ftruncate(fileno(d->file), length); + if(error != 0) { + debug("FileStream::truncate() -- Coundn't truncate the file."); + } #endif }