[gtk/popup-shadow-width] gdk: Move from g_memdup() to g_memdup2()
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/popup-shadow-width] gdk: Move from g_memdup() to g_memdup2()
- Date: Sat, 13 Feb 2021 20:47:16 +0000 (UTC)
commit f3c4ee615d93fd99e7a8f956cf64c4cef4c24e95
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Feb 4 19:16:02 2021 +0000
gdk: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
gdk/gdkcontentproviderimpl.c | 4 +++-
gdk/gdkevents.c | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gdk/gdkcontentproviderimpl.c b/gdk/gdkcontentproviderimpl.c
index aeeca742ba..f987d05abf 100644
--- a/gdk/gdkcontentproviderimpl.c
+++ b/gdk/gdkcontentproviderimpl.c
@@ -27,6 +27,8 @@
#include "gdkintl.h"
#include "gdkcontentproviderimpl.h"
+#include "gdk-private.h"
+
#define GDK_TYPE_CONTENT_PROVIDER_VALUE (gdk_content_provider_value_get_type ())
#define GDK_CONTENT_PROVIDER_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
GDK_TYPE_CONTENT_PROVIDER_VALUE, GdkContentProviderValue))
#define GDK_IS_CONTENT_PROVIDER_VALUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
GDK_TYPE_CONTENT_PROVIDER_VALUE))
@@ -426,7 +428,7 @@ gdk_content_provider_new_union (GdkContentProvider **providers,
result = g_object_new (GDK_TYPE_CONTENT_PROVIDER_UNION, NULL);
result->n_providers = n_providers;
- result->providers = g_memdup (providers, sizeof (GdkContentProvider *) * n_providers);
+ result->providers = g_memdup2 (providers, sizeof (GdkContentProvider *) * n_providers);
for (i = 0; i < n_providers; i++)
{
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 177f06d494..2ce34f80ec 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -332,7 +332,7 @@ gdk_event_type_register_static (const char *type_name,
info.base_finalize = NULL;
info.class_init = gdk_event_generic_class_init;
info.class_finalize = NULL;
- info.class_data = g_memdup (type_info, sizeof (GdkEventTypeInfo));
+ info.class_data = g_memdup2 (type_info, sizeof (GdkEventTypeInfo));
info.instance_size = type_info->instance_size;
info.n_preallocs = 0;
@@ -1146,7 +1146,7 @@ gdk_event_dup_axes (GdkEvent *event)
if (gdk_event_get_axes (event, &axes, &n_axes))
{
- double *axes_copy = g_memdup (axes, n_axes * sizeof (double));
+ double *axes_copy = g_memdup2 (axes, n_axes * sizeof (double));
return axes_copy;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]