mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 19:36:18 +01:00
Whitespace cleanup
This commit is contained in:
parent
70a1981532
commit
4832289bc0
@ -172,7 +172,8 @@ static void crcinit(void)
|
||||
int i, j;
|
||||
guint sum;
|
||||
|
||||
for (i = 0; i < 128; ++i) {
|
||||
for (i = 0; i < 128; ++i)
|
||||
{
|
||||
sum = 0L;
|
||||
for (j = 7 - 1; j >= 0; --j)
|
||||
if (i & (1 << j))
|
||||
@ -184,7 +185,8 @@ static void crcinit(void)
|
||||
/*
|
||||
- hash - Honeyman's nice hashing function
|
||||
*/
|
||||
static guint honeyman_hash(gconstpointer key)
|
||||
static guint
|
||||
honeyman_hash (gconstpointer key)
|
||||
{
|
||||
const gchar *name = (const gchar *) key;
|
||||
gint size;
|
||||
@ -195,28 +197,30 @@ static guint honeyman_hash(gconstpointer key)
|
||||
|
||||
size = strlen (name);
|
||||
|
||||
while (size--) {
|
||||
while (size--)
|
||||
sum = (sum >> 7) ^ CrcTable[(sum ^ (*name++)) & 0x7f];
|
||||
}
|
||||
|
||||
return(sum);
|
||||
return sum;
|
||||
}
|
||||
|
||||
|
||||
static gboolean second_hash_cmp (gconstpointer a, gconstpointer b)
|
||||
static gboolean
|
||||
second_hash_cmp (gconstpointer a, gconstpointer b)
|
||||
{
|
||||
return (strcmp (a, b) == 0);
|
||||
return strcmp (a, b) == 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static guint one_hash(gconstpointer key)
|
||||
static guint
|
||||
one_hash (gconstpointer key)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static void not_even_foreach (gpointer key,
|
||||
static void
|
||||
not_even_foreach (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data)
|
||||
{
|
||||
@ -240,7 +244,8 @@ static void not_even_foreach (gpointer key,
|
||||
}
|
||||
|
||||
|
||||
static gboolean remove_even_foreach (gpointer key,
|
||||
static gboolean
|
||||
remove_even_foreach (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data)
|
||||
{
|
||||
@ -265,7 +270,8 @@ static gboolean remove_even_foreach (gpointer key,
|
||||
|
||||
|
||||
|
||||
static void second_hash_test (gconstpointer d)
|
||||
static void
|
||||
second_hash_test (gconstpointer d)
|
||||
{
|
||||
gboolean simple_hash = GPOINTER_TO_INT (d);
|
||||
|
||||
@ -342,7 +348,8 @@ static void second_hash_test (gconstpointer d)
|
||||
g_hash_table_destroy (h);
|
||||
}
|
||||
|
||||
static gboolean find_first (gpointer key,
|
||||
static gboolean
|
||||
find_first (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data)
|
||||
{
|
||||
@ -352,7 +359,8 @@ static gboolean find_first (gpointer key,
|
||||
}
|
||||
|
||||
|
||||
static void direct_hash_test (void)
|
||||
static void
|
||||
direct_hash_test (void)
|
||||
{
|
||||
gint i, rc;
|
||||
GHashTable *h;
|
||||
@ -360,17 +368,14 @@ static void direct_hash_test (void)
|
||||
h = g_hash_table_new (NULL, NULL);
|
||||
g_assert (h != NULL);
|
||||
for (i = 1; i <= 20; i++)
|
||||
{
|
||||
g_hash_table_insert (h, GINT_TO_POINTER (i),
|
||||
GINT_TO_POINTER (i + 42));
|
||||
}
|
||||
|
||||
g_assert (g_hash_table_size (h) == 20);
|
||||
|
||||
for (i = 1; i <= 20; i++)
|
||||
{
|
||||
rc = GPOINTER_TO_INT (
|
||||
g_hash_table_lookup (h, GINT_TO_POINTER (i)));
|
||||
rc = GPOINTER_TO_INT (g_hash_table_lookup (h, GINT_TO_POINTER (i)));
|
||||
|
||||
g_assert (rc != 0);
|
||||
g_assert ((rc - 42) == i);
|
||||
@ -379,7 +384,8 @@ static void direct_hash_test (void)
|
||||
g_hash_table_destroy (h);
|
||||
}
|
||||
|
||||
static void int64_hash_test (void)
|
||||
static void
|
||||
int64_hash_test (void)
|
||||
{
|
||||
gint i, rc;
|
||||
GHashTable *h;
|
||||
@ -407,7 +413,8 @@ static void int64_hash_test (void)
|
||||
g_hash_table_destroy (h);
|
||||
}
|
||||
|
||||
static void double_hash_test (void)
|
||||
static void
|
||||
double_hash_test (void)
|
||||
{
|
||||
gint i, rc;
|
||||
GHashTable *h;
|
||||
@ -443,7 +450,8 @@ string_free (gpointer data)
|
||||
g_string_free (s, TRUE);
|
||||
}
|
||||
|
||||
static void string_hash_test (void)
|
||||
static void
|
||||
string_hash_test (void)
|
||||
{
|
||||
gint i, rc;
|
||||
GHashTable *h;
|
||||
|
Loading…
Reference in New Issue
Block a user