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

Side by Side Diff: mojo/public/cpp/bindings/tests/validation_test_input_parser.cc

Issue 613053002: Mojo: NULL -> nullptr in mojo/public/cpp/bindings and also for the bindings generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/public/cpp/bindings/tests/validation_test_input_parser.h" 5 #include "mojo/public/cpp/bindings/tests/validation_test_input_parser.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 size_t prefix_length) { 377 size_t prefix_length) {
378 if (static_cast<size_t>(range.second - range.first) < prefix_length) 378 if (static_cast<size_t>(range.second - range.first) < prefix_length)
379 return false; 379 return false;
380 380
381 return memcmp(range.first, prefix, prefix_length) == 0; 381 return memcmp(range.first, prefix, prefix_length) == 0;
382 } 382 }
383 383
384 bool ValidationTestInputParser::ConvertToUnsignedInteger( 384 bool ValidationTestInputParser::ConvertToUnsignedInteger(
385 const std::string& value_string, 385 const std::string& value_string,
386 unsigned long long int* value) { 386 unsigned long long int* value) {
387 const char* format = NULL; 387 const char* format = nullptr;
388 if (value_string.find_first_of("xX") != std::string::npos) 388 if (value_string.find_first_of("xX") != std::string::npos)
389 format = "%llx"; 389 format = "%llx";
390 else 390 else
391 format = "%llu"; 391 format = "%llu";
392 return sscanf(value_string.c_str(), format, value) == 1; 392 return sscanf(value_string.c_str(), format, value) == 1;
393 } 393 }
394 394
395 } // namespace 395 } // namespace
396 396
397 bool ParseValidationTestInput(const std::string& input, 397 bool ParseValidationTestInput(const std::string& input,
398 std::vector<uint8_t>* data, 398 std::vector<uint8_t>* data,
399 size_t* num_handles, 399 size_t* num_handles,
400 std::string* error_message) { 400 std::string* error_message) {
401 ValidationTestInputParser parser(input, data, num_handles, error_message); 401 ValidationTestInputParser parser(input, data, num_handles, error_message);
402 return parser.Run(); 402 return parser.Run();
403 } 403 }
404 404
405 } // namespace test 405 } // namespace test
406 } // namespace mojo 406 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/type_conversion_unittest.cc ('k') | mojo/public/cpp/bindings/tests/validation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698