[glib] tests/refcount/signals: don't shadow rand()



commit 11a6e19e07a86e8c0698c5109083a0c3505cb394
Author: Ross Burton <ross burton intel com>
Date:   Mon Nov 14 16:56:40 2016 +0000

    tests/refcount/signals: don't shadow rand()
    
    rand() is in the C library and some C libraries (uclibc, for example) end up
    with rand() defined even if stdlib.h isn't included explicitly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774421

 tests/refcount/signals.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tests/refcount/signals.c b/tests/refcount/signals.c
index 2a63795..d1a0447 100644
--- a/tests/refcount/signals.c
+++ b/tests/refcount/signals.c
@@ -12,7 +12,7 @@
 #define MY_IS_TEST_CLASS(tclass)   (G_TYPE_CHECK_CLASS_TYPE ((tclass), G_TYPE_TEST))
 #define MY_TEST_GET_CLASS(test)    (G_TYPE_INSTANCE_GET_CLASS ((test), G_TYPE_TEST, GTestClass))
 
-static GRand *rand;
+static GRand *grand;
 
 typedef struct _GTest GTest;
 typedef struct _GTestClass GTestClass;
@@ -87,7 +87,7 @@ my_test_get_type (void)
       NULL
     };
 
-    rand = g_rand_new();
+    grand = g_rand_new();
 
     test_type = g_type_register_static (G_TYPE_OBJECT, "GTest",
         &test_info, 0);
@@ -221,7 +221,7 @@ my_test_do_signal3 (GTest * test)
 static void
 my_test_do_prop (GTest * test)
 {
-  test->value = g_rand_int (rand);
+  test->value = g_rand_int (grand);
   g_object_notify (G_OBJECT (test), "test-prop");
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]