Merge branch 'ebassi/warnings-fixes' into 'master'

Avoid a bunch of compiler warnings

See merge request cairo/cairo!166
This commit is contained in:
Uli Schlachter 2021-04-27 16:30:44 +00:00
commit 64e1fd70ec
4 changed files with 14 additions and 8 deletions

View file

@ -43,6 +43,8 @@ if cc.get_id() == 'msvc'
language : 'c')
endif
add_project_arguments('-D_GNU_SOURCE', language: 'c')
# Make sure source directory hasn't been configured with autotools
if meson.version().version_compare('>= 0.53')
fs = import('fs')

View file

@ -209,13 +209,15 @@ static const char *
_format_to_string (cairo_format_t format)
{
switch (format) {
case CAIRO_FORMAT_ARGB32: return "ARGB32";
case CAIRO_FORMAT_RGB30: return "RGB30";
case CAIRO_FORMAT_RGB24: return "RGB24";
case CAIRO_FORMAT_RGB16_565: return "RGB16_565";
case CAIRO_FORMAT_A8: return "A8";
case CAIRO_FORMAT_A1: return "A1";
case CAIRO_FORMAT_INVALID: return "INVALID";
case CAIRO_FORMAT_ARGB32: return "ARGB32";
case CAIRO_FORMAT_RGB30: return "RGB30";
case CAIRO_FORMAT_RGB24: return "RGB24";
case CAIRO_FORMAT_RGB16_565: return "RGB16_565";
case CAIRO_FORMAT_RGB96F: return "RGB96F";
case CAIRO_FORMAT_RGBA128F: return "RGBA128F";
case CAIRO_FORMAT_A8: return "A8";
case CAIRO_FORMAT_A1: return "A1";
case CAIRO_FORMAT_INVALID: return "INVALID";
}
ASSERT_NOT_REACHED;
return "INVALID";

View file

@ -858,6 +858,8 @@ matches_reference (struct slave *slave)
case CAIRO_FORMAT_RGB30:
case CAIRO_FORMAT_RGB16_565:
case CAIRO_FORMAT_RGB96F:
case CAIRO_FORMAT_RGBA128F:
case CAIRO_FORMAT_INVALID:
assert (0);
}

View file

@ -44,7 +44,7 @@
GType \
underscore_name ## _get_type (void) \
{ \
static volatile gsize type_volatile = 0; \
static gsize type_volatile = 0; \
if (g_once_init_enter (&type_volatile)) { \
GType type = g_boxed_type_register_static (g_intern_static_string (Name), \
(GBoxedCopyFunc)copy_func, \