diff --git a/aegisub/libaegisub/common/charset_conv.cpp b/aegisub/libaegisub/common/charset_conv.cpp index f5b61c3a0..bd9cc1e57 100644 --- a/aegisub/libaegisub/common/charset_conv.cpp +++ b/aegisub/libaegisub/common/charset_conv.cpp @@ -84,7 +84,7 @@ struct iconv_fallbacks { class Converter : public iconv_fallbacks { bool subst; - int bomSize; + size_t bomSize; char invalidRep[8]; size_t invalidRepSize; static void fallback( @@ -163,7 +163,7 @@ public: // convert at least one extra character char bom[8]; char *dst = bom; - size_t dstSize = min(8U, bomSize + *outbytesleft); + size_t dstSize = min((size_t)8, bomSize + *outbytesleft); const char *src = *inbuf; size_t srcSize = *inbytesleft; iconv(cd, ICONV_CONST_CAST(&src), &srcSize, &dst, &dstSize); diff --git a/aegisub/libaegisub/common/vfr.cpp b/aegisub/libaegisub/common/vfr.cpp index 667154842..9bd7aa4ed 100644 --- a/aegisub/libaegisub/common/vfr.cpp +++ b/aegisub/libaegisub/common/vfr.cpp @@ -231,7 +231,7 @@ void Framerate::Save(std::string const& filename, int length) const { out << "# timecode format v2\n"; std::copy(timecodes.begin(), timecodes.end(), std::ostream_iterator(out, "\n")); - for (int written = timecodes.size(); written < length; ++written) { + for (int written = (int)timecodes.size(); written < length; ++written) { out << TimeAtFrame(written) << std::endl; } } @@ -268,10 +268,10 @@ int Framerate::FrameAtTime(int ms, Time type) const { return (int)floor((ms - timecodes.front()) * fps / 1000.); } if (ms > timecodes.back()) { - return round((ms - timecodes.back()) * fps / 1000.) + timecodes.size() - 1; + return round((ms - timecodes.back()) * fps / 1000.) + (int)timecodes.size() - 1; } - return std::distance(std::lower_bound(timecodes.rbegin(), timecodes.rend(), ms, std::greater()), timecodes.rend()) - 1; + return (int)std::distance(std::lower_bound(timecodes.rbegin(), timecodes.rend(), ms, std::greater()), timecodes.rend()) - 1; } int Framerate::TimeAtFrame(int frame, Time type) const { diff --git a/aegisub/libaegisub/include/libaegisub/line_iterator.h b/aegisub/libaegisub/include/libaegisub/line_iterator.h index 0761b7bf6..5a8f6570c 100644 --- a/aegisub/libaegisub/include/libaegisub/line_iterator.h +++ b/aegisub/libaegisub/include/libaegisub/line_iterator.h @@ -47,7 +47,7 @@ class line_iterator : public std::iterator std::tr1::shared_ptr conv; int cr; ///< CR character in the source encoding int lf; ///< LF character in the source encoding - int width; ///< width of LF character in the source encoding + size_t width; ///< width of LF character in the source encoding /// @brief Convert a string to the output type /// @param str Line read from the file @@ -161,11 +161,11 @@ void line_iterator::getline(std::string &str) { for (;;) { chr = 0; #ifdef _WIN32 - int read = stream->rdbuf()->_Sgetn_s(buf, 4, width); + std::streamsize read = stream->rdbuf()->_Sgetn_s(buf, 4, width); #else - int read = stream->rdbuf()->sgetn(buf, width); + std::streamsize read = stream->rdbuf()->sgetn(buf, width); #endif - if (read < width) { + if (read < (std::streamsize)width) { for (int i = 0; i < read; i++) { str += buf[i]; }