]> granicus.if.org Git - re2c/commitdiff
- Fix warnings on selective compilers
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 28 Jan 2006 16:33:22 +0000 (16:33 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 28 Jan 2006 16:33:22 +0000 (16:33 +0000)
# The problem with new(this) is exception specification. Some compilers
# neither allow to declare a placement delete operator nor do they take
# no-throw declarations of the cinstructors into account.

stream_lc.h

index c84e598a3fc94e25c04aa3d5eda26a512fc7578e..85f7778fbb8f972caa14b94fbfc31da174f3bae7 100755 (executable)
@@ -222,13 +222,13 @@ protected:
        virtual pos_type seekoff(off_type off, std::ios_base::seekdir whence,
                std::ios_base::openmode = (std::ios_base::openmode)(std::ios_base::in | std::ios_base::out))
        {
-               return fseek(fp, off, whence);
+               return fseek(fp, (long)off, whence);
        }
 
        virtual pos_type seekpos(pos_type fpos,
                std::ios_base::openmode = (std::ios_base::openmode)(std::ios_base::in | std::ios_base::out))
        {
-               return fseek(fp, fpos, SEEK_SET);
+               return fseek(fp, (long)fpos, SEEK_SET);
        }
 
        virtual _Mybase * setbuf(_E *, std::streamsize)
@@ -383,7 +383,8 @@ public:
 
        file_info& operator = (const file_info& oth)
        {
-               new (this) file_info(oth.fname, oth.ln, false);
+               *(const_cast<std::string*>(&this->fname)) = oth.fname;
+               ln = oth.ln;
                return *this;
        }