Blame 0090-testsuite-fix-parse_numbers-on-i686.patch

3a204fb
From 17c7912c49c0135e232fe669e561808bc5373db2 Mon Sep 17 00:00:00 2001
3a204fb
From: Jakub Filak <jfilak@redhat.com>
3a204fb
Date: Wed, 10 Jun 2015 08:11:29 +0200
3a204fb
Subject: [PATCH] testsuite: fix parse_numbers on i686
3a204fb
3a204fb
Signed-off-by: Jakub Filak <jfilak@redhat.com>
3a204fb
---
3a204fb
 tests/xfuncs.at | 26 +++++++++++++-------------
3a204fb
 1 file changed, 13 insertions(+), 13 deletions(-)
3a204fb
3a204fb
diff --git a/tests/xfuncs.at b/tests/xfuncs.at
3a204fb
index dbcc602..222824c 100644
3a204fb
--- a/tests/xfuncs.at
3a204fb
+++ b/tests/xfuncs.at
3a204fb
@@ -86,23 +86,23 @@ int main(void)
3a204fb
         assert(try_atou("foo54321", &uint_value) != 0);
3a204fb
         assert(uint_value == 12345);
3a204fb
 
3a204fb
-        char buf[sizeof(unsigned long) * 3 + 1];
3a204fb
+        char buf[sizeof(unsigned long long) * 3 + 1];
3a204fb
 
3a204fb
-        snprintf(buf, sizeof(buf), "%lu", 1LU + UINT_MAX);
3a204fb
+        snprintf(buf, sizeof(buf), "%llu", 1LLU + UINT_MAX);
3a204fb
         assert(try_atou(buf, &uint_value) != 0 || !"Above UINT_MAX");
3a204fb
         assert(uint_value == 12345);
3a204fb
 
3a204fb
         assert(try_atou("-1", &uint_value) != 0);
3a204fb
         assert(uint_value == 12345);
3a204fb
 
3a204fb
-        snprintf(buf, sizeof(buf), "%lu", (long unsigned)UINT_MAX);
3a204fb
+        snprintf(buf, sizeof(buf), "%llu", (unsigned long long)UINT_MAX);
3a204fb
         assert(try_atou(buf, &uint_value) == 0);
3a204fb
         assert(uint_value == UINT_MAX);
3a204fb
-	assert(xatou(buf) == UINT_MAX);
3a204fb
+        assert(xatou(buf) == UINT_MAX);
3a204fb
 
3a204fb
         assert(try_atou("0", &uint_value) == 0);
3a204fb
         assert(uint_value == 0);
3a204fb
-	assert(xatou("0") == 0);
3a204fb
+        assert(xatou("0") == 0);
3a204fb
     }
3a204fb
 
3a204fb
     {
3a204fb
@@ -113,22 +113,22 @@ int main(void)
3a204fb
         assert(try_atoi("foo54321", &int_value) != 0);
3a204fb
         assert(int_value == 12345);
3a204fb
 
3a204fb
-        char buf[sizeof(long) * 3 + 1];
3a204fb
+        char buf[sizeof(long long) * 3 + 1];
3a204fb
 
3a204fb
-        snprintf(buf, sizeof(buf), "%ld", 1L + INT_MAX);
3a204fb
+        snprintf(buf, sizeof(buf), "%lld", 1LL + INT_MAX);
3a204fb
         assert(try_atoi(buf, &int_value) != 0 || !"Parse INT_MAX+1");
3a204fb
         assert(int_value == 12345 || !"Above INT_MAX");
3a204fb
 
3a204fb
-        snprintf(buf, sizeof(buf), "%ld", -1L + INT_MIN);
3a204fb
+        snprintf(buf, sizeof(buf), "%lld", -1LL + INT_MIN);
3a204fb
         assert(try_atoi(buf, &int_value) != 0 || !"Parse INT_MIN-1");
3a204fb
         assert(int_value == 12345 || !"Belove INT_MIN");
3a204fb
 
3a204fb
-        snprintf(buf, sizeof(buf), "%ld", (long unsigned)INT_MAX);
3a204fb
+        snprintf(buf, sizeof(buf), "%lld", (unsigned long long)INT_MAX);
3a204fb
         assert(try_atoi(buf, &int_value) == 0 || !"Parse INT_MAX");
3a204fb
         assert(int_value == INT_MAX);
3a204fb
         assert(xatoi(buf) == INT_MAX);
3a204fb
 
3a204fb
-        snprintf(buf, sizeof(buf), "%ld", (long unsigned)INT_MIN);
3a204fb
+        snprintf(buf, sizeof(buf), "%lld", (unsigned long long)INT_MIN);
3a204fb
         assert(try_atoi(buf, &int_value) == 0 || !"Parse INT_MIN");
3a204fb
         assert(int_value == INT_MIN);
3a204fb
         assert(xatoi(buf) == INT_MIN);
3a204fb
@@ -142,16 +142,16 @@ int main(void)
3a204fb
         assert(try_atoi_positive("foo54321", &positive_value) != 0);
3a204fb
         assert(positive_value == 12345);
3a204fb
 
3a204fb
-        char buf[sizeof(long) * 3 + 1];
3a204fb
+        char buf[sizeof(long long) * 3 + 1];
3a204fb
 
3a204fb
-        snprintf(buf, sizeof(buf), "%ld", 1L + INT_MAX);
3a204fb
+        snprintf(buf, sizeof(buf), "%lld", 1LL + INT_MAX);
3a204fb
         assert(try_atoi_positive(buf, &positive_value) != 0);
3a204fb
         assert(positive_value == 12345 || !"Above INT_MAX");
3a204fb
 
3a204fb
         assert(try_atoi_positive("-1", &positive_value) != 0);
3a204fb
         assert(positive_value == 12345 || !"After -1");
3a204fb
 
3a204fb
-        snprintf(buf, sizeof(buf), "%ld", (long unsigned)INT_MAX);
3a204fb
+        snprintf(buf, sizeof(buf), "%lld", (unsigned long long)INT_MAX);
3a204fb
         assert(try_atoi_positive(buf, &positive_value) == 0 || !"Parse INT_MAX");
3a204fb
         assert(positive_value == INT_MAX);
3a204fb
         assert(xatoi_positive(buf) == INT_MAX);
3a204fb
-- 
3a204fb
2.1.0
3a204fb