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

Unified 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, 9 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 | « core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h ('k') | core/fxcrt/fx_basic_gcc_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_basic_gcc.cpp
diff --git a/core/fxcrt/fx_basic_gcc.cpp b/core/fxcrt/fx_basic_gcc.cpp
index 1b2f01ec8971165a0b5c640b9e896189f1069a32..c3afe1115b962641d9798c8911d72b92b1455ed2 100644
--- a/core/fxcrt/fx_basic_gcc.cpp
+++ b/core/fxcrt/fx_basic_gcc.cpp
@@ -39,7 +39,10 @@ IntType FXSYS_StrToInt(const CharType* str) {
num = num * 10 + val;
str++;
}
- return neg ? -num : num;
+ // When it is a negative value, -num should be returned. Since num may be of
+ // unsigned type, use ~num + 1 to avoid the warning of applying unary minus
+ // operator to unsigned type.
+ return neg ? ~num + 1 : num;
}
template <typename T, typename UT, typename STR_T>
« 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