From 32050925406f0c655420e1e2ba06c50cb3451b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 17 Jan 2017 13:53:48 +0200 Subject: [PATCH] Format miscellaneous files Formatted client, avro and rabbitmq consumer files with Astyle. --- avro/maxavro_file.c | 20 +++++----- avro/maxavro_record.c | 42 ++++++++++---------- avro/maxavrocheck.c | 24 ++++++------ client/maxadmin.c | 74 ++++++++++++++++++------------------ rabbitmq_consumer/consumer.c | 12 +++--- 5 files changed, 86 insertions(+), 86 deletions(-) diff --git a/avro/maxavro_file.c b/avro/maxavro_file.c index efd91e2cf..76ad0fb27 100644 --- a/avro/maxavro_file.c +++ b/avro/maxavro_file.c @@ -204,20 +204,20 @@ const char* maxavro_get_error_string(MAXAVRO_FILE *file) { switch (file->last_error) { - case MAXAVRO_ERR_IO: - return "MAXAVRO_ERR_IO"; + case MAXAVRO_ERR_IO: + return "MAXAVRO_ERR_IO"; - case MAXAVRO_ERR_MEMORY: - return "MAXAVRO_ERR_MEMORY"; + case MAXAVRO_ERR_MEMORY: + return "MAXAVRO_ERR_MEMORY"; - case MAXAVRO_ERR_VALUE_OVERFLOW: - return "MAXAVRO_ERR_VALUE_OVERFLOW"; + case MAXAVRO_ERR_VALUE_OVERFLOW: + return "MAXAVRO_ERR_VALUE_OVERFLOW"; - case MAXAVRO_ERR_NONE: - return "MAXAVRO_ERR_NONE"; + case MAXAVRO_ERR_NONE: + return "MAXAVRO_ERR_NONE"; - default: - return "UNKNOWN ERROR"; + default: + return "UNKNOWN ERROR"; } } diff --git a/avro/maxavro_record.c b/avro/maxavro_record.c index 07a6de119..a5e89e575 100644 --- a/avro/maxavro_record.c +++ b/avro/maxavro_record.c @@ -35,7 +35,7 @@ static json_t* read_and_pack_value(MAXAVRO_FILE *file, MAXAVRO_SCHEMA_FIELD *fie json_t* value = NULL; switch (field->type) { - case MAXAVRO_TYPE_BOOL: + case MAXAVRO_TYPE_BOOL: { int i = 0; if (fread(&i, 1, 1, file->file) == 1) @@ -45,8 +45,8 @@ static json_t* read_and_pack_value(MAXAVRO_FILE *file, MAXAVRO_SCHEMA_FIELD *fie } break; - case MAXAVRO_TYPE_INT: - case MAXAVRO_TYPE_LONG: + case MAXAVRO_TYPE_INT: + case MAXAVRO_TYPE_LONG: { uint64_t val = 0; maxavro_read_integer(file, &val); @@ -55,7 +55,7 @@ static json_t* read_and_pack_value(MAXAVRO_FILE *file, MAXAVRO_SCHEMA_FIELD *fie } break; - case MAXAVRO_TYPE_ENUM: + case MAXAVRO_TYPE_ENUM: { uint64_t val = 0; maxavro_read_integer(file, &val); @@ -73,8 +73,8 @@ static json_t* read_and_pack_value(MAXAVRO_FILE *file, MAXAVRO_SCHEMA_FIELD *fie } break; - case MAXAVRO_TYPE_FLOAT: - case MAXAVRO_TYPE_DOUBLE: + case MAXAVRO_TYPE_FLOAT: + case MAXAVRO_TYPE_DOUBLE: { double d = 0; maxavro_read_double(file, &d); @@ -82,8 +82,8 @@ static json_t* read_and_pack_value(MAXAVRO_FILE *file, MAXAVRO_SCHEMA_FIELD *fie } break; - case MAXAVRO_TYPE_BYTES: - case MAXAVRO_TYPE_STRING: + case MAXAVRO_TYPE_BYTES: + case MAXAVRO_TYPE_STRING: { char *str = maxavro_read_string(file); if (str) @@ -94,9 +94,9 @@ static json_t* read_and_pack_value(MAXAVRO_FILE *file, MAXAVRO_SCHEMA_FIELD *fie } break; - default: - MXS_ERROR("Unimplemented type: %d", field->type); - break; + default: + MXS_ERROR("Unimplemented type: %d", field->type); + break; } return value; } @@ -105,33 +105,33 @@ static void skip_value(MAXAVRO_FILE *file, enum maxavro_value_type type) { switch (type) { - case MAXAVRO_TYPE_INT: - case MAXAVRO_TYPE_LONG: - case MAXAVRO_TYPE_ENUM: + case MAXAVRO_TYPE_INT: + case MAXAVRO_TYPE_LONG: + case MAXAVRO_TYPE_ENUM: { uint64_t val = 0; maxavro_read_integer(file, &val); } break; - case MAXAVRO_TYPE_FLOAT: - case MAXAVRO_TYPE_DOUBLE: + case MAXAVRO_TYPE_FLOAT: + case MAXAVRO_TYPE_DOUBLE: { double d = 0; maxavro_read_double(file, &d); } break; - case MAXAVRO_TYPE_BYTES: - case MAXAVRO_TYPE_STRING: + case MAXAVRO_TYPE_BYTES: + case MAXAVRO_TYPE_STRING: { maxavro_skip_string(file); } break; - default: - MXS_ERROR("Unimplemented type: %d - %s", type, type_to_string(type)); - break; + default: + MXS_ERROR("Unimplemented type: %d - %s", type, type_to_string(type)); + break; } } diff --git a/avro/maxavrocheck.c b/avro/maxavrocheck.c index 9a55e1559..e9a5c70ba 100644 --- a/avro/maxavrocheck.c +++ b/avro/maxavrocheck.c @@ -137,18 +137,18 @@ int main(int argc, char** argv) { switch (c) { - case 'v': - verbose++; - break; - case 'd': - dump = true; - break; - case 'f': - seekto = strtol(optarg, NULL, 10); - break; - case 'c': - num_rows = strtol(optarg, NULL, 10); - break; + case 'v': + verbose++; + break; + case 'd': + dump = true; + break; + case 'f': + seekto = strtol(optarg, NULL, 10); + break; + case 'c': + num_rows = strtol(optarg, NULL, 10); + break; } } diff --git a/client/maxadmin.c b/client/maxadmin.c index 0bcfb6737..1b1a894ed 100644 --- a/client/maxadmin.c +++ b/client/maxadmin.c @@ -147,51 +147,51 @@ main(int argc, char **argv) { switch (c) { - case 'h': - use_inet_socket = true; - hostname = strdup(optarg); - break; + case 'h': + use_inet_socket = true; + hostname = strdup(optarg); + break; - case 'p': - use_inet_socket = true; - // If password was not given, ask for it later - if (optarg != NULL) - { - passwd = strdup(optarg); - memset(optarg, '\0', strlen(optarg)); - } - break; + case 'p': + use_inet_socket = true; + // If password was not given, ask for it later + if (optarg != NULL) + { + passwd = strdup(optarg); + memset(optarg, '\0', strlen(optarg)); + } + break; - case 'P': - use_inet_socket = true; - port = strdup(optarg); - break; + case 'P': + use_inet_socket = true; + port = strdup(optarg); + break; - case 'u': - use_inet_socket = true; - user = strdup(optarg); - break; + case 'u': + use_inet_socket = true; + user = strdup(optarg); + break; - case 'S': - use_unix_socket = true; - socket_path = strdup(optarg); - break; + case 'S': + use_unix_socket = true; + socket_path = strdup(optarg); + break; - case 'v': - PrintVersion(*argv); - exit(EXIT_SUCCESS); + case 'v': + PrintVersion(*argv); + exit(EXIT_SUCCESS); - case 'e': - use_emacs = 1; - break; + case 'e': + use_emacs = 1; + break; - case 'i': - use_emacs = 0; - break; + case 'i': + use_emacs = 0; + break; - case '?': - DoUsage(argv[0]); - exit(optopt ? EXIT_FAILURE : EXIT_SUCCESS); + case '?': + DoUsage(argv[0]); + exit(optopt ? EXIT_FAILURE : EXIT_SUCCESS); } } diff --git a/rabbitmq_consumer/consumer.c b/rabbitmq_consumer/consumer.c index af7e05fe2..e84c431fd 100644 --- a/rabbitmq_consumer/consumer.c +++ b/rabbitmq_consumer/consumer.c @@ -421,13 +421,13 @@ int main(int argc, char** argv) { switch (ch) { - case 'c': - cnfnlen = strlen(optarg); - cnfpath = strdup(optarg); - break; - default: + case 'c': + cnfnlen = strlen(optarg); + cnfpath = strdup(optarg); + break; + default: - break; + break; } }