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

Side by Side Diff: webrtc/base/flags.cc

Issue 1335923002: Add RTC_ prefix to (D)CHECKs and related macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 5 years, 3 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 | « webrtc/base/filerotatingstream.cc ('k') | webrtc/base/logsinks.cc » ('j') | 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 2006 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2006 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 *name = arg; 156 *name = arg;
157 157
158 // find the end of the flag name 158 // find the end of the flag name
159 while (*arg != '\0' && *arg != '=') 159 while (*arg != '\0' && *arg != '=')
160 arg++; 160 arg++;
161 161
162 // get the value if any 162 // get the value if any
163 if (*arg == '=') { 163 if (*arg == '=') {
164 // make a copy so we can NUL-terminate flag name 164 // make a copy so we can NUL-terminate flag name
165 int n = static_cast<int>(arg - *name); 165 int n = static_cast<int>(arg - *name);
166 CHECK_LT(n, buffer_size); 166 RTC_CHECK_LT(n, buffer_size);
167 memcpy(buffer, *name, n * sizeof(char)); 167 memcpy(buffer, *name, n * sizeof(char));
168 buffer[n] = '\0'; 168 buffer[n] = '\0';
169 *name = buffer; 169 *name = buffer;
170 // get the value 170 // get the value
171 *value = arg + 1; 171 *value = arg + 1;
172 } 172 }
173 } 173 }
174 } 174 }
175 175
176 176
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 *argc = j; 251 *argc = j;
252 } 252 }
253 253
254 // parsed all flags successfully 254 // parsed all flags successfully
255 return 0; 255 return 0;
256 } 256 }
257 257
258 void FlagList::Register(Flag* flag) { 258 void FlagList::Register(Flag* flag) {
259 assert(flag != NULL && strlen(flag->name()) > 0); 259 assert(flag != NULL && strlen(flag->name()) > 0);
260 CHECK(!Lookup(flag->name())) << "flag " << flag->name() << " declared twice"; 260 RTC_CHECK(!Lookup(flag->name())) << "flag " << flag->name()
261 << " declared twice";
261 flag->next_ = list_; 262 flag->next_ = list_;
262 list_ = flag; 263 list_ = flag;
263 } 264 }
264 265
265 #if defined(WEBRTC_WIN) 266 #if defined(WEBRTC_WIN)
266 WindowsCommandLineArguments::WindowsCommandLineArguments() { 267 WindowsCommandLineArguments::WindowsCommandLineArguments() {
267 // start by getting the command line. 268 // start by getting the command line.
268 LPTSTR command_line = ::GetCommandLine(); 269 LPTSTR command_line = ::GetCommandLine();
269 // now, convert it to a list of wide char strings. 270 // now, convert it to a list of wide char strings.
270 LPWSTR *wide_argv = ::CommandLineToArgvW(command_line, &argc_); 271 LPWSTR *wide_argv = ::CommandLineToArgvW(command_line, &argc_);
(...skipping 16 matching lines...) Expand all
287 // need to free each string in the array, and then the array. 288 // need to free each string in the array, and then the array.
288 for(int i = 0; i < argc_; i++) { 289 for(int i = 0; i < argc_; i++) {
289 delete[] argv_[i]; 290 delete[] argv_[i];
290 } 291 }
291 292
292 delete[] argv_; 293 delete[] argv_;
293 } 294 }
294 #endif // WEBRTC_WIN 295 #endif // WEBRTC_WIN
295 296
296 } // namespace rtc 297 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/filerotatingstream.cc ('k') | webrtc/base/logsinks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698