From: helly Date: Sat, 28 Jan 2006 16:33:22 +0000 (+0000) Subject: - Fix warnings on selective compilers X-Git-Tag: 0.13.6~471 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=487abe18478cd231e879039e0797dc82759f8e5e;p=re2c - Fix warnings on selective compilers # 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. --- diff --git a/stream_lc.h b/stream_lc.h index c84e598a..85f7778f 100755 --- a/stream_lc.h +++ b/stream_lc.h @@ -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(&this->fname)) = oth.fname; + ln = oth.ln; return *this; }