mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 23:20:05 +02:00
STYLE: Use auto for variable type matches the type of the initializer expression
This check is responsible for using the auto type specifier for variable declarations to improve code readability and maintainability. The auto type specifier will only be introduced in situations where the variable type matches the type of the initializer expression. In other words auto should deduce the same type that was originally spelled in the source SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/ run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-auto -header-filter = .* -fix
This commit is contained in:

committed by
Hans Johnson

parent
cbeed7b076
commit
1fc3de7ca1
@@ -56,7 +56,7 @@ static JSONCPP_STRING readInputTestFile(const char* path) {
|
||||
return JSONCPP_STRING("");
|
||||
fseek(file, 0, SEEK_END);
|
||||
long const size = ftell(file);
|
||||
unsigned long const usize = static_cast<unsigned long>(size);
|
||||
size_t const usize = static_cast<unsigned long>(size);
|
||||
fseek(file, 0, SEEK_SET);
|
||||
JSONCPP_STRING text;
|
||||
char* buffer = new char[size + 1];
|
||||
|
Reference in New Issue
Block a user