gtk: replace g_memmove with memmove

This commit is contained in:
Daemonratte 2026-04-23 15:20:06 +02:00
commit b9a470028e
9 changed files with 19 additions and 19 deletions

View file

@ -492,8 +492,8 @@ quick_accel_add (GtkAccelGroup *accel_group,
/* insert at position, ref closure */
accel_group->priv_accels = g_renew (GtkAccelGroupEntry, accel_group->priv_accels, accel_group->n_accels);
g_memmove (accel_group->priv_accels + pos + 1, accel_group->priv_accels + pos,
(i - pos) * sizeof (accel_group->priv_accels[0]));
memmove (accel_group->priv_accels + pos + 1, accel_group->priv_accels + pos,
(i - pos) * sizeof (accel_group->priv_accels[0]));
accel_group->priv_accels[pos].key.accel_key = accel_key;
accel_group->priv_accels[pos].key.accel_mods = accel_mods;
accel_group->priv_accels[pos].key.accel_flags = accel_flags;
@ -556,8 +556,8 @@ quick_accel_remove (GtkAccelGroup *accel_group,
/* physically remove */
accel_group->n_accels -= 1;
g_memmove (entry, entry + 1,
(accel_group->n_accels - pos) * sizeof (accel_group->priv_accels[0]));
memmove (entry, entry + 1,
(accel_group->n_accels - pos) * sizeof (accel_group->priv_accels[0]));
/* and notify */
if (accel_quark)

View file

@ -169,7 +169,7 @@ gtk_entry_buffer_normal_insert_text (GtkEntryBuffer *buffer,
/* Actual text insertion */
at = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text;
g_memmove (pv->normal_text + at + n_bytes, pv->normal_text + at, pv->normal_text_bytes - at);
memmove (pv->normal_text + at + n_bytes, pv->normal_text + at, pv->normal_text_bytes - at);
memcpy (pv->normal_text + at, chars, n_bytes);
/* Book keeping */
@ -199,7 +199,7 @@ gtk_entry_buffer_normal_delete_text (GtkEntryBuffer *buffer,
start = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text;
end = g_utf8_offset_to_pointer (pv->normal_text, position + n_chars) - pv->normal_text;
g_memmove (pv->normal_text + start, pv->normal_text + end, pv->normal_text_bytes + 1 - end);
memmove (pv->normal_text + start, pv->normal_text + end, pv->normal_text_bytes + 1 - end);
pv->normal_text_chars -= n_chars;
pv->normal_text_bytes -= (end - start);

View file

@ -454,7 +454,7 @@ gtk_item_factory_from_path (const gchar *path)
return NULL;
}
fname = g_new (gchar, i + 2);
g_memmove (fname, path, i + 1);
memmove (fname, path, i + 1);
fname[i + 1] = 0;
item = g_hash_table_lookup (class->item_ht, fname);

View file

@ -2955,11 +2955,11 @@ move_gap (GtkText* text, guint index)
gint diff = index - text->gap_position;
if (text->use_wchar)
g_memmove (text->text.wc + text->gap_position,
memmove (text->text.wc + text->gap_position,
text->text.wc + text->gap_position + text->gap_size,
diff*sizeof (GdkWChar));
else
g_memmove (text->text.ch + text->gap_position,
memmove (text->text.ch + text->gap_position,
text->text.ch + text->gap_position + text->gap_size,
diff);
@ -2970,11 +2970,11 @@ move_gap (GtkText* text, guint index)
gint diff = text->gap_position - index;
if (text->use_wchar)
g_memmove (text->text.wc + index + text->gap_size,
memmove (text->text.wc + index + text->gap_size,
text->text.wc + index,
diff*sizeof (GdkWChar));
else
g_memmove (text->text.ch + index + text->gap_size,
memmove (text->text.ch + index + text->gap_size,
text->text.ch + index,
diff);
@ -3005,12 +3005,12 @@ make_forward_space (GtkText* text, guint len)
}
if (text->use_wchar)
g_memmove (text->text.wc + text->gap_position + text->gap_size + 2*len,
memmove (text->text.wc + text->gap_position + text->gap_size + 2*len,
text->text.wc + text->gap_position + text->gap_size,
(text->text_end - (text->gap_position + text->gap_size))
*sizeof(GdkWChar));
else
g_memmove (text->text.ch + text->gap_position + text->gap_size + 2*len,
memmove (text->text.ch + text->gap_position + text->gap_size + 2*len,
text->text.ch + text->gap_position + text->gap_size,
text->text_end - (text->gap_position + text->gap_size));

View file

@ -4373,7 +4373,7 @@ _gtk_text_buffer_get_line_log_attrs (GtkTextBuffer *buffer,
/* Not in cache; open up the first cache entry */
g_free (cache->entries[ATTR_CACHE_SIZE-1].attrs);
g_memmove (cache->entries + 1, cache->entries,
memmove (cache->entries + 1, cache->entries,
sizeof (CacheEntry) * (ATTR_CACHE_SIZE - 1));
cache->entries[0].line = line;

View file

@ -4848,7 +4848,7 @@ lines_window_back (LinesWindow *win)
}
/* Move lines to make room for first line. */
g_memmove (win->lines + 1, win->lines, win->n_lines * sizeof (gchar*));
memmove (win->lines + 1, win->lines, win->n_lines * sizeof (gchar*));
*win->lines = line_text;

View file

@ -488,13 +488,13 @@ gtk_tree_model_sort_row_changed (GtkTreeModel *s_model,
if (index < old_index)
{
g_memmove (level->array->data + ((index + 1)*sizeof (SortElt)),
memmove (level->array->data + ((index + 1)*sizeof (SortElt)),
level->array->data + ((index)*sizeof (SortElt)),
(old_index - index)* sizeof(SortElt));
}
else if (index > old_index)
{
g_memmove (level->array->data + ((old_index)*sizeof (SortElt)),
memmove (level->array->data + ((old_index)*sizeof (SortElt)),
level->array->data + ((old_index + 1)*sizeof (SortElt)),
(index - old_index)* sizeof(SortElt));
}

View file

@ -39,7 +39,7 @@ randomly_modify (const gchar *image, guint size)
int i;
guchar *img_copy = g_malloc (size);
g_memmove (img_copy, image, size);
memmove (img_copy, image, size);
for (i = 0; i < size / 4; i++)
{

View file

@ -704,7 +704,7 @@ fill_file_buffer (GtkTextBuffer *buffer, const char *filename)
gtk_text_buffer_insert (buffer, &iter, buf, leftover - buf);
remaining = (buf + remaining + count) - leftover;
g_memmove (buf, leftover, remaining);
memmove (buf, leftover, remaining);
if (remaining > 6 || count < to_read)
break;