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

Side by Side Diff: core/fxcrt/include/fx_string.h

Issue 1841643002: Code change to avoid signed/unsigned mismatch warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « core/fxcrt/fx_basic_gcc_unittest.cpp ('k') | core/fxge/ge/fx_ge_text.cpp » ('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 copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_FXCRT_INCLUDE_FX_STRING_H_ 7 #ifndef CORE_FXCRT_INCLUDE_FX_STRING_H_
8 #define CORE_FXCRT_INCLUDE_FX_STRING_H_ 8 #define CORE_FXCRT_INCLUDE_FX_STRING_H_
9 9
10 #include <stdint.h> // For intptr_t. 10 #include <stdint.h> // For intptr_t.
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 private: 128 private:
129 void* operator new(size_t) throw() { return NULL; } 129 void* operator new(size_t) throw() { return NULL; }
130 }; 130 };
131 inline bool operator==(const char* lhs, const CFX_ByteStringC& rhs) { 131 inline bool operator==(const char* lhs, const CFX_ByteStringC& rhs) {
132 return rhs == lhs; 132 return rhs == lhs;
133 } 133 }
134 inline bool operator!=(const char* lhs, const CFX_ByteStringC& rhs) { 134 inline bool operator!=(const char* lhs, const CFX_ByteStringC& rhs) {
135 return rhs != lhs; 135 return rhs != lhs;
136 } 136 }
137 #define FXBSTR_ID(c1, c2, c3, c4) ((c1 << 24) | (c2 << 16) | (c3 << 8) | (c4)) 137 #define FXBSTR_ID(c1, c2, c3, c4) \
138 (((uint32_t)c1 << 24) | ((uint32_t)c2 << 16) | ((uint32_t)c3 << 8) | \
139 ((uint32_t)c4))
138 140
139 // A mutable string with shared buffers using copy-on-write semantics that 141 // A mutable string with shared buffers using copy-on-write semantics that
140 // avoids the cost of std::string's iterator stability guarantees. 142 // avoids the cost of std::string's iterator stability guarantees.
141 class CFX_ByteString { 143 class CFX_ByteString {
142 public: 144 public:
143 typedef FX_CHAR value_type; 145 typedef FX_CHAR value_type;
144 146
145 CFX_ByteString() : m_pData(nullptr) {} 147 CFX_ByteString() : m_pData(nullptr) {}
146 148
147 // Copy constructor. 149 // Copy constructor.
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 } 812 }
811 813
812 FX_FLOAT FX_atof(const CFX_ByteStringC& str); 814 FX_FLOAT FX_atof(const CFX_ByteStringC& str);
813 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { 815 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) {
814 return FX_atof(FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength())); 816 return FX_atof(FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength()));
815 } 817 }
816 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); 818 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData);
817 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); 819 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf);
818 820
819 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ 821 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_
OLDNEW
« no previous file with comments | « core/fxcrt/fx_basic_gcc_unittest.cpp ('k') | core/fxge/ge/fx_ge_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698