Made all C++ files clang-formatted.

Also added missing generated files.

Change-Id: Ifd22a643a08e3f2edfce92812ed57b87fc0e1875
This commit is contained in:
Wouter van Oortmerssen
2017-12-21 10:54:28 -08:00
parent 5d9930aa0d
commit 89711c9c47
43 changed files with 5850 additions and 5992 deletions

View File

@@ -14,20 +14,16 @@
* limitations under the License.
*/
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <string>
#include "flatbuffers/hash.h"
#include <stdio.h>
enum OutputFormat {
kDecimal,
kHexadecimal,
kHexadecimal0x
};
enum OutputFormat { kDecimal, kHexadecimal, kHexadecimal0x };
int main(int argc, char* argv[]) {
const char* name = argv[0];
int main(int argc, char *argv[]) {
const char *name = argv[0];
if (argc <= 1) {
printf("%s HASH [OPTION]... STRING... [-- STRING...]\n", name);
printf("Available hashing algorithms:\n 32 bit:\n");
@@ -50,7 +46,7 @@ int main(int argc, char* argv[]) {
return 0;
}
const char* hash_algorithm = argv[1];
const char *hash_algorithm = argv[1];
flatbuffers::NamedHashFunction<uint32_t>::HashFunction hash_function32 =
flatbuffers::FindHashFunction32(hash_algorithm);
@@ -66,15 +62,21 @@ int main(int argc, char* argv[]) {
bool annotate = false;
bool escape_dash = false;
for (int i = 2; i < argc; i++) {
const char* arg = argv[i];
const char *arg = argv[i];
if (!escape_dash && arg[0] == '-') {
std::string opt = arg;
if (opt == "-d") output_format = kDecimal;
else if (opt == "-x") output_format = kHexadecimal;
else if (opt == "-0x") output_format = kHexadecimal0x;
else if (opt == "-c") annotate = true;
else if (opt == "--") escape_dash = true;
else printf("Unrecognized argument: \"%s\"\n", arg);
if (opt == "-d")
output_format = kDecimal;
else if (opt == "-x")
output_format = kHexadecimal;
else if (opt == "-0x")
output_format = kHexadecimal0x;
else if (opt == "-c")
annotate = true;
else if (opt == "--")
escape_dash = true;
else
printf("Unrecognized argument: \"%s\"\n", arg);
} else {
std::stringstream ss;
if (output_format == kDecimal) {
@@ -90,8 +92,7 @@ int main(int argc, char* argv[]) {
else if (hash_function64)
ss << hash_function64(arg);
if (annotate)
ss << " /* \"" << arg << "\" */";
if (annotate) ss << " /* \"" << arg << "\" */";
ss << "\n";
@@ -100,4 +101,3 @@ int main(int argc, char* argv[]) {
}
return 0;
}