AUD_ConverterFunctions.cpp:
* Fixed warning caused by assigning an int constant to a 16bit variable (even though the compiler could have checked the conversion was safe).
* Changed an unsigned unary negation "-P" to "0-P" to quiet a warning. My reading of K&R C confirms that these should be equivalent with the plus being that the compiler does not warn about "0-P"
AVI_avi.h:
* Changed Offset and Size in the AviIndexEntry to int64_t because ftell is 64-bit. I'm not sure if avi files can be larger than 2^31 or 2^32, but changing the types for Offset and Size seemed to be easier than adding all the checks to make sure it never gets too big, or somehow proving that the files never get too big (in which case I'd settle for a cast to int).
* Removed the AviIndex structure because it seems to be unused (it also contains a typo).
avi.c:
* Another case where ftell's return was being treated as an int. In this case it is provable that the value returned is less than 2^16 (minimum standard size of int) so using a cast is safe.
* In other places just replaced 'int' with 'int64_t'
* Note about all changes to the AVI library, not sure if the value should be int64_t for all systems. A typedef that matches the type of ftell may be better?
BKE_image.h:
For a couple of functions the type of imtype was changed to const, but this change was not made in the header file.
pointcache.c:
* typo - sorter -> sorted
* put a cast on the implicit float -> int conversion. Added a note because I'm paranoid about what happens if the number of frames is very large
BLI_utildefines.h:
* changed STRINGIFY_ARG macro so that it works even if the token it is passed is empty
* added STRINGIFY_APPEND as a helper function to implement STRINGIFY in a way that does not cause MSVC to complain each point release
* rewrote STRINGIFY to use STRINGIFY_APPEND
math_color_inline.h:
* added an explicit cast to unsigned short to quiet warning
readfile.h
* changed an unsigned int to int to quiet warning
* in do_versions_image_settings_2_60 i added some explicit casts to char to quiet warnings. added comment because I'm concerned that the conversion from short to char may need to be checked
editmesh_lib.c:
* removed an 'a++' in a for loop header where 'a' is neither initialized nor used in the loop (its used later in the function, but initialized to 0 first)
bpy_api.c
* removed EXPAND macro because STRINGIFY works without having to test if the argument is empty now
* removed now unneeded check for empty BLENDER_VERSION_CHAR
Description
Event Timeline
in AVI_avi.h, those datastructures should not be changed, they are avi file headers (I made that mistake trying to fix warnings before)
In readfile.c, the conversion should be safe, these variables only have valid values < 256.
In pointcache.c, the int => float cast, that has to be happening in many other places? Better disable the compiler warning here imo.
I looked at AVI again and will submit another patch that causes the write function to fail if it will overflow the Offset field.
Actually the only place where I get an int to float conversion warning is in pointcache.c. Admittedly I disable a lot of stuff so my builds go faster, but even so I also believe that int to float conversion is not always safe so you should have to put a cast on it.
After testing I found that BKE_ptcache_id_time will fail to return sane times when CFRA >= 16777217 because (float)16777217 == (float)16777216
That's pretty big, about 77 hours of animation at 60fps, so adding a cast is probably safe. Something else would probably break first.