Merge branch 'wip/otte/for-master' into 'master'

Fix a bunch of issues found by static analyzer

See merge request GNOME/gtk!4090
This commit is contained in:
Benjamin Otte 2021-10-23 00:00:32 +00:00
commit a07e1bf336
4 changed files with 7 additions and 14 deletions

View File

@ -874,8 +874,8 @@ gtk_gears_tick (GtkWidget *widget,
{ {
GtkGears *gears = GTK_GEARS (widget); GtkGears *gears = GTK_GEARS (widget);
GtkGearsPrivate *priv = gtk_gears_get_instance_private (gears); GtkGearsPrivate *priv = gtk_gears_get_instance_private (gears);
GdkFrameTimings *timings, *previous_timings; GdkFrameTimings *previous_timings;
gint64 previous_frame_time = 0; gint64 previous_frame_time;
gint64 frame_time; gint64 frame_time;
gint64 history_start, history_len; gint64 history_start, history_len;
gint64 frame; gint64 frame;
@ -915,12 +915,6 @@ gtk_gears_tick (GtkWidget *widget,
} }
} }
timings = gdk_frame_clock_get_current_timings (frame_clock);
previous_timings = gdk_frame_clock_get_timings (frame_clock,
gdk_frame_timings_get_frame_counter (timings) - 1);
if (previous_timings != NULL)
previous_frame_time = gdk_frame_timings_get_frame_time (previous_timings);
return G_SOURCE_CONTINUE; return G_SOURCE_CONTINUE;
} }

View File

@ -385,6 +385,8 @@ gdk_save_png (GdkTexture *texture)
return NULL; return NULL;
} }
memtex = gdk_memory_texture_from_texture (texture, format);
if (sigsetjmp (png_jmpbuf (png), 1)) if (sigsetjmp (png_jmpbuf (png), 1))
{ {
g_object_unref (memtex); g_object_unref (memtex);
@ -393,8 +395,6 @@ gdk_save_png (GdkTexture *texture)
return NULL; return NULL;
} }
memtex = gdk_memory_texture_from_texture (texture, format);
png_set_write_fn (png, &io, png_write_func, png_flush_func); png_set_write_fn (png, &io, png_write_func, png_flush_func);
png_set_IHDR (png, info, width, height, depth, png_set_IHDR (png, info, width, height, depth,

View File

@ -393,10 +393,11 @@ gdk_load_tiff (GBytes *input_bytes,
guint16 extra; guint16 extra;
guint16 *extra_types; guint16 *extra_types;
if (!TIFFGetField (tif, TIFFTAG_EXTRASAMPLES, &extra, &extra_types)) if (TIFFGetField (tif, TIFFTAG_EXTRASAMPLES, &extra, &extra_types))
alpha_samples = extra_types[0];
else
alpha_samples = 0; alpha_samples = 0;
alpha_samples = extra_types[0];
if (alpha_samples != 0 && alpha_samples != EXTRASAMPLE_ASSOCALPHA && alpha_samples != EXTRASAMPLE_UNASSALPHA) if (alpha_samples != 0 && alpha_samples != EXTRASAMPLE_ASSOCALPHA && alpha_samples != EXTRASAMPLE_UNASSALPHA)
{ {
texture = load_fallback (tif, error); texture = load_fallback (tif, error);

View File

@ -220,8 +220,6 @@ gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
GdkSurface *surface; GdkSurface *surface;
GLXWindow drawable; GLXWindow drawable;
drawable = gdk_x11_gl_context_glx_get_drawable (self);
if (!surfaceless) if (!surfaceless)
surface = gdk_gl_context_get_surface (context); surface = gdk_gl_context_get_surface (context);
else else