[gnome-flashback] backends: use g_memdup2



commit e6dd0a5a90927268b2c56c0c51a2dd6c7776e051
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Mar 14 15:47:48 2021 +0200

    backends: use g_memdup2

 backends/gf-monitor-config-manager.c |  4 ++--
 backends/gf-monitor-config.c         |  2 +-
 backends/gf-monitor-manager-xrandr.c | 10 +++++-----
 backends/gf-output-xrandr.c          |  2 +-
 configure.ac                         |  2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/backends/gf-monitor-config-manager.c b/backends/gf-monitor-config-manager.c
index b3253e2..d63502e 100644
--- a/backends/gf-monitor-config-manager.c
+++ b/backends/gf-monitor-config-manager.c
@@ -469,7 +469,7 @@ clone_monitor_config_list (GList *configs_in)
       config_out = g_new0 (GfMonitorConfig, 1);
       *config_out = (GfMonitorConfig) {
         .monitor_spec = gf_monitor_spec_clone (config_in->monitor_spec),
-        .mode_spec = g_memdup (config_in->mode_spec, sizeof (GfMonitorModeSpec)),
+        .mode_spec = g_memdup2 (config_in->mode_spec, sizeof (GfMonitorModeSpec)),
         .enable_underscanning = config_in->enable_underscanning
       };
 
@@ -495,7 +495,7 @@ clone_logical_monitor_config_list (GList *configs_in)
 
       config_in = l->data;
 
-      config_out = g_memdup (config_in, sizeof (GfLogicalMonitorConfig));
+      config_out = g_memdup2 (config_in, sizeof (GfLogicalMonitorConfig));
 
       config_list = clone_monitor_config_list (config_in->monitor_configs);
       config_out->monitor_configs = config_list;
diff --git a/backends/gf-monitor-config.c b/backends/gf-monitor-config.c
index a8f0968..3bbe1d4 100644
--- a/backends/gf-monitor-config.c
+++ b/backends/gf-monitor-config.c
@@ -39,7 +39,7 @@ gf_monitor_config_new (GfMonitor     *monitor,
 
   config = g_new0 (GfMonitorConfig, 1);
   config->monitor_spec = gf_monitor_spec_clone (spec);
-  config->mode_spec = g_memdup (mode_spec, sizeof (GfMonitorModeSpec));
+  config->mode_spec = g_memdup2 (mode_spec, sizeof (GfMonitorModeSpec));
   config->enable_underscanning = gf_monitor_is_underscanning (monitor);
 
   return config;
diff --git a/backends/gf-monitor-manager-xrandr.c b/backends/gf-monitor-manager-xrandr.c
index 6aacd46..1f7fee1 100644
--- a/backends/gf-monitor-manager-xrandr.c
+++ b/backends/gf-monitor-manager-xrandr.c
@@ -930,9 +930,9 @@ gf_monitor_manager_xrandr_get_crtc_gamma (GfMonitorManager  *manager,
   gamma = XRRGetCrtcGamma (xrandr->xdisplay, (XID) gf_crtc_get_id (crtc));
 
   *size = gamma->size;
-  *red = g_memdup (gamma->red, sizeof (gushort) * gamma->size);
-  *green = g_memdup (gamma->green, sizeof (gushort) * gamma->size);
-  *blue = g_memdup (gamma->blue, sizeof (gushort) * gamma->size);
+  *red = g_memdup2 (gamma->red, sizeof (gushort) * gamma->size);
+  *green = g_memdup2 (gamma->green, sizeof (gushort) * gamma->size);
+  *blue = g_memdup2 (gamma->blue, sizeof (gushort) * gamma->size);
 
   XRRFreeGamma (gamma);
 }
@@ -1069,8 +1069,8 @@ gf_monitor_manager_xrandr_calculate_supported_scales (GfMonitorManager
   ensure_supported_monitor_scales (manager);
 
   *n_supported_scales = xrandr->n_supported_scales;
-  return g_memdup (xrandr->supported_scales,
-                   xrandr->n_supported_scales * sizeof (gfloat));
+  return g_memdup2 (xrandr->supported_scales,
+                    xrandr->n_supported_scales * sizeof (gfloat));
 }
 
 static GfMonitorManagerCapability
diff --git a/backends/gf-output-xrandr.c b/backends/gf-output-xrandr.c
index 940d8d3..230ec23 100644
--- a/backends/gf-output-xrandr.c
+++ b/backends/gf-output-xrandr.c
@@ -155,7 +155,7 @@ get_edid_property (Display  *xdisplay,
 
   if (actual_type == XA_INTEGER && actual_format == 8)
     {
-      result = g_memdup (prop, nitems);
+      result = g_memdup2 (prop, nitems);
       if (len)
         *len = nitems;
     }
diff --git a/configure.ac b/configure.ac
index 6669b26..d8c6f36 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,7 +93,7 @@ GTK_REQUIRED=3.22.0
 LIBGNOME_DESKTOP_REQUIRED=3.12.0
 LIBGNOME_PANEL_REQUIRED=3.35.2
 CANBERRA_REQUIRED=0.13
-GLIB_REQUIRED=2.44.0
+GLIB_REQUIRED=2.67.3
 GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=3.31.0
 POLKIT_AGENT_REQUIRED=0.97
 POLKIT_GOBJECT_REQUIRED=0.97


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]