The __ia64 and __x86_64__ macros are defined for GCC but not Visual
Studio, but actually this code path should also be taken for Visual
Studio when doing a 64-bit build (x86_64/x64 and aarch64/arm64, _WIN64
will be defined for these cases), since Windows is an LLP64 platform.
This will avoid C4311/C4312 warnings on Visual Studio builds, which are
often warnings of concern as we are dealing with pointers with differing
sizes on 32-bit and 64-bit Windows builds.
Later GLib versions assume that warning C4715 is an error as we want ot
be sure that functions that return a value do indeed return one by all
means.
Avoid this warning by adding a 'return 0' in brz_search_packed(), it
might be pointless but does indeed avoid the warning.
By doing so, we essentially cover the various compiler flags that we
want to use for non-Visual Studio builds to check for warnings that
might cause real concern.
This also skips the checks for the various GCC-isque CFlag checks that
are scattered in the various build files on Visual Studio builds, since
they are essentially meaningless on Visual Studio builds.
This enables various compiler warnings project wide and disables the triggered
ones for each library/executable. This should give us roughly the same behaviour
as with autotools.
Tested with gcc8 and clang7.
glib_dep is what is actually needed to #include <glib.h>, not
gobject_dep. It works incidentally with system gobject/glib but not
when built via subprojects.
Due to an MSVC 2012 x64 compiler issue, the compiler generates bad code
for bdz.c, so the for loop in assign() continues running until the point
i falls below zero, causing an access violation when we try to do
curr_edge=queue[i]; (line 427 in bdz.c). Address this issue by breaking
out of the loop at the end of it when i reaches 0 after doing the
necessary processing.
https://bugzilla.gnome.org/show_bug.cgi?id=733595
...So that it will compile on non-C99 compilers. The changes are mainly
moving the variable declarations to the start of the resecptive blocks.
Also, replace the use of buflen in chd.c as it might not be defined for all
platforms, instead using packed_cr_size as it seems to represent the value
that is to be printed/displayed by the debugging output.
https://bugzilla.gnome.org/show_bug.cgi?id=681820
* Functions taking no parameters need to explicitly say (void).
* Mark some functions as static that are
* Comment out an unused function in bdz.c
* Change loop indicies "i" to be unsigned if our limit is unsigned