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

Side by Side Diff: include/utils/SkRTConf.h

Issue 23213004: Fix size_t to int conversion warning on Win64 in SkRTConf.h. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google, Inc. 2 * Copyright 2013 Google, Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #ifndef SkRTConf_DEFINED 9 #ifndef SkRTConf_DEFINED
10 #define SkRTConf_DEFINED 10 #define SkRTConf_DEFINED
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 skRTConfRegistry().registerConf(this); 108 skRTConfRegistry().registerConf(this);
109 } 109 }
110 110
111 template<typename T> 111 template<typename T>
112 void SkRTConf<T>::print(SkWStream *o) const { 112 void SkRTConf<T>::print(SkWStream *o) const {
113 char outline[200]; // should be ok because we specify a max. width for every thing here. 113 char outline[200]; // should be ok because we specify a max. width for every thing here.
114 114
115 sprintf(outline, "%-30.30s", getName()); 115 sprintf(outline, "%-30.30s", getName());
116 doPrint(&(outline[30])); 116 doPrint(&(outline[30]));
117 sprintf(&(outline[60]), " %.128s", fDescription.c_str()); 117 sprintf(&(outline[60]), " %.128s", fDescription.c_str());
118 if (' ' == outline[strlen(outline)-1]) { 118 for (size_t i = strlen(outline); i --> 0 && ' ' == outline[i];) {
119 for (int i = strlen(outline)-1 ; ' ' == outline[i] ; i--) { 119 outline[i] = '\0';
120 outline[i] = '\0';
121 }
122 } 120 }
123 o->writeText(outline); 121 o->writeText(outline);
124 } 122 }
125 123
126 template<typename T> 124 template<typename T>
127 void SkRTConf<T>::doPrint(char *s) const { 125 void SkRTConf<T>::doPrint(char *s) const {
128 sprintf(s, "%-30.30s", "How do I print myself??"); 126 sprintf(s, "%-30.30s", "How do I print myself??");
129 } 127 }
130 128
131 template<> inline void SkRTConf<bool>::doPrint(char *s) const { 129 template<> inline void SkRTConf<bool>::doPrint(char *s) const {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // static_cast here is okay because there's only one kind of child class. 167 // static_cast here is okay because there's only one kind of child class.
170 const SkRTConf<T> *child_pointer = static_cast<const SkRTConf<T> *>(conf); 168 const SkRTConf<T> *child_pointer = static_cast<const SkRTConf<T> *>(conf);
171 return child_pointer && 169 return child_pointer &&
172 fName == child_pointer->fName && 170 fName == child_pointer->fName &&
173 fDescription == child_pointer->fDescription && 171 fDescription == child_pointer->fDescription &&
174 fValue == child_pointer->fValue && 172 fValue == child_pointer->fValue &&
175 fDefault == child_pointer->fDefault; 173 fDefault == child_pointer->fDefault;
176 } 174 }
177 175
178 #endif 176 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698