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

Side by Side Diff: core/fxcrt/fx_basic_gcc.cpp

Issue 1849443003: Re-enable all the windows warnings except 4267 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Address comments 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/fpdfapi/fpdf_parser/cpdf_syntax_parser.h ('k') | core/fxcrt/fx_basic_gcc_unittest.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 #include <cctype> 7 #include <cctype>
8 #include <cwctype> 8 #include <cwctype>
9 #include <limits> 9 #include <limits>
10 10
(...skipping 21 matching lines...) Expand all
32 } else { 32 } else {
33 // Return MAX when the represented number is signed type and is larger 33 // Return MAX when the represented number is signed type and is larger
34 // than the max value, or the number is unsigned type and out of range. 34 // than the max value, or the number is unsigned type and out of range.
35 return std::numeric_limits<IntType>::max(); 35 return std::numeric_limits<IntType>::max();
36 } 36 }
37 } 37 }
38 38
39 num = num * 10 + val; 39 num = num * 10 + val;
40 str++; 40 str++;
41 } 41 }
42 return neg ? -num : num; 42 // When it is a negative value, -num should be returned. Since num may be of
43 // unsigned type, use ~num + 1 to avoid the warning of applying unary minus
44 // operator to unsigned type.
45 return neg ? ~num + 1 : num;
43 } 46 }
44 47
45 template <typename T, typename UT, typename STR_T> 48 template <typename T, typename UT, typename STR_T>
46 STR_T FXSYS_IntToStr(T value, STR_T str, int radix) { 49 STR_T FXSYS_IntToStr(T value, STR_T str, int radix) {
47 if (radix < 2 || radix > 16) { 50 if (radix < 2 || radix > 16) {
48 str[0] = 0; 51 str[0] = 0;
49 return str; 52 return str;
50 } 53 }
51 if (value == 0) { 54 if (value == 0) {
52 str[0] = '0'; 55 str[0] = '0';
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 buf[wlen] = bstr[i]; 246 buf[wlen] = bstr[i];
244 } 247 }
245 wlen++; 248 wlen++;
246 } 249 }
247 return wlen; 250 return wlen;
248 } 251 }
249 #ifdef __cplusplus 252 #ifdef __cplusplus
250 } 253 }
251 #endif 254 #endif
252 #endif 255 #endif
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h ('k') | core/fxcrt/fx_basic_gcc_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698