cleanup: Don't use g_memmove()

Glib stopped providing any fallback implementations on systems without
memmove() all the way back in 2013. Since then, the symbol is a simple
macro around memmove(); use that function directly now that glib added
a deprecation warning.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/689
This commit is contained in:
Florian Müllner 2019-07-17 17:31:40 +02:00
parent 5ca0ef078d
commit 4fdefb5b2e
2 changed files with 4 additions and 4 deletions

View File

@ -171,7 +171,7 @@ clutter_text_buffer_normal_insert_text (ClutterTextBuffer *buffer,
/* Actual text insertion */ /* Actual text insertion */
at = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text; 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); memcpy (pv->normal_text + at, chars, n_bytes);
/* Book keeping */ /* Book keeping */
@ -201,7 +201,7 @@ clutter_text_buffer_normal_delete_text (ClutterTextBuffer *buffer,
start = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text; 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; 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_chars -= n_chars;
pv->normal_text_bytes -= (end - start); pv->normal_text_bytes -= (end - start);

View File

@ -566,7 +566,7 @@ meta_frame_layout_calc_geometry (MetaFrameLayout *layout,
} }
else else
g_memmove (&(rect->clickable), &(rect->visible), sizeof(rect->clickable)); memmove (&(rect->clickable), &(rect->visible), sizeof (rect->clickable));
x = rect->visible.x - layout->button_margin.left * scale; x = rect->visible.x - layout->button_margin.left * scale;
@ -613,7 +613,7 @@ meta_frame_layout_calc_geometry (MetaFrameLayout *layout,
rect->clickable.height = button_height + button_y; rect->clickable.height = button_height + button_y;
} }
else else
g_memmove (&(rect->clickable), &(rect->visible), sizeof(rect->clickable)); memmove (&(rect->clickable), &(rect->visible), sizeof (rect->clickable));
x = rect->visible.x + rect->visible.width + layout->button_margin.right * scale; x = rect->visible.x + rect->visible.width + layout->button_margin.right * scale;
if (i < n_left - 1) if (i < n_left - 1)