object.element = cave->initial_border;
object.fill_element = cave->initial_border;
- cave->objects = g_list_prepend(cave->objects, g_memdup(&object, sizeof(object)));
+ cave->objects = g_list_prepend(cave->objects, getMemCopy(&object, sizeof(object)));
object.x1 = 19;
object.y1 = 0; /* 19, as it is also the border */
- cave->objects = g_list_prepend(cave->objects, g_memdup(&object, sizeof(object))); /* another */
+ cave->objects = g_list_prepend(cave->objects, getMemCopy(&object, sizeof(object))); /* another */
}
}
}
return NULL;
rows = checked_malloc((cave->h) * sizeof(gpointer));
- rows[0] = g_memdup (maplines[0], cell_size * cave->w * cave->h);
+ rows[0] = getMemCopy (maplines[0], cell_size * cave->w * cave->h);
for (y = 1; y < cave->h; y++)
rows[y] = (char *)rows[0] + cell_size * cave->w * y;
dest->objects = NULL; /* new empty list */
for (iter = src->objects; iter != NULL; iter = iter->next) /* do a deep copy */
- dest->objects = g_list_append(dest->objects, g_memdup (iter->data, sizeof (GdObject)));
+ dest->objects = g_list_append(dest->objects, getMemCopy (iter->data, sizeof (GdObject)));
}
/* copy replays */
{
GdReplay *rep;
- rep = g_memdup(orig, sizeof(GdReplay));
+ rep = getMemCopy(orig, sizeof(GdReplay));
/* replicate dynamic data */
rep->comment = getStringCopy(orig->comment);
{
object.element = gd_get_element_from_string(elem0);
- return g_memdup(&object, sizeof (GdObject));
+ return getMemCopy(&object, sizeof (GdObject));
}
return NULL;
{
object.element = gd_get_element_from_string(elem0);
- return g_memdup(&object, sizeof (GdObject));
+ return getMemCopy(&object, sizeof (GdObject));
}
return NULL;
object.type = GD_RECTANGLE;
object.element = gd_get_element_from_string (elem0);
- return g_memdup(&object, sizeof (GdObject));
+ return getMemCopy(&object, sizeof (GdObject));
}
return NULL;
object.element = gd_get_element_from_string (elem0);
object.fill_element = gd_get_element_from_string (elem1);
- return g_memdup(&object, sizeof (GdObject));
+ return getMemCopy(&object, sizeof (GdObject));
}
if (paramcount == 5)
{
object.element = object.fill_element = gd_get_element_from_string (elem0);
- return g_memdup(&object, sizeof (GdObject));
+ return getMemCopy(&object, sizeof (GdObject));
}
return NULL;
object.type = GD_RASTER;
object.element = gd_get_element_from_string (elem0);
- return g_memdup(&object, sizeof (GdObject));
+ return getMemCopy(&object, sizeof (GdObject));
}
return NULL;
object.element = gd_get_element_from_string (elem0);
object.fill_element = gd_get_element_from_string (elem1);
- return g_memdup(&object, sizeof (GdObject));
+ return getMemCopy(&object, sizeof (GdObject));
}
return NULL;
object.fill_element = gd_get_element_from_string (elem0);
object.element = gd_get_element_from_string (elem1);
- return g_memdup(&object, sizeof (GdObject));
+ return getMemCopy(&object, sizeof (GdObject));
}
return NULL;
object.fill_element = gd_get_element_from_string (elem0);
object.element = gd_get_element_from_string (elem1);
- return g_memdup(&object, sizeof (GdObject));
+ return getMemCopy(&object, sizeof (GdObject));
}
return NULL;
object.element = gd_get_element_from_string (elem0);
object.fill_element = gd_get_element_from_string (elem1);
- return g_memdup(&object, sizeof (GdObject));
+ return getMemCopy(&object, sizeof (GdObject));
}
return NULL;
if (l > 10 && l % 2 == 1)
object.element = gd_get_element_from_string(words[l - 1]);
- return g_memdup(&object, sizeof (GdObject));
+ return getMemCopy(&object, sizeof (GdObject));
}
/* COPY PASTE OBJECT */
else
Warn("invalid setting for copypaste flip property: %s", flip);
- return g_memdup(&object, sizeof(GdObject));
+ return getMemCopy(&object, sizeof(GdObject));
}
return NULL;