Reindent canonizer.c
- Untabify - Remove trailing whitespace. - Allman braces.
This commit is contained in:
@ -7,7 +7,8 @@
|
||||
#include <buffer.h>
|
||||
#include <mysql.h>
|
||||
|
||||
static char* server_options[] = {
|
||||
static char* server_options[] =
|
||||
{
|
||||
"MariaDB Corporation MaxScale",
|
||||
"--datadir=./",
|
||||
"--language=./",
|
||||
@ -18,7 +19,8 @@ static char* server_options[] = {
|
||||
|
||||
const int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
|
||||
|
||||
static char* server_groups[] = {
|
||||
static char* server_groups[] =
|
||||
{
|
||||
"embedded",
|
||||
"server",
|
||||
"server",
|
||||
@ -27,7 +29,6 @@ static char* server_groups[] = {
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
||||
unsigned int psize;
|
||||
GWBUF* qbuff;
|
||||
char *tok;
|
||||
@ -35,12 +36,14 @@ int main(int argc, char** argv)
|
||||
FILE* infile;
|
||||
FILE* outfile;
|
||||
|
||||
if(argc != 3){
|
||||
if (argc != 3)
|
||||
{
|
||||
printf("Usage: canonizer <input file> <output file>\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(mysql_library_init(num_elements, server_options, server_groups)){
|
||||
if (mysql_library_init(num_elements, server_options, server_groups))
|
||||
{
|
||||
printf("Embedded server init failed.\n");
|
||||
return 1;
|
||||
}
|
||||
@ -48,7 +51,8 @@ int main(int argc, char** argv)
|
||||
infile = fopen(argv[1],"rb");
|
||||
outfile = fopen(argv[2],"wb");
|
||||
|
||||
if(infile == NULL || outfile == NULL){
|
||||
if (infile == NULL || outfile == NULL)
|
||||
{
|
||||
printf("Opening files failed.\n");
|
||||
return 1;
|
||||
}
|
||||
@ -57,7 +61,8 @@ int main(int argc, char** argv)
|
||||
{
|
||||
fgets(readbuff,4092,infile);
|
||||
psize = strlen(readbuff);
|
||||
if(psize < 4092){
|
||||
if (psize < 4092)
|
||||
{
|
||||
qbuff = gwbuf_alloc(psize + 7);
|
||||
*(qbuff->sbuf->data + 0) = (unsigned char)psize;
|
||||
*(qbuff->sbuf->data + 1) = (unsigned char)(psize>>8);
|
||||
|
||||
Reference in New Issue
Block a user