static wxColour wxColourFromLong(long c) {
wxColour clr;
- clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
+ clr.Set((unsigned char)(c & 0xff),
+ (unsigned char)((c >> 8) & 0xff),
+ (unsigned char)((c >> 16) & 0xff));
return clr;
}
spec.Mid(1,2).ToLong(&red, 16);
spec.Mid(3,2).ToLong(&green, 16);
spec.Mid(5,2).ToLong(&blue, 16);
- return wxColour(red, green, blue);
+ return wxColour((unsigned char)red,
+ (unsigned char)green,
+ (unsigned char)blue);
}
else
return wxColour(spec);
if (file.IsOpened())
{
wxString contents;
- size_t len = (size_t)file.Length();
+ // get the file size (assume it is not huge file...)
+ ssize_t len = (ssize_t)file.Length();
+
if (len > 0)
{
#if wxUSE_UNICODE
#endif
}
else
- success = true; // empty file is ok
+ {
+ if (len == 0)
+ success = true; // empty file is ok
+ else
+ success = false; // len == wxInvalidOffset
+ }
if (success)
{