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

Side by Side Diff: rlz/win/lib/machine_deal.cc

Issue 1513043002: clang/win: Let remaining chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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 | « remoting/host/setup/daemon_controller_delegate_win.cc ('k') | rlz/win/lib/process_info.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 // 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 // Library functions related to the OEM Deal Confirmation Code. 5 // Library functions related to the OEM Deal Confirmation Code.
6 6
7 #include "rlz/win/lib/machine_deal.h" 7 #include "rlz/win/lib/machine_deal.h"
8 8
9 #include <windows.h> 9 #include <windows.h>
10 #include <vector> 10 #include <vector>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 return true; 50 return true;
51 } 51 }
52 52
53 return false; 53 return false;
54 } 54 }
55 55
56 // This function will remove bad rlz chars and also limit the max rlz to some 56 // This function will remove bad rlz chars and also limit the max rlz to some
57 // reasonable size. It also assumes that normalized_dcc is at least 57 // reasonable size. It also assumes that normalized_dcc is at least
58 // kMaxDccLength+1 long. 58 // kMaxDccLength+1 long.
59 void NormalizeDcc(const char* raw_dcc, char* normalized_dcc) { 59 void NormalizeDcc(const char* raw_dcc, char* normalized_dcc) {
60 int index = 0; 60 size_t index = 0;
61 for (; raw_dcc[index] != 0 && index < rlz_lib::kMaxDccLength; ++index) { 61 for (; raw_dcc[index] != 0 && index < rlz_lib::kMaxDccLength; ++index) {
62 char current = raw_dcc[index]; 62 char current = raw_dcc[index];
63 if (IsGoodDccChar(current)) { 63 if (IsGoodDccChar(current)) {
64 normalized_dcc[index] = current; 64 normalized_dcc[index] = current;
65 } else { 65 } else {
66 normalized_dcc[index] = '.'; 66 normalized_dcc[index] = '.';
67 } 67 }
68 } 68 }
69 69
70 normalized_dcc[index] = 0; 70 normalized_dcc[index] = 0;
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 DWORD dcc_size = arraysize(dcc); 292 DWORD dcc_size = arraysize(dcc);
293 if (dcc_key.ReadValue(kDccValueName, dcc, &dcc_size, NULL) == ERROR_SUCCESS) { 293 if (dcc_key.ReadValue(kDccValueName, dcc, &dcc_size, NULL) == ERROR_SUCCESS) {
294 ASSERT_STRING("MachineDealCode::Clear: Could not delete the DCC value."); 294 ASSERT_STRING("MachineDealCode::Clear: Could not delete the DCC value.");
295 return false; 295 return false;
296 } 296 }
297 297
298 return true; 298 return true;
299 } 299 }
300 300
301 } // namespace rlz_lib 301 } // namespace rlz_lib
OLDNEW
« no previous file with comments | « remoting/host/setup/daemon_controller_delegate_win.cc ('k') | rlz/win/lib/process_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698