mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
Fix warnings from sparse. (#487491, Kjartan Maraas)
2007-10-21 Behdad Esfahbod <behdad@gnome.org> * glib/gdate.c (g_date_strftime): * glib/gmain.c (g_main_context_check): * glib/gregex.c (g_match_info_fetch_all), (g_regex_split_full): * glib/gthread.c (g_once_init_enter_impl), (g_once_init_leave): * glib/gthread.h: * glib/gutf8.c (g_utf16_to_utf8), (g_utf16_to_ucs4): * tests/errorcheck-mutex-test.c (lock_locked_mutex), (trylock_locked_mutex), (unlock_unlocked_mutex), (free_locked_mutex), (wait_on_unlocked_mutex), (wait_on_otherwise_locked_mutex), (timed_wait_on_unlocked_mutex), (timed_wait_on_otherwise_locked_mutex): Fix warnings from sparse. (#487491, Kjartan Maraas) svn path=/trunk/; revision=5792
This commit is contained in:
parent
f089429b85
commit
9df1f4fcc7
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
|||||||
|
2007-10-21 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
|
* glib/gdate.c (g_date_strftime):
|
||||||
|
* glib/gmain.c (g_main_context_check):
|
||||||
|
* glib/gregex.c (g_match_info_fetch_all), (g_regex_split_full):
|
||||||
|
* glib/gthread.c (g_once_init_enter_impl), (g_once_init_leave):
|
||||||
|
* glib/gthread.h:
|
||||||
|
* glib/gutf8.c (g_utf16_to_utf8), (g_utf16_to_ucs4):
|
||||||
|
* tests/errorcheck-mutex-test.c (lock_locked_mutex),
|
||||||
|
(trylock_locked_mutex), (unlock_unlocked_mutex),
|
||||||
|
(free_locked_mutex), (wait_on_unlocked_mutex),
|
||||||
|
(wait_on_otherwise_locked_mutex), (timed_wait_on_unlocked_mutex),
|
||||||
|
(timed_wait_on_otherwise_locked_mutex):
|
||||||
|
Fix warnings from sparse. (#487491, Kjartan Maraas)
|
||||||
|
|
||||||
2007-10-17 Matthias Clasen <mclasen@redhat.com>
|
2007-10-17 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* configure.in: Bump version
|
* configure.in: Bump version
|
||||||
|
@ -1823,8 +1823,8 @@ g_date_strftime (gchar *s,
|
|||||||
|
|
||||||
g_return_val_if_fail (g_date_valid (d), 0);
|
g_return_val_if_fail (g_date_valid (d), 0);
|
||||||
g_return_val_if_fail (slen > 0, 0);
|
g_return_val_if_fail (slen > 0, 0);
|
||||||
g_return_val_if_fail (format != 0, 0);
|
g_return_val_if_fail (format != NULL, 0);
|
||||||
g_return_val_if_fail (s != 0, 0);
|
g_return_val_if_fail (s != NULL, 0);
|
||||||
|
|
||||||
g_date_to_struct_tm (d, &tm);
|
g_date_to_struct_tm (d, &tm);
|
||||||
|
|
||||||
|
@ -2529,7 +2529,7 @@ g_main_context_check (GMainContext *context,
|
|||||||
if (context->poll_changed)
|
if (context->poll_changed)
|
||||||
{
|
{
|
||||||
UNLOCK_CONTEXT (context);
|
UNLOCK_CONTEXT (context);
|
||||||
return 0;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif /* G_THREADS_ENABLED */
|
#endif /* G_THREADS_ENABLED */
|
||||||
|
|
||||||
|
@ -761,7 +761,7 @@ g_match_info_fetch_all (const GMatchInfo *match_info)
|
|||||||
gchar **result;
|
gchar **result;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
g_return_val_if_fail (match_info != NULL, FALSE);
|
g_return_val_if_fail (match_info != NULL, NULL);
|
||||||
|
|
||||||
if (match_info->matches < 0)
|
if (match_info->matches < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1676,7 +1676,7 @@ g_regex_split_full (const GRegex *regex,
|
|||||||
i = 0;
|
i = 0;
|
||||||
for (last = g_list_last (list); last; last = g_list_previous (last))
|
for (last = g_list_last (list); last; last = g_list_previous (last))
|
||||||
string_list[i++] = last->data;
|
string_list[i++] = last->data;
|
||||||
string_list[i] = 0;
|
string_list[i] = NULL;
|
||||||
g_list_free (list);
|
g_list_free (list);
|
||||||
|
|
||||||
return string_list;
|
return string_list;
|
||||||
|
@ -204,7 +204,7 @@ g_once_init_enter_impl (volatile gsize *value_location)
|
|||||||
{
|
{
|
||||||
gboolean need_init = FALSE;
|
gboolean need_init = FALSE;
|
||||||
g_mutex_lock (g_once_mutex);
|
g_mutex_lock (g_once_mutex);
|
||||||
if (g_atomic_pointer_get ((void**) value_location) == 0)
|
if (g_atomic_pointer_get ((void**) value_location) == NULL)
|
||||||
{
|
{
|
||||||
if (!g_slist_find (g_once_init_list, (void*) value_location))
|
if (!g_slist_find (g_once_init_list, (void*) value_location))
|
||||||
{
|
{
|
||||||
@ -224,7 +224,7 @@ void
|
|||||||
g_once_init_leave (volatile gsize *value_location,
|
g_once_init_leave (volatile gsize *value_location,
|
||||||
gsize initialization_value)
|
gsize initialization_value)
|
||||||
{
|
{
|
||||||
g_return_if_fail (g_atomic_pointer_get ((void**) value_location) == 0);
|
g_return_if_fail (g_atomic_pointer_get ((void**) value_location) == NULL);
|
||||||
g_return_if_fail (initialization_value != 0);
|
g_return_if_fail (initialization_value != 0);
|
||||||
g_return_if_fail (g_once_init_list != NULL);
|
g_return_if_fail (g_once_init_list != NULL);
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ void g_once_init_leave (volatile gsize *value_location,
|
|||||||
G_INLINE_FUNC gboolean
|
G_INLINE_FUNC gboolean
|
||||||
g_once_init_enter (volatile gsize *value_location)
|
g_once_init_enter (volatile gsize *value_location)
|
||||||
{
|
{
|
||||||
if G_LIKELY (g_atomic_pointer_get ((void*volatile*) value_location) != 0)
|
if G_LIKELY (g_atomic_pointer_get ((void*volatile*) value_location) != NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else
|
else
|
||||||
return g_once_init_enter_impl (value_location);
|
return g_once_init_enter_impl (value_location);
|
||||||
|
@ -1095,7 +1095,7 @@ g_utf16_to_utf8 (const gunichar2 *str,
|
|||||||
gint n_bytes;
|
gint n_bytes;
|
||||||
gunichar high_surrogate;
|
gunichar high_surrogate;
|
||||||
|
|
||||||
g_return_val_if_fail (str != 0, NULL);
|
g_return_val_if_fail (str != NULL, NULL);
|
||||||
|
|
||||||
n_bytes = 0;
|
n_bytes = 0;
|
||||||
in = str;
|
in = str;
|
||||||
@ -1236,7 +1236,7 @@ g_utf16_to_ucs4 (const gunichar2 *str,
|
|||||||
gint n_bytes;
|
gint n_bytes;
|
||||||
gunichar high_surrogate;
|
gunichar high_surrogate;
|
||||||
|
|
||||||
g_return_val_if_fail (str != 0, NULL);
|
g_return_val_if_fail (str != NULL, NULL);
|
||||||
|
|
||||||
n_bytes = 0;
|
n_bytes = 0;
|
||||||
in = str;
|
in = str;
|
||||||
|
@ -15,7 +15,7 @@ locking_thread (gpointer mutex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lock_locked_mutex ()
|
lock_locked_mutex (void)
|
||||||
{
|
{
|
||||||
GMutex* mutex = g_mutex_new ();
|
GMutex* mutex = g_mutex_new ();
|
||||||
g_mutex_lock (mutex);
|
g_mutex_lock (mutex);
|
||||||
@ -23,7 +23,7 @@ lock_locked_mutex ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
trylock_locked_mutex ()
|
trylock_locked_mutex (void)
|
||||||
{
|
{
|
||||||
GMutex* mutex = g_mutex_new ();
|
GMutex* mutex = g_mutex_new ();
|
||||||
g_mutex_lock (mutex);
|
g_mutex_lock (mutex);
|
||||||
@ -31,7 +31,7 @@ trylock_locked_mutex ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
unlock_unlocked_mutex ()
|
unlock_unlocked_mutex (void)
|
||||||
{
|
{
|
||||||
GMutex* mutex = g_mutex_new ();
|
GMutex* mutex = g_mutex_new ();
|
||||||
g_mutex_lock (mutex);
|
g_mutex_lock (mutex);
|
||||||
@ -40,7 +40,7 @@ unlock_unlocked_mutex ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_locked_mutex ()
|
free_locked_mutex (void)
|
||||||
{
|
{
|
||||||
GMutex* mutex = g_mutex_new ();
|
GMutex* mutex = g_mutex_new ();
|
||||||
g_mutex_lock (mutex);
|
g_mutex_lock (mutex);
|
||||||
@ -48,7 +48,7 @@ free_locked_mutex ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wait_on_unlocked_mutex ()
|
wait_on_unlocked_mutex (void)
|
||||||
{
|
{
|
||||||
GMutex* mutex = g_mutex_new ();
|
GMutex* mutex = g_mutex_new ();
|
||||||
GCond* cond = g_cond_new ();
|
GCond* cond = g_cond_new ();
|
||||||
@ -56,7 +56,7 @@ wait_on_unlocked_mutex ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wait_on_otherwise_locked_mutex ()
|
wait_on_otherwise_locked_mutex (void)
|
||||||
{
|
{
|
||||||
GMutex* mutex = g_mutex_new ();
|
GMutex* mutex = g_mutex_new ();
|
||||||
GCond* cond = g_cond_new ();
|
GCond* cond = g_cond_new ();
|
||||||
@ -67,7 +67,7 @@ wait_on_otherwise_locked_mutex ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
timed_wait_on_unlocked_mutex ()
|
timed_wait_on_unlocked_mutex (void)
|
||||||
{
|
{
|
||||||
GMutex* mutex = g_mutex_new ();
|
GMutex* mutex = g_mutex_new ();
|
||||||
GCond* cond = g_cond_new ();
|
GCond* cond = g_cond_new ();
|
||||||
@ -75,7 +75,7 @@ timed_wait_on_unlocked_mutex ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
timed_wait_on_otherwise_locked_mutex ()
|
timed_wait_on_otherwise_locked_mutex (void)
|
||||||
{
|
{
|
||||||
GMutex* mutex = g_mutex_new ();
|
GMutex* mutex = g_mutex_new ();
|
||||||
GCond* cond = g_cond_new ();
|
GCond* cond = g_cond_new ();
|
||||||
|
Loading…
Reference in New Issue
Block a user