You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2012/11/13 03:13:13 UTC

[lucy-commits] [14/16] git commit: refs/heads/master - Use U32_MAX instead of UINT32_MAX

Use U32_MAX instead of UINT32_MAX

We should switch to the stdint.h constants later, and let Charmonizer
define them if stdint.h is not available.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/846c7cc8
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/846c7cc8
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/846c7cc8

Branch: refs/heads/master
Commit: 846c7cc8ddc1b7a3c3812fab61d9a44f20ea010e
Parents: 018f7b2
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sun Nov 4 15:01:06 2012 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Nov 12 20:26:10 2012 +0100

----------------------------------------------------------------------
 clownfish/runtime/core/Clownfish/Test/TestVArray.c |    2 +-
 clownfish/runtime/core/Clownfish/VArray.c          |    2 +-
 core/Clownfish/VArray.c                            |    2 +-
 core/Lucy/Test/Object/TestVArray.c                 |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/846c7cc8/clownfish/runtime/core/Clownfish/Test/TestVArray.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestVArray.c b/clownfish/runtime/core/Clownfish/Test/TestVArray.c
index 5d6a69d..a595b6b 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestVArray.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestVArray.c
@@ -259,7 +259,7 @@ test_Slice(TestBatch *batch) {
     {
         VArray *wanted = VA_new(0);
         VA_Push(wanted, (Obj*)CB_newf("9"));
-        VArray *slice = VA_Slice(array, 9, UINT32_MAX - 1);
+        VArray *slice = VA_Slice(array, 9, U32_MAX - 1);
         TEST_TRUE(batch, VA_Get_Size(slice) == 1, "guard against overflow");
         DECREF(slice);
         DECREF(wanted);

http://git-wip-us.apache.org/repos/asf/lucy/blob/846c7cc8/clownfish/runtime/core/Clownfish/VArray.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VArray.c b/clownfish/runtime/core/Clownfish/VArray.c
index fd4b6f7..50b10ff 100644
--- a/clownfish/runtime/core/Clownfish/VArray.c
+++ b/clownfish/runtime/core/Clownfish/VArray.c
@@ -316,7 +316,7 @@ VA_slice(VArray *self, uint32_t offset, uint32_t length) {
         offset = 0;
         length = 0;
     }
-    else if (length > UINT32_MAX - offset
+    else if (length > U32_MAX - offset
              || offset + length > self->size
             ) {
         length = self->size - offset;

http://git-wip-us.apache.org/repos/asf/lucy/blob/846c7cc8/core/Clownfish/VArray.c
----------------------------------------------------------------------
diff --git a/core/Clownfish/VArray.c b/core/Clownfish/VArray.c
index cb13779..dea731f 100644
--- a/core/Clownfish/VArray.c
+++ b/core/Clownfish/VArray.c
@@ -350,7 +350,7 @@ VA_slice(VArray *self, uint32_t offset, uint32_t length) {
         offset = 0;
         length = 0;
     }
-    else if (length > UINT32_MAX - offset
+    else if (length > U32_MAX - offset
              || offset + length > self->size
             ) {
         length = self->size - offset;

http://git-wip-us.apache.org/repos/asf/lucy/blob/846c7cc8/core/Lucy/Test/Object/TestVArray.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Object/TestVArray.c b/core/Lucy/Test/Object/TestVArray.c
index 5e2c8ef..d0a1b07 100644
--- a/core/Lucy/Test/Object/TestVArray.c
+++ b/core/Lucy/Test/Object/TestVArray.c
@@ -252,7 +252,7 @@ test_Slice(TestBatch *batch) {
     {
         VArray *wanted = VA_new(0);
         VA_Push(wanted, (Obj*)CB_newf("9"));
-        VArray *slice = VA_Slice(array, 9, UINT32_MAX - 1);
+        VArray *slice = VA_Slice(array, 9, U32_MAX - 1);
         TEST_TRUE(batch, VA_Get_Size(slice) == 1, "guard against overflow");
         DECREF(slice);
         DECREF(wanted);