Stop using g_memdup

Its deprecated in favor of g_memdup2
This commit is contained in:
Matthias Clasen 2024-09-25 10:47:45 +02:00
parent e407d22b1e
commit 8c04801f6a
9 changed files with 11 additions and 11 deletions

View File

@ -266,7 +266,7 @@ get_gl_texture_wl_buffer (GdkWaylandSubsurface *self,
gdk_texture_get_width (texture), gdk_texture_get_width (texture),
gdk_texture_get_height (texture), gdk_texture_get_height (texture),
&gl_buffer_listener, &gl_buffer_listener,
g_memdup (&gldata, sizeof (gldata))); g_memdup2 (&gldata, sizeof (gldata)));
} }
static struct wl_buffer * static struct wl_buffer *

View File

@ -389,7 +389,7 @@ create_image_desc (GdkWaylandColor *color,
} }
else 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));
} }
} }

View File

@ -711,7 +711,7 @@ gsk_gl_driver_cache_texture (GskGLDriver *self,
{ {
GskTextureKey *k; 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_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)); g_hash_table_insert (self->key_to_texture_id, k, GUINT_TO_POINTER (texture_id));

View File

@ -567,7 +567,7 @@ gsk_gl_device_use_program (GskGLDevice *self,
return; 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); glUseProgram (program_id);

View File

@ -780,7 +780,7 @@ gsk_gpu_frame_download_texture (GskGpuFrame *self,
image, image,
FALSE, FALSE,
do_download, do_download,
g_memdup (&(Download) { g_memdup2 (&(Download) {
.format = format, .format = format,
.color_state = color_state, .color_state = color_state,
.data = data, .data = data,

View File

@ -3422,7 +3422,7 @@ gsk_gpu_node_processor_add_fill_node (GskGpuNodeProcessor *self,
&self->scale, &self->scale,
&clip_bounds, &clip_bounds,
gsk_gpu_node_processor_fill_path, gsk_gpu_node_processor_fill_path,
g_memdup (&(FillData) { g_memdup2 (&(FillData) {
.path = gsk_path_ref (gsk_fill_node_get_path (node)), .path = gsk_path_ref (gsk_fill_node_get_path (node)),
.color = color, .color = color,
.fill_rule = gsk_fill_node_get_fill_rule (node) .fill_rule = gsk_fill_node_get_fill_rule (node)
@ -3525,7 +3525,7 @@ gsk_gpu_node_processor_add_stroke_node (GskGpuNodeProcessor *self,
&self->scale, &self->scale,
&clip_bounds, &clip_bounds,
gsk_gpu_node_processor_stroke_path, gsk_gpu_node_processor_stroke_path,
g_memdup (&(StrokeData) { g_memdup2 (&(StrokeData) {
.path = gsk_path_ref (gsk_stroke_node_get_path (node)), .path = gsk_path_ref (gsk_stroke_node_get_path (node)),
.color = color, .color = color,
.stroke = GSK_STROKE_INIT_COPY (gsk_stroke_node_get_stroke (node)) .stroke = GSK_STROKE_INIT_COPY (gsk_stroke_node_get_stroke (node))

View File

@ -772,7 +772,7 @@ gsk_vulkan_device_get_vk_render_pass (GskVulkanDevice *self,
NULL, NULL,
&render_pass); &render_pass);
cached_result = g_memdup (&cache_key, sizeof (RenderPassCacheKey)); cached_result = g_memdup2 (&cache_key, sizeof (RenderPassCacheKey));
cached_result->render_pass = render_pass; cached_result->render_pass = render_pass;
g_hash_table_insert (self->render_pass_cache, cached_result, cached_result); 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 (fragment_shader_name);
g_free (vertex_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; cached_result->vk_pipeline = vk_pipeline;
g_hash_table_add (self->pipeline_cache, cached_result); g_hash_table_add (self->pipeline_cache, cached_result);
gdk_display_vulkan_pipeline_cache_updated (display); gdk_display_vulkan_pipeline_cache_updated (display);

View File

@ -423,7 +423,7 @@ gsk_stroke_set_dash (GskStroke *self,
self->dash_length = dash_length; self->dash_length = dash_length;
g_free (self->dash); 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; self->n_dash = n_dash;
} }

View File

@ -42,7 +42,7 @@ struct _GskStroke
.line_cap = _stroke->line_cap, \ .line_cap = _stroke->line_cap, \
.line_join = _stroke->line_join, \ .line_join = _stroke->line_join, \
.miter_limit = _stroke->miter_limit, \ .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, \ .n_dash = _stroke->n_dash, \
.dash_length = _stroke->dash_length, \ .dash_length = _stroke->dash_length, \
.dash_offset = _stroke->dash_offset, \ .dash_offset = _stroke->dash_offset, \