Fix 64-bit compilation errors

Originally committed to SVN as r4663.
This commit is contained in:
Thomas Goyne 2010-07-08 04:50:46 +00:00
parent acba2c6b63
commit a59d2a8e2e
3 changed files with 9 additions and 9 deletions

View file

@ -84,7 +84,7 @@ struct iconv_fallbacks {
class Converter : public iconv_fallbacks { class Converter : public iconv_fallbacks {
bool subst; bool subst;
int bomSize; size_t bomSize;
char invalidRep[8]; char invalidRep[8];
size_t invalidRepSize; size_t invalidRepSize;
static void fallback( static void fallback(
@ -163,7 +163,7 @@ public:
// convert at least one extra character // convert at least one extra character
char bom[8]; char bom[8];
char *dst = bom; char *dst = bom;
size_t dstSize = min(8U, bomSize + *outbytesleft); size_t dstSize = min((size_t)8, bomSize + *outbytesleft);
const char *src = *inbuf; const char *src = *inbuf;
size_t srcSize = *inbytesleft; size_t srcSize = *inbytesleft;
iconv(cd, ICONV_CONST_CAST(&src), &srcSize, &dst, &dstSize); iconv(cd, ICONV_CONST_CAST(&src), &srcSize, &dst, &dstSize);

View file

@ -231,7 +231,7 @@ void Framerate::Save(std::string const& filename, int length) const {
out << "# timecode format v2\n"; out << "# timecode format v2\n";
std::copy(timecodes.begin(), timecodes.end(), std::ostream_iterator<int>(out, "\n")); std::copy(timecodes.begin(), timecodes.end(), std::ostream_iterator<int>(out, "\n"));
for (int written = timecodes.size(); written < length; ++written) { for (int written = (int)timecodes.size(); written < length; ++written) {
out << TimeAtFrame(written) << std::endl; 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.); return (int)floor((ms - timecodes.front()) * fps / 1000.);
} }
if (ms > timecodes.back()) { 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<int>()), timecodes.rend()) - 1; return (int)std::distance(std::lower_bound(timecodes.rbegin(), timecodes.rend(), ms, std::greater<int>()), timecodes.rend()) - 1;
} }
int Framerate::TimeAtFrame(int frame, Time type) const { int Framerate::TimeAtFrame(int frame, Time type) const {

View file

@ -47,7 +47,7 @@ class line_iterator : public std::iterator<std::input_iterator_tag, OutputType>
std::tr1::shared_ptr<agi::charset::IconvWrapper> conv; std::tr1::shared_ptr<agi::charset::IconvWrapper> conv;
int cr; ///< CR character in the source encoding int cr; ///< CR character in the source encoding
int lf; ///< LF 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 /// @brief Convert a string to the output type
/// @param str Line read from the file /// @param str Line read from the file
@ -161,11 +161,11 @@ void line_iterator<OutputType>::getline(std::string &str) {
for (;;) { for (;;) {
chr = 0; chr = 0;
#ifdef _WIN32 #ifdef _WIN32
int read = stream->rdbuf()->_Sgetn_s(buf, 4, width); std::streamsize read = stream->rdbuf()->_Sgetn_s(buf, 4, width);
#else #else
int read = stream->rdbuf()->sgetn(buf, width); std::streamsize read = stream->rdbuf()->sgetn(buf, width);
#endif #endif
if (read < width) { if (read < (std::streamsize)width) {
for (int i = 0; i < read; i++) { for (int i = 0; i < read; i++) {
str += buf[i]; str += buf[i];
} }