mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 09:40:10 +00:00
Stop using g_memdup
Its deprecated in favor of g_memdup2
This commit is contained in:
parent
e407d22b1e
commit
8c04801f6a
@ -266,7 +266,7 @@ get_gl_texture_wl_buffer (GdkWaylandSubsurface *self,
|
||||
gdk_texture_get_width (texture),
|
||||
gdk_texture_get_height (texture),
|
||||
&gl_buffer_listener,
|
||||
g_memdup (&gldata, sizeof (gldata)));
|
||||
g_memdup2 (&gldata, sizeof (gldata)));
|
||||
}
|
||||
|
||||
static struct wl_buffer *
|
||||
|
@ -389,7 +389,7 @@ create_image_desc (GdkWaylandColor *color,
|
||||
}
|
||||
else
|
||||
{
|
||||
xx_image_description_v4_add_listener (desc, &cs_image_desc_listener, g_memdup (&data, sizeof data));
|
||||
xx_image_description_v4_add_listener (desc, &cs_image_desc_listener, g_memdup2 (&data, sizeof data));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -711,7 +711,7 @@ gsk_gl_driver_cache_texture (GskGLDriver *self,
|
||||
{
|
||||
GskTextureKey *k;
|
||||
|
||||
k = g_memdup (key, sizeof *key);
|
||||
k = g_memdup2 (key, sizeof *key);
|
||||
|
||||
g_assert (!g_hash_table_contains (self->texture_id_to_key, GUINT_TO_POINTER (texture_id)));
|
||||
g_hash_table_insert (self->key_to_texture_id, k, GUINT_TO_POINTER (texture_id));
|
||||
|
@ -567,7 +567,7 @@ gsk_gl_device_use_program (GskGLDevice *self,
|
||||
return;
|
||||
}
|
||||
|
||||
g_hash_table_insert (self->gl_programs, g_memdup (&key, sizeof (GLProgramKey)), GUINT_TO_POINTER (program_id));
|
||||
g_hash_table_insert (self->gl_programs, g_memdup2 (&key, sizeof (GLProgramKey)), GUINT_TO_POINTER (program_id));
|
||||
|
||||
glUseProgram (program_id);
|
||||
|
||||
|
@ -780,7 +780,7 @@ gsk_gpu_frame_download_texture (GskGpuFrame *self,
|
||||
image,
|
||||
FALSE,
|
||||
do_download,
|
||||
g_memdup (&(Download) {
|
||||
g_memdup2 (&(Download) {
|
||||
.format = format,
|
||||
.color_state = color_state,
|
||||
.data = data,
|
||||
|
@ -3422,7 +3422,7 @@ gsk_gpu_node_processor_add_fill_node (GskGpuNodeProcessor *self,
|
||||
&self->scale,
|
||||
&clip_bounds,
|
||||
gsk_gpu_node_processor_fill_path,
|
||||
g_memdup (&(FillData) {
|
||||
g_memdup2 (&(FillData) {
|
||||
.path = gsk_path_ref (gsk_fill_node_get_path (node)),
|
||||
.color = color,
|
||||
.fill_rule = gsk_fill_node_get_fill_rule (node)
|
||||
@ -3525,7 +3525,7 @@ gsk_gpu_node_processor_add_stroke_node (GskGpuNodeProcessor *self,
|
||||
&self->scale,
|
||||
&clip_bounds,
|
||||
gsk_gpu_node_processor_stroke_path,
|
||||
g_memdup (&(StrokeData) {
|
||||
g_memdup2 (&(StrokeData) {
|
||||
.path = gsk_path_ref (gsk_stroke_node_get_path (node)),
|
||||
.color = color,
|
||||
.stroke = GSK_STROKE_INIT_COPY (gsk_stroke_node_get_stroke (node))
|
||||
|
@ -772,7 +772,7 @@ gsk_vulkan_device_get_vk_render_pass (GskVulkanDevice *self,
|
||||
NULL,
|
||||
&render_pass);
|
||||
|
||||
cached_result = g_memdup (&cache_key, sizeof (RenderPassCacheKey));
|
||||
cached_result = g_memdup2 (&cache_key, sizeof (RenderPassCacheKey));
|
||||
cached_result->render_pass = render_pass;
|
||||
|
||||
g_hash_table_insert (self->render_pass_cache, cached_result, cached_result);
|
||||
@ -1024,7 +1024,7 @@ gsk_vulkan_device_get_vk_pipeline (GskVulkanDevice *self,
|
||||
g_free (fragment_shader_name);
|
||||
g_free (vertex_shader_name);
|
||||
|
||||
cached_result = g_memdup (&cache_key, sizeof (PipelineCacheKey));
|
||||
cached_result = g_memdup2 (&cache_key, sizeof (PipelineCacheKey));
|
||||
cached_result->vk_pipeline = vk_pipeline;
|
||||
g_hash_table_add (self->pipeline_cache, cached_result);
|
||||
gdk_display_vulkan_pipeline_cache_updated (display);
|
||||
|
@ -423,7 +423,7 @@ gsk_stroke_set_dash (GskStroke *self,
|
||||
|
||||
self->dash_length = dash_length;
|
||||
g_free (self->dash);
|
||||
self->dash = g_memdup (dash, sizeof (gfloat) * n_dash);
|
||||
self->dash = g_memdup2 (dash, sizeof (gfloat) * n_dash);
|
||||
self->n_dash = n_dash;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ struct _GskStroke
|
||||
.line_cap = _stroke->line_cap, \
|
||||
.line_join = _stroke->line_join, \
|
||||
.miter_limit = _stroke->miter_limit, \
|
||||
.dash = g_memdup (_stroke->dash, _stroke->n_dash * sizeof (float)), \
|
||||
.dash = g_memdup2 (_stroke->dash, _stroke->n_dash * sizeof (float)), \
|
||||
.n_dash = _stroke->n_dash, \
|
||||
.dash_length = _stroke->dash_length, \
|
||||
.dash_offset = _stroke->dash_offset, \
|
||||
|
Loading…
Reference in New Issue
Block a user