Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Unified Diff: runtime/platform/globals.h

Issue 9363018: Add integer min/max constants to globals.h (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/bigint_operations_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/globals.h
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index f866a7cff2e9ecfe6c5980f3df4168108a9485fc..650b43d6cb74ce0b0a29f091fac55ec99c468f20 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -130,11 +130,18 @@
// The following macro works on both 32 and 64-bit platforms.
-// Usage: instead of writing 0x1234567890123456
+// Usage: instead of writing 0x1234567890123456ULL
// write DART_2PART_UINT64_C(0x12345678,90123456);
#define DART_2PART_UINT64_C(a, b) \
(((static_cast<uint64_t>(a) << 32) + 0x##b##u))
+// Integer constants.
+const int32_t kMinInt32 = 0x80000000;
+const int32_t kMaxInt32 = 0x7FFFFFFF;
+const uint32_t kMaxUint32 = 0xFFFFFFFF;
+const int64_t kMinInt64 = DART_INT64_C(0x8000000000000000);
+const int64_t kMaxInt64 = DART_INT64_C(0x7FFFFFFFFFFFFFFF);
+const uint64_t kMaxUint64 = DART_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFF);
// Types for native machine words. Guaranteed to be able to hold pointers and
// integers.
« no previous file with comments | « no previous file | runtime/vm/bigint_operations_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698