# HG changeset patch # User mas01cr # Date 1250026959 0 # Node ID c850f34334549b2dfcda7beca28500291e6f5662 # Parent 70acfcb5010a66ebcf45a340e47cf5a97adbfdfc Deal with signed/unsigned comparison, again. Mingw's off_t appears to be 32-bit always. diff -r 70acfcb5010a -r c850f3433454 insert.cpp --- a/insert.cpp Tue Aug 11 21:42:34 2009 +0000 +++ b/insert.cpp Tue Aug 11 21:42:39 2009 +0000 @@ -346,8 +346,13 @@ * will do the right thing for us on all platforms. * * I hate C. + * + * Addendum: the above reasoning is skewered on Win32, where off_t + * is apparently signed 32-bit always (i.e. no large-file + * support). So now, we cast datum->dim to size_t, so that our + * types are the same on both sides. I hate C even more. */ - if(((off_t) (st.st_size - sizeof(uint32_t))) != (size / datum->dim)) { + if((st.st_size - sizeof(uint32_t)) != (size / (size_t) datum->dim)) { goto error; } read_or_goto_error(fd, &dim, sizeof(uint32_t));