#include "gtkversion.h"
#include "gdkprofilerprivate.h"
+/* XXX: For g_memdup2() */
+#include "gtkprivate.h"
+
#include <gio/gio.h>
#include <string.h>
subparser->child = child;
subparser->tagname = g_strdup (element_name);
subparser->start = element_name;
- subparser->parser = g_memdup (parser, sizeof (GtkBuildableParser));
+ subparser->parser = g_memdup2 (parser, sizeof (GtkBuildableParser));
subparser->data = user_data;
return subparser;
#include "gtkcssstylepropertyprivate.h"
#include "gtkstylepropertyprivate.h"
+/* XXX: For g_memdup2() */
+#include "gtkprivate.h"
+
#include <stdlib.h>
#include <string.h>
resolved = gtk_css_keyframes_alloc ();
resolved->n_keyframes = keyframes->n_keyframes;
- resolved->keyframe_progress = g_memdup (keyframes->keyframe_progress, keyframes->n_keyframes * sizeof (double));
+ resolved->keyframe_progress = g_memdup2 (keyframes->keyframe_progress, keyframes->n_keyframes * sizeof (double));
resolved->n_properties = keyframes->n_properties;
- resolved->property_ids = g_memdup (keyframes->property_ids, keyframes->n_properties * sizeof (guint));
+ resolved->property_ids = g_memdup2 (keyframes->property_ids, keyframes->n_properties * sizeof (guint));
resolved->values = g_new0 (GtkCssValue *, resolved->n_keyframes * resolved->n_properties);
for (p = 0; p < resolved->n_properties; p++)
#include "gtkcssnodedeclarationprivate.h"
+/* XXX: For g_memdup2() */
+#include "gtkprivate.h"
+
#include <string.h>
struct _GtkCssNodeDeclaration {
(*decl)->refcount--;
- *decl = g_memdup (*decl, sizeof_this_node (*decl));
+ *decl = g_memdup2 (*decl, sizeof_this_node (*decl));
(*decl)->refcount = 1;
}
#include "gtkexpression.h"
+/* XXX: For g_memdup2() */
+#include "gtkprivate.h"
+
#include <gobject/gvaluecollector.h>
/**
info.base_finalize = NULL;
info.class_init = gtk_expression_generic_class_init;
info.class_finalize = NULL;
- info.class_data = g_memdup (type_info, sizeof (GtkExpressionTypeInfo));
+ info.class_data = g_memdup2 (type_info, sizeof (GtkExpressionTypeInfo));
info.instance_size = type_info->instance_size;
info.n_preallocs = 0;
gtk_range_calc_marks (range);
if (values)
- *values = g_memdup (priv->mark_pos, priv->n_marks * sizeof (int));
+ *values = g_memdup2 (priv->mark_pos, priv->n_marks * sizeof (int));
return priv->n_marks;
}
#include "gtkcssnumbervalueprivate.h"
#include "gtkcsstypesprivate.h"
+/* XXX: For g_memdup2() */
+#include "gtkprivate.h"
+
#include <string.h>
typedef struct {
cairo_arc (tmp, 0.0, 0.0, 1.0, angle1, angle2);
arc = fixup_path (cairo_copy_path (tmp));
- g_hash_table_insert (arc_path_cache, g_memdup (&key, sizeof (key)), arc);
+ g_hash_table_insert (arc_path_cache, g_memdup2 (&key, sizeof (key)), arc);
cairo_destroy (tmp);
cairo_surface_destroy (surface);
#include "gtktreednd.h"
#include "gtkintl.h"
+#include "gtkprivate.h"
/**
* SECTION:gtktreednd
static GtkTreeRowData *
gtk_tree_row_data_copy (GtkTreeRowData *src)
{
- return g_memdup (src, sizeof (GtkTreeRowData) + strlen (src->path) + 1 -
+ return g_memdup2 (src, sizeof (GtkTreeRowData) + strlen (src->path) + 1 -
(sizeof (GtkTreeRowData) - G_STRUCT_OFFSET (GtkTreeRowData, path)));
}
#define _CUPS_MAP_ATTR_INT(attr, v, a) {if (!g_ascii_strcasecmp (attr->name, (a))) v = attr->values[0].integer;}
#define _CUPS_MAP_ATTR_STR(attr, v, a) {if (!g_ascii_strcasecmp (attr->name, (a))) v = attr->values[0].string.text;}
+#if !GLIB_CHECK_VERSION (2, 67, 3)
+# define g_memdup2(mem,size) g_memdup((mem), (size))
+#endif
+
typedef void (* GtkPrintCupsResponseCallbackFunc) (GtkPrintBackend *print_backend,
GtkCupsResult *result,
gpointer user_data);
time_t rawtime;
time (&rawtime);
- actual_utc_time = g_memdup (gmtime (&rawtime), sizeof (struct tm));
- actual_local_time = g_memdup (localtime (&rawtime), sizeof (struct tm));
+ actual_utc_time = g_memdup2 (gmtime (&rawtime), sizeof (struct tm));
+ actual_local_time = g_memdup2 (localtime (&rawtime), sizeof (struct tm));
diff_time.tm_hour = actual_utc_time->tm_hour - actual_local_time->tm_hour;
diff_time.tm_min = actual_utc_time->tm_min - actual_local_time->tm_min;