Require C90 compliance

Assume all supported platforms implement C90, and therefore they
(correctly) implement atexit(), memmove(), setlocale(), strerror(),
and vprintf(), and have <float.h> and <limits.h>.

(Also remove the configure check testing that "do ... while (0)" works
correctly; the non-do/while-based version of G_STMT_START and
G_STMT_END was removed years ago, but the check remained. Also, remove
some checks that configure.ac claimed were needed for libcharset, but
aren't actually used.)

Note that removing the g_memmove() function is not an ABI break even
on systems where g_memmove() was previously not a macro, because it
was never marked GLIB_AVAILABLE_IN_ALL or listed in glib.symbols, so
it would have been glib-internal since 2004.

https://bugzilla.gnome.org/show_bug.cgi?id=710519
This commit is contained in:
Dan Winship
2013-10-19 13:03:58 -04:00
parent 7f5b2901cf
commit 6e4a7fca43
16 changed files with 80 additions and 286 deletions

View File

@@ -1525,8 +1525,8 @@ type_iface_add_prerequisite_W (TypeNode *iface,
IFACE_NODE_PREREQUISITES (iface),
IFACE_NODE_N_PREREQUISITES (iface));
prerequisites = IFACE_NODE_PREREQUISITES (iface);
g_memmove (prerequisites + i + 1, prerequisites + i,
sizeof (prerequisites[0]) * (IFACE_NODE_N_PREREQUISITES (iface) - i - 1));
memmove (prerequisites + i + 1, prerequisites + i,
sizeof (prerequisites[0]) * (IFACE_NODE_N_PREREQUISITES (iface) - i - 1));
prerequisites[i] = prerequisite_type;
/* we want to get notified when prerequisites get added to prerequisite_node */
@@ -2495,9 +2495,9 @@ g_type_remove_class_cache_func (gpointer cache_data,
static_class_cache_funcs[i].cache_func == cache_func)
{
static_n_class_cache_funcs--;
g_memmove (static_class_cache_funcs + i,
static_class_cache_funcs + i + 1,
sizeof (static_class_cache_funcs[0]) * (static_n_class_cache_funcs - i));
memmove (static_class_cache_funcs + i,
static_class_cache_funcs + i + 1,
sizeof (static_class_cache_funcs[0]) * (static_n_class_cache_funcs - i));
static_class_cache_funcs = g_renew (ClassCacheFunc, static_class_cache_funcs, static_n_class_cache_funcs);
found_it = TRUE;
break;
@@ -2569,9 +2569,9 @@ g_type_remove_interface_check (gpointer check_data,
static_iface_check_funcs[i].check_func == check_func)
{
static_n_iface_check_funcs--;
g_memmove (static_iface_check_funcs + i,
static_iface_check_funcs + i + 1,
sizeof (static_iface_check_funcs[0]) * (static_n_iface_check_funcs - i));
memmove (static_iface_check_funcs + i,
static_iface_check_funcs + i + 1,
sizeof (static_iface_check_funcs[0]) * (static_n_iface_check_funcs - i));
static_iface_check_funcs = g_renew (IFaceCheckFunc, static_iface_check_funcs, static_n_iface_check_funcs);
found_it = TRUE;
break;
@@ -3724,7 +3724,7 @@ type_set_qdata_W (TypeNode *node,
for (i = 0; i < gdata->n_qdatas - 1; i++)
if (qdata[i].quark > quark)
break;
g_memmove (qdata + i + 1, qdata + i, sizeof (qdata[0]) * (gdata->n_qdatas - i - 1));
memmove (qdata + i + 1, qdata + i, sizeof (qdata[0]) * (gdata->n_qdatas - i - 1));
qdata[i].quark = quark;
qdata[i].data = data;
}

View File

@@ -282,8 +282,8 @@ g_value_array_insert (GValueArray *value_array,
i = value_array->n_values;
value_array_grow (value_array, value_array->n_values + 1, FALSE);
if (index + 1 < value_array->n_values)
g_memmove (value_array->values + index + 1, value_array->values + index,
(i - index) * sizeof (value_array->values[0]));
memmove (value_array->values + index + 1, value_array->values + index,
(i - index) * sizeof (value_array->values[0]));
memset (value_array->values + index, 0, sizeof (value_array->values[0]));
if (value)
{
@@ -317,8 +317,8 @@ g_value_array_remove (GValueArray *value_array,
g_value_unset (value_array->values + index);
value_array->n_values--;
if (index < value_array->n_values)
g_memmove (value_array->values + index, value_array->values + index + 1,
(value_array->n_values - index) * sizeof (value_array->values[0]));
memmove (value_array->values + index, value_array->values + index + 1,
(value_array->n_values - index) * sizeof (value_array->values[0]));
value_array_shrink (value_array);
if (value_array->n_prealloced > value_array->n_values)
memset (value_array->values + value_array->n_values, 0, sizeof (value_array->values[0]));