plug-ins, operations: Fix warnings on Windows

This patch reduces three sets of warnings
when compiling on Windows:

* In gimp-layer-modes.c, we move the
g_return_val_if_reached () in
gimp_layer_mode_get_format () to the
default case in the last switch statement
to prevent a warning about an unhandled
switch case

* In spline.c, we initialize V[] to prevent
a warning about uninitialized values

* In flame.c, we unconditionally call
g_bytes_unref () to prevent a warning
about dangling pointers.
This commit is contained in:
Alx Sa 2025-05-22 02:10:08 +00:00
parent d74943b69e
commit 06a0bafe79
3 changed files with 10 additions and 9 deletions

View file

@ -1541,9 +1541,10 @@ gimp_layer_mode_get_format (GimpLayerMode mode,
case GIMP_LAYER_COLOR_SPACE_LAB: case GIMP_LAYER_COLOR_SPACE_LAB:
return babl_format_with_space ("CIE Lab alpha float", preferred_format); return babl_format_with_space ("CIE Lab alpha float", preferred_format);
}
g_return_val_if_reached (babl_format_with_space ("RGBA float", preferred_format)); default:
g_return_val_if_reached (babl_format_with_space ("RGBA float", preferred_format));
}
} }
GimpLayerCompositeRegion GimpLayerCompositeRegion

View file

@ -1034,13 +1034,10 @@ set_flame_preview (GimpProcedureConfig *proc_config)
return; return;
g_object_get (proc_config, "settings-data", &settings_bytes, NULL); g_object_get (proc_config, "settings-data", &settings_bytes, NULL);
if (settings_bytes != NULL) if (settings_bytes != NULL &&
{ g_bytes_get_size (settings_bytes) == sizeof (FlameSettings))
if (g_bytes_get_size (settings_bytes) == sizeof (FlameSettings)) config = *((FlameSettings *) g_bytes_get_data (settings_bytes, NULL));
config = *((FlameSettings *) g_bytes_get_data (settings_bytes, NULL)); g_bytes_unref (settings_bytes);
g_bytes_unref (settings_bytes);
}
g_object_get (proc_config, g_object_get (proc_config,
"x", &config.cp.center[0], "x", &config.cp.center[0],

View file

@ -83,6 +83,9 @@ evaluate_spline (spline_type s, real t)
real one_minus_t = 1.0 - t; real one_minus_t = 1.0 - t;
polynomial_degree degree = SPLINE_DEGREE (s); polynomial_degree degree = SPLINE_DEGREE (s);
for (i = 0; i < 4; i++)
V[i] = new_spline ();
for (i = 0; i <= degree; i++) for (i = 0; i <= degree; i++)
V[0].v[i] = s.v[i]; V[0].v[i] = s.v[i];