diff options
author | dan sinclair <dj2@everburning.com> | 2018-11-22 16:57:29 -0500 |
---|---|---|
committer | David Neto <dneto@google.com> | 2018-11-22 16:57:29 -0500 |
commit | da74d350d628dca19c9ac2b6c057e518203eb3f3 (patch) | |
tree | af761aa698eb184bfd861edb06ba0ed7edcf9045 /samples | |
parent | fcef06cabdfb1cb5c13001ebae8bb5e2b14681bf (diff) | |
download | amber-da74d350d628dca19c9ac2b6c057e518203eb3f3.tar.gz |
Add cpplint (#90)
Add cpplint
Diffstat (limited to 'samples')
-rw-r--r-- | samples/amber.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/samples/amber.cc b/samples/amber.cc index b03a3da..1ad9941 100644 --- a/samples/amber.cc +++ b/samples/amber.cc @@ -28,7 +28,7 @@ struct Options { std::string image_filename; std::string buffer_filename; - long buffer_binding_index = 0; + int64_t buffer_binding_index = 0; bool parse_only = false; bool show_help = false; bool show_version_info = false; @@ -72,9 +72,10 @@ bool ParseArgs(const std::vector<std::string>& args, Options* opts) { std::cerr << "Missing value for -B argument." << std::endl; return false; } - opts->buffer_binding_index = strtol(args[i].c_str(), nullptr, 10); + opts->buffer_binding_index = + static_cast<int64_t>(strtol(args[i].c_str(), nullptr, 10)); - if (opts->buffer_binding_index < 0) { + if (opts->buffer_binding_index < 0U) { std::cerr << "Invalid value for -B, must be 0 or greater." << std::endl; return false; } @@ -124,7 +125,7 @@ std::string ReadFile(const std::string& input_file) { } fseek(file, 0, SEEK_END); - long tell_file_size = ftell(file); + uint64_t tell_file_size = static_cast<uint64_t>(ftell(file)); if (tell_file_size <= 0) { std::cerr << "Input file of incorrect size: " << input_file << std::endl; return {}; |