[atk] tests: Fix build on pre-C99
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [atk] tests: Fix build on pre-C99
- Date: Wed, 9 Aug 2017 07:40:12 +0000 (UTC)
commit 125dac528339267821dbbd6da9b19fe9949334e9
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Fri Aug 4 16:47:35 2017 +0800
tests: Fix build on pre-C99
Ensure that the variables are at the top of the block.
https://bugzilla.gnome.org/show_bug.cgi?id=785802
tests/testvalue.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/tests/testvalue.c b/tests/testvalue.c
index 7ec0a29..bad7168 100644
--- a/tests/testvalue.c
+++ b/tests/testvalue.c
@@ -119,9 +119,11 @@ test_value_get_value_and_text (AtkValue *value,
gdouble *current_value,
gchar **description)
{
+ TestValue *self;
+
g_return_if_fail (TEST_IS_VALUE (value));
- TestValue *self = TEST_VALUE (value);
+ self = TEST_VALUE (value);
if (current_value != NULL)
*current_value = self->value;
@@ -133,9 +135,11 @@ test_value_get_value_and_text (AtkValue *value,
AtkRange*
test_value_get_range (AtkValue *value)
{
+ AtkRange *result;
+
g_return_val_if_fail (TEST_IS_VALUE (value), NULL);
- AtkRange *result = atk_range_new (LOWER_LIMIT,
+ result = atk_range_new (LOWER_LIMIT,
UPPER_LIMIT,
NULL);
@@ -153,11 +157,11 @@ test_value_get_increment (AtkValue *value)
GSList*
test_value_get_sub_ranges (AtkValue *value)
{
- g_return_val_if_fail (TEST_IS_VALUE (value), NULL);
-
GSList *result = NULL;
AtkRange *range = NULL;
+ g_return_val_if_fail (TEST_IS_VALUE (value), NULL);
+
/* low */
range = atk_range_new (LOWER_LIMIT, LOW_THRESHOLD,
get_description (LOWER_LIMIT));
@@ -186,9 +190,11 @@ void
test_value_set_value (AtkValue *value,
double new_value)
{
+ TestValue *self;
+
g_return_if_fail (TEST_IS_VALUE (value));
- TestValue *self = TEST_VALUE (value);
+ self = TEST_VALUE (value);
if (new_value < LOWER_LIMIT)
new_value = LOWER_LIMIT;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]