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

Side by Side Diff: chrome/installer/util/version.cc

Issue 151101: Fixit: Remove bunch of coverity warnings from chrome/installer/*. (Closed)
Patch Set: Created 11 years, 5 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 | « chrome/installer/util/version.h ('k') | chrome/installer/util/work_item.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 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "chrome/installer/util/version.h" 8 #include "chrome/installer/util/version.h"
9 9
10 installer::Version::Version(int64 major, int64 minor, int64 build, 10 installer::Version::Version(int64 major, int64 minor, int64 build,
11 int64 patch) : 11 int64 patch) :
(...skipping 14 matching lines...) Expand all
26 return ((major_ > other->major_) || 26 return ((major_ > other->major_) ||
27 ((major_ == other->major_) && (minor_ > other->minor_)) || 27 ((major_ == other->major_) && (minor_ > other->minor_)) ||
28 ((major_ == other->major_) && (minor_ == other->minor_) 28 ((major_ == other->major_) && (minor_ == other->minor_)
29 && (build_ > other->build_)) || 29 && (build_ > other->build_)) ||
30 ((major_ == other->major_) && (minor_ == other->minor_) 30 ((major_ == other->major_) && (minor_ == other->minor_)
31 && (build_ == other->build_) 31 && (build_ == other->build_)
32 && (patch_ > other->patch_))); 32 && (patch_ > other->patch_)));
33 } 33 }
34 34
35 installer::Version* installer::Version::GetVersionFromString( 35 installer::Version* installer::Version::GetVersionFromString(
36 std::wstring version_str) { 36 const std::wstring& version_str) {
37 std::vector<std::wstring> numbers; 37 std::vector<std::wstring> numbers;
38 SplitString(version_str, '.', &numbers); 38 SplitString(version_str, '.', &numbers);
39 39
40 if (numbers.size() != 4) { 40 if (numbers.size() != 4) {
41 return NULL; 41 return NULL;
42 } 42 }
43 43
44 return new Version(StringToInt64(numbers[0]), StringToInt64(numbers[1]), 44 return new Version(StringToInt64(numbers[0]), StringToInt64(numbers[1]),
45 StringToInt64(numbers[2]), StringToInt64(numbers[3])); 45 StringToInt64(numbers[2]), StringToInt64(numbers[3]));
46 } 46 }
OLDNEW
« no previous file with comments | « chrome/installer/util/version.h ('k') | chrome/installer/util/work_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698