mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 06:56:14 +01:00
Merge branch 'wip/pwithnall/wfloat-conversion-macos' into 'main'
tests: Add some explicit float → int casts See merge request GNOME/glib!4277
This commit is contained in:
commit
3936eaaa39
@ -459,7 +459,7 @@ g_application_pack_option_entries (GApplication *application,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case G_OPTION_ARG_DOUBLE:
|
case G_OPTION_ARG_DOUBLE:
|
||||||
if (*(gdouble *) entry->arg_data)
|
if (*(gdouble *) entry->arg_data != 0.0)
|
||||||
value = g_variant_new_double (*(gdouble *) entry->arg_data);
|
value = g_variant_new_double (*(gdouble *) entry->arg_data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -837,7 +837,7 @@ cancellable_thread_cb (gpointer data)
|
|||||||
{
|
{
|
||||||
GCancellable *cancellable = data;
|
GCancellable *cancellable = data;
|
||||||
|
|
||||||
g_usleep (0.1 * G_USEC_PER_SEC);
|
g_usleep ((guint64) (0.1 * G_USEC_PER_SEC));
|
||||||
g_cancellable_cancel (cancellable);
|
g_cancellable_cancel (cancellable);
|
||||||
g_object_unref (cancellable);
|
g_object_unref (cancellable);
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ static void
|
|||||||
test_fork_timeout (void)
|
test_fork_timeout (void)
|
||||||
{
|
{
|
||||||
/* allow child to run for only a fraction of a second */
|
/* allow child to run for only a fraction of a second */
|
||||||
if (g_test_trap_fork (0.11 * 1000000, G_TEST_TRAP_DEFAULT))
|
if (g_test_trap_fork ((guint64) (0.11 * G_USEC_PER_SEC), G_TEST_TRAP_DEFAULT))
|
||||||
{
|
{
|
||||||
/* loop and sleep forever */
|
/* loop and sleep forever */
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
@ -399,7 +399,7 @@ test_subprocess_timeout (void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* allow child to run for only a fraction of a second */
|
/* allow child to run for only a fraction of a second */
|
||||||
g_test_trap_subprocess (NULL, 0.05 * G_USEC_PER_SEC, G_TEST_SUBPROCESS_DEFAULT);
|
g_test_trap_subprocess (NULL, (guint64) (0.05 * G_USEC_PER_SEC), G_TEST_SUBPROCESS_DEFAULT);
|
||||||
g_test_trap_assert_failed ();
|
g_test_trap_assert_failed ();
|
||||||
g_assert_true (g_test_trap_reached_timeout ());
|
g_assert_true (g_test_trap_reached_timeout ());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user