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

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

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: win Created 5 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/installer/util/channel_info.h" 5 #include "chrome/installer/util/channel_info.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_piece.h" 8 #include "base/strings/string_piece.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/win/registry.h" 10 #include "base/win/registry.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 MOD_CHROME_FRAME, 46 MOD_CHROME_FRAME,
47 MOD_APP_HOST_DEPRECATED, 47 MOD_APP_HOST_DEPRECATED,
48 MOD_APP_LAUNCHER_DEPRECATED, 48 MOD_APP_LAUNCHER_DEPRECATED,
49 MOD_READY_MODE, 49 MOD_READY_MODE,
50 SFX_MULTI_FAIL, 50 SFX_MULTI_FAIL,
51 SFX_MIGRATING, 51 SFX_MIGRATING,
52 SFX_FULL, 52 SFX_FULL,
53 NUM_MODIFIERS 53 NUM_MODIFIERS
54 }; 54 };
55 55
56 COMPILE_ASSERT(NUM_MODIFIERS == arraysize(kModifiers), 56 static_assert(
57 kModifiers_disagrees_with_ModifierIndex_comma_they_must_match_bang); 57 NUM_MODIFIERS == arraysize(kModifiers),
58 "kModifiers_disagrees_with_ModifierIndex_comma_they_must_match_bang");
58 59
59 // Returns true if the modifier is found, in which case |position| holds the 60 // Returns true if the modifier is found, in which case |position| holds the
60 // location at which the modifier was found. The number of characters in the 61 // location at which the modifier was found. The number of characters in the
61 // modifier is returned in |length|, if non-NULL. 62 // modifier is returned in |length|, if non-NULL.
62 bool FindModifier(ModifierIndex index, 63 bool FindModifier(ModifierIndex index,
63 const base::string16& ap_value, 64 const base::string16& ap_value,
64 base::string16::size_type* position, 65 base::string16::size_type* position,
65 base::string16::size_type* length) { 66 base::string16::size_type* length) {
66 DCHECK(position != NULL); 67 DCHECK(position != NULL);
67 base::string16::size_type mod_position = base::string16::npos; 68 base::string16::size_type mod_position = base::string16::npos;
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 341
341 for (int scan = 0; scan < NUM_MODIFIERS; ++scan) { 342 for (int scan = 0; scan < NUM_MODIFIERS; ++scan) {
342 ModifierIndex index = static_cast<ModifierIndex>(scan); 343 ModifierIndex index = static_cast<ModifierIndex>(scan);
343 modified = SetModifier(index, false, &value_) || modified; 344 modified = SetModifier(index, false, &value_) || modified;
344 } 345 }
345 346
346 return modified; 347 return modified;
347 } 348 }
348 349
349 } // namespace installer 350 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698