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

Unified Diff: base/strings/safe_sprintf.h

Issue 368133002: Fixes for re-enabling more MSVC level 4 warnings: base/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build, attempt 2 Created 6 years, 6 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 | « base/process/kill_win.cc ('k') | base/strings/safe_sprintf.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/strings/safe_sprintf.h
diff --git a/base/strings/safe_sprintf.h b/base/strings/safe_sprintf.h
index c9ee717375386f8fc666fa04403c210eafefb3f2..cbd7d0cd6435e202a4c427c0b70f51bbb72c8009 100644
--- a/base/strings/safe_sprintf.h
+++ b/base/strings/safe_sprintf.h
@@ -139,16 +139,46 @@ struct Arg {
enum Type { INT, UINT, STRING, POINTER };
// Any integer-like value.
- Arg(signed char c) : i(c), width(sizeof(char)), type(INT) { }
- Arg(unsigned char c) : i(c), width(sizeof(char)), type(UINT) { }
- Arg(signed short j) : i(j), width(sizeof(short)), type(INT) { }
- Arg(unsigned short j) : i(j), width(sizeof(short)), type(UINT) { }
- Arg(signed int j) : i(j), width(sizeof(int)), type(INT) { }
- Arg(unsigned int j) : i(j), width(sizeof(int)), type(UINT) { }
- Arg(signed long j) : i(j), width(sizeof(long)), type(INT) { }
- Arg(unsigned long j) : i(j), width(sizeof(long)), type(UINT) { }
- Arg(signed long long j) : i(j), width(sizeof(long long)), type(INT) { }
- Arg(unsigned long long j) : i(j), width(sizeof(long long)), type(UINT) { }
+ Arg(signed char c) : type(INT) {
+ integer.i = c;
+ integer.width = sizeof(char);
+ }
+ Arg(unsigned char c) : type(UINT) {
+ integer.i = c;
+ integer.width = sizeof(char);
+ }
+ Arg(signed short j) : type(INT) {
+ integer.i = j;
+ integer.width = sizeof(short);
+ }
+ Arg(unsigned short j) : type(UINT) {
+ integer.i = j;
+ integer.width = sizeof(short);
+ }
+ Arg(signed int j) : type(INT) {
+ integer.i = j;
+ integer.width = sizeof(int);
+ }
+ Arg(unsigned int j) : type(UINT) {
+ integer.i = j;
+ integer.width = sizeof(int);
+ }
+ Arg(signed long j) : type(INT) {
+ integer.i = j;
+ integer.width = sizeof(long);
+ }
+ Arg(unsigned long j) : type(UINT) {
+ integer.i = j;
+ integer.width = sizeof(long);
+ }
+ Arg(signed long long j) : type(INT) {
+ integer.i = j;
+ integer.width = sizeof(long long);
+ }
+ Arg(unsigned long long j) : type(UINT) {
+ integer.i = j;
+ integer.width = sizeof(long long);
+ }
// A C-style text string.
Arg(const char* s) : str(s), type(STRING) { }
@@ -162,7 +192,7 @@ struct Arg {
struct {
int64_t i;
unsigned char width;
- };
+ } integer;
// A C-style text string.
const char* str;
« no previous file with comments | « base/process/kill_win.cc ('k') | base/strings/safe_sprintf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698