summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte.benjamin@googlemail.com>2021-10-23 00:00:32 +0000
committerBenjamin Otte <otte.benjamin@googlemail.com>2021-10-23 00:00:32 +0000
commita07e1bf3367d0da4f941277ba7211d033665f5bc (patch)
treeb2f4f0b215de76ba66ac56ff6fe4784450b7b86e
parent2b2fd23815739c099bee061d3478750801fde73f (diff)
parentae117d0cfa9bdf3c49d511f76a936babbc1fb9da (diff)
downloadgtk+-a07e1bf3367d0da4f941277ba7211d033665f5bc.tar.gz
Merge branch 'wip/otte/for-master' into 'master'
Fix a bunch of issues found by static analyzer See merge request GNOME/gtk!4090
-rw-r--r--demos/gtk-demo/gtkgears.c10
-rw-r--r--gdk/loaders/gdkpng.c4
-rw-r--r--gdk/loaders/gdktiff.c5
-rw-r--r--gdk/x11/gdkglcontext-glx.c2
4 files changed, 7 insertions, 14 deletions
diff --git a/demos/gtk-demo/gtkgears.c b/demos/gtk-demo/gtkgears.c
index 1463cbb6b5..44b49b8b09 100644
--- a/demos/gtk-demo/gtkgears.c
+++ b/demos/gtk-demo/gtkgears.c
@@ -874,8 +874,8 @@ gtk_gears_tick (GtkWidget *widget,
{
GtkGears *gears = GTK_GEARS (widget);
GtkGearsPrivate *priv = gtk_gears_get_instance_private (gears);
- GdkFrameTimings *timings, *previous_timings;
- gint64 previous_frame_time = 0;
+ GdkFrameTimings *previous_timings;
+ gint64 previous_frame_time;
gint64 frame_time;
gint64 history_start, history_len;
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;
}
diff --git a/gdk/loaders/gdkpng.c b/gdk/loaders/gdkpng.c
index 11ed7e4ef9..4d50dfbf83 100644
--- a/gdk/loaders/gdkpng.c
+++ b/gdk/loaders/gdkpng.c
@@ -385,6 +385,8 @@ gdk_save_png (GdkTexture *texture)
return NULL;
}
+ memtex = gdk_memory_texture_from_texture (texture, format);
+
if (sigsetjmp (png_jmpbuf (png), 1))
{
g_object_unref (memtex);
@@ -393,8 +395,6 @@ gdk_save_png (GdkTexture *texture)
return NULL;
}
- memtex = gdk_memory_texture_from_texture (texture, format);
-
png_set_write_fn (png, &io, png_write_func, png_flush_func);
png_set_IHDR (png, info, width, height, depth,
diff --git a/gdk/loaders/gdktiff.c b/gdk/loaders/gdktiff.c
index 2652aeacc4..62e292a73d 100644
--- a/gdk/loaders/gdktiff.c
+++ b/gdk/loaders/gdktiff.c
@@ -393,10 +393,11 @@ gdk_load_tiff (GBytes *input_bytes,
guint16 extra;
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 = extra_types[0];
if (alpha_samples != 0 && alpha_samples != EXTRASAMPLE_ASSOCALPHA && alpha_samples != EXTRASAMPLE_UNASSALPHA)
{
texture = load_fallback (tif, error);
diff --git a/gdk/x11/gdkglcontext-glx.c b/gdk/x11/gdkglcontext-glx.c
index aa121f4372..334acf8ff9 100644
--- a/gdk/x11/gdkglcontext-glx.c
+++ b/gdk/x11/gdkglcontext-glx.c
@@ -220,8 +220,6 @@ gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
GdkSurface *surface;
GLXWindow drawable;
- drawable = gdk_x11_gl_context_glx_get_drawable (self);
-
if (!surfaceless)
surface = gdk_gl_context_get_surface (context);
else