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

Side by Side Diff: third_party/bigint/BigIntegerUtils.cc

Issue 1514633002: XFA: Fix win8 gn build under chromium checkout (non-xfa) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « third_party/base/logging.h ('k') | third_party/third_party.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code by Matt McCutchen, see the LICENSE file. 5 // Original code by Matt McCutchen, see the LICENSE file.
6 6
7 #include "BigIntegerUtils.hh" 7 #include "BigIntegerUtils.hh"
8 #include "BigUnsignedInABase.hh" 8 #include "BigUnsignedInABase.hh"
9 9
10 std::string bigUnsignedToString(const BigUnsigned &x) { 10 std::string bigUnsignedToString(const BigUnsigned &x) {
(...skipping 25 matching lines...) Expand all
36 else if (osFlags & os.hex) { 36 else if (osFlags & os.hex) {
37 base = 16; 37 base = 16;
38 if (osFlags & os.showbase) 38 if (osFlags & os.showbase)
39 os << "0x"; 39 os << "0x";
40 } else if (osFlags & os.oct) { 40 } else if (osFlags & os.oct) {
41 base = 8; 41 base = 8;
42 if (osFlags & os.showbase) 42 if (osFlags & os.showbase)
43 os << '0'; 43 os << '0';
44 } else 44 } else
45 abort(); 45 abort();
46
46 std::string s = std::string(BigUnsignedInABase(x, base)); 47 std::string s = std::string(BigUnsignedInABase(x, base));
47 os << s; 48 os << s;
48 return os; 49 return os;
49 } 50 }
50 51
51 std::ostream &operator <<(std::ostream &os, const BigInteger &x) { 52 std::ostream &operator <<(std::ostream &os, const BigInteger &x) {
52 if (x.getSign() == BigInteger::negative) 53 if (x.getSign() == BigInteger::negative)
53 os << '-'; 54 os << '-';
54 os << x.getMagnitude(); 55 os << x.getMagnitude();
55 return os; 56 return os;
56 } 57 }
OLDNEW
« no previous file with comments | « third_party/base/logging.h ('k') | third_party/third_party.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698