You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/03/27 16:11:53 UTC

svn commit: r1582341 - /subversion/trunk/subversion/tests/libsvn_subr/packed-data-test.c

Author: stefan2
Date: Thu Mar 27 15:11:52 2014
New Revision: 1582341

URL: http://svn.apache.org/r1582341
Log:
Fix constant-out-of-range compiler warning in lib_subr tests.

* subversion/tests/libsvn_subr/packed-data-test.c
  (test_int_stream): Use APR macros for constant definition and
                     add some commentary why we chose those values.

Modified:
    subversion/trunk/subversion/tests/libsvn_subr/packed-data-test.c

Modified: subversion/trunk/subversion/tests/libsvn_subr/packed-data-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/packed-data-test.c?rev=1582341&r1=1582340&r2=1582341&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/packed-data-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/packed-data-test.c Thu Mar 27 15:11:52 2014
@@ -176,13 +176,13 @@ test_int_stream(apr_pool_t *pool)
   enum { COUNT = 7 };
   const apr_int64_t values[COUNT] =
   {
-     0x7fffffffffffffffll,
-    -0x8000000000000000ll,
-     0,
-     0x7fffffffffffffffll,
-    -0x7fffffffffffffffll,
-     0x1234567890abcdefll,
-    -0x0fedcba987654321ll,
+     APR_INT64_MAX, /* extreme value */
+     APR_INT64_MIN, /* other extreme, creating maximum delta to predecessor */
+     0,             /* delta to predecessor > APR_INT64_MAX */
+     APR_INT64_MAX, /* max value, again */
+    -APR_INT64_MAX, /* _almost_ min value, almost max delta */
+     APR_INT64_C(0x1234567890abcdef),  /* some arbitrary value */
+    -APR_INT64_C(0x0fedcba987654321),  /* arbitrary value, different sign */
   };
 
   SVN_ERR(verify_int_stream(values, COUNT, FALSE, pool));