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

Unified Diff: runtime/vm/bigint_operations.cc

Issue 8585049: Add an interface for retrieving the value of unsigned 64-bit integers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor consistency changes. Created 9 years 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 | « runtime/vm/bigint_operations.h ('k') | 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/vm/bigint_operations.cc
diff --git a/runtime/vm/bigint_operations.cc b/runtime/vm/bigint_operations.cc
index 3a63bb275d473997c6d3dbb97926fe39fccd52f0..a2696d25b107cc69f7da6b3414fe3c943475b656 100644
--- a/runtime/vm/bigint_operations.cc
+++ b/runtime/vm/bigint_operations.cc
@@ -73,14 +73,14 @@ RawBigint* BigintOperations::NewFromInt64(int64_t value, Heap::Space space) {
value = -value;
}
- const Bigint& result = Bigint::Handle(NewFromUInt64(value, space));
+ const Bigint& result = Bigint::Handle(NewFromUint64(value, space));
result.SetSign(is_negative);
return result.raw();
}
-RawBigint* BigintOperations::NewFromUInt64(uint64_t value, Heap::Space space) {
+RawBigint* BigintOperations::NewFromUint64(uint64_t value, Heap::Space space) {
const int kNumBytes = sizeof(value);
unsigned char pch[kNumBytes];
for (int i = kNumBytes - 1; i >= 0; i--) {
@@ -314,7 +314,7 @@ bool BigintOperations::FitsIntoInt64(const Bigint& bigint) {
}
-uint64_t BigintOperations::AbsToUInt64(const Bigint& bigint) {
+uint64_t BigintOperations::AbsToUint64(const Bigint& bigint) {
unsigned char bytes[8];
ASSERT(BN_num_bytes(bigint.BNAddr()) <= static_cast<int>(sizeof bytes));
int n = BN_bn2bin(bigint.BNAddr(), bytes);
@@ -331,7 +331,7 @@ uint64_t BigintOperations::AbsToUInt64(const Bigint& bigint) {
int64_t BigintOperations::ToInt64(const Bigint& bigint) {
ASSERT(FitsIntoInt64(bigint));
- int64_t value = AbsToUInt64(bigint);
+ int64_t value = AbsToUint64(bigint);
if (bigint.IsNegative()) {
value = -value;
}
@@ -339,7 +339,7 @@ int64_t BigintOperations::ToInt64(const Bigint& bigint) {
}
-bool BigintOperations::FitsIntoUInt64(const Bigint& bigint) {
+bool BigintOperations::FitsIntoUint64(const Bigint& bigint) {
const BIGNUM *bn = bigint.BNAddr();
if (bigint.IsNegative()) return false;
int bits = BN_num_bits(bn);
@@ -348,9 +348,9 @@ bool BigintOperations::FitsIntoUInt64(const Bigint& bigint) {
}
-uint64_t BigintOperations::ToUInt64(const Bigint& bigint) {
- ASSERT(FitsIntoUInt64(bigint));
- return AbsToUInt64(bigint);
+uint64_t BigintOperations::ToUint64(const Bigint& bigint) {
+ ASSERT(FitsIntoUint64(bigint));
+ return AbsToUint64(bigint);
}
« no previous file with comments | « runtime/vm/bigint_operations.h ('k') | runtime/vm/bigint_operations_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698