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

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

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 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/pathutils.h ('k') | webrtc/base/physicalsocketserver.h » ('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 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 bool Pathname::SetFilename(const std::string& filename) { 218 bool Pathname::SetFilename(const std::string& filename) {
219 std::string::size_type pos = filename.rfind(EXT_DELIM); 219 std::string::size_type pos = filename.rfind(EXT_DELIM);
220 if ((pos == std::string::npos) || (pos == 0)) { 220 if ((pos == std::string::npos) || (pos == 0)) {
221 return SetExtension(EMPTY_STR) && SetBasename(filename); 221 return SetExtension(EMPTY_STR) && SetBasename(filename);
222 } else { 222 } else {
223 return SetExtension(filename.substr(pos)) && SetBasename(filename.substr(0, pos)); 223 return SetExtension(filename.substr(pos)) && SetBasename(filename.substr(0, pos));
224 } 224 }
225 } 225 }
226 226
227 #if defined(WEBRTC_WIN) 227 #if defined(WEBRTC_WIN)
228 bool Pathname::GetDrive(char *drive, uint32 bytes) const { 228 bool Pathname::GetDrive(char* drive, uint32_t bytes) const {
229 return GetDrive(drive, bytes, folder_); 229 return GetDrive(drive, bytes, folder_);
230 } 230 }
231 231
232 // static 232 // static
233 bool Pathname::GetDrive(char *drive, uint32 bytes, 233 bool Pathname::GetDrive(char* drive,
234 uint32_t bytes,
234 const std::string& pathname) { 235 const std::string& pathname) {
235 // need at lease 4 bytes to save c: 236 // need at lease 4 bytes to save c:
236 if (bytes < 4 || pathname.size() < 3) { 237 if (bytes < 4 || pathname.size() < 3) {
237 return false; 238 return false;
238 } 239 }
239 240
240 memcpy(drive, pathname.c_str(), 3); 241 memcpy(drive, pathname.c_str(), 3);
241 drive[3] = 0; 242 drive[3] = 0;
242 // sanity checking 243 // sanity checking
243 return (isalpha(drive[0]) && 244 return (isalpha(drive[0]) &&
244 drive[1] == ':' && 245 drive[1] == ':' &&
245 drive[2] == '\\'); 246 drive[2] == '\\');
246 } 247 }
247 #endif 248 #endif
248 249
249 /////////////////////////////////////////////////////////////////////////////// 250 ///////////////////////////////////////////////////////////////////////////////
250 251
251 } // namespace rtc 252 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/pathutils.h ('k') | webrtc/base/physicalsocketserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698