Skip to content

Commit

Permalink
clang format again
Browse files Browse the repository at this point in the history
  • Loading branch information
br1tney5pear5 committed Dec 16, 2024
1 parent b2d400c commit 498ed45
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 16 deletions.
12 changes: 10 additions & 2 deletions app/2db.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@

#define ZSV_2DB_DEFAULT_TABLE_NAME "mytable"

enum zsv_2db_action { zsv_2db_action_create = 1, zsv_2db_action_append, zsv_2db_action_index };
enum zsv_2db_action {
zsv_2db_action_create = 1,
zsv_2db_action_append,
zsv_2db_action_index
};

enum zsv_2db_state { zsv_2db_state_header = 1, zsv_2db_state_data, zsv_2db_state_done };
enum zsv_2db_state {
zsv_2db_state_header = 1,
zsv_2db_state_data,
zsv_2db_state_done
};

#define LQ_2DB_MAX_INDEXES 32

Expand Down
5 changes: 4 additions & 1 deletion app/2tsv.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@

#include <zsv/utils/utf8.h>

enum zsv_2tsv_status { zsv_2tsv_status_ok = 0, zsv_2tsv_status_out_of_memory };
enum zsv_2tsv_status {
zsv_2tsv_status_ok = 0,
zsv_2tsv_status_out_of_memory
};

#define ZSV_2TSV_BUFF_SIZE 65536

Expand Down
7 changes: 4 additions & 3 deletions app/compare_unique_colname.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
static int zsv_compare_unique_colname_cmp(zsv_compare_unique_colname *x, zsv_compare_unique_colname *y) {
return x->instance_num == y->instance_num
? zsv_stricmp(x->name, y->name)
: x->instance_num > y->instance_num ? 1 : x->instance_num < y->instance_num ? -1 : 0;
return x->instance_num == y->instance_num ? zsv_stricmp(x->name, y->name)
: x->instance_num > y->instance_num ? 1
: x->instance_num < y->instance_num ? -1
: 0;
}

SGLIB_DEFINE_RBTREE_FUNCTIONS(zsv_compare_unique_colname, left, right, color, zsv_compare_unique_colname_cmp);
Expand Down
5 changes: 4 additions & 1 deletion app/flatten.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
#include <zsv/utils/mem.h>
#include <zsv/utils/string.h>

enum flatten_agg_method { flatten_agg_method_none = 1, flatten_agg_method_array };
enum flatten_agg_method {
flatten_agg_method_none = 1,
flatten_agg_method_array
};

struct flatten_column_name_and_ix {
unsigned char *name;
Expand Down
5 changes: 4 additions & 1 deletion app/prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,10 @@ static int zsv_prop_foreach_clean(struct zsv_foreach_dirent_handle *h, size_t de
return err;
}

enum zsv_prop_foreach_copy_mode { zsv_prop_foreach_copy_mode_check = 1, zsv_prop_foreach_copy_mode_copy };
enum zsv_prop_foreach_copy_mode {
zsv_prop_foreach_copy_mode_check = 1,
zsv_prop_foreach_copy_mode_copy
};

struct zsv_prop_foreach_copy_ctx {
struct zsv_dir_filter zsv_dir_filter;
Expand Down
2 changes: 1 addition & 1 deletion app/select-pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct zsv_select_data {
struct { // merge data: only used with --merge
struct zsv_select_uint_list *indexes, **last_index;
} merge;
} * out2in; // array of .output_cols_count length; out2in[x] = y where x = output ix, y = input info
} *out2in; // array of .output_cols_count length; out2in[x] = y where x = output ix, y = input info

unsigned int output_cols_count; // total count of output columns

Expand Down
2 changes: 1 addition & 1 deletion app/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct zsv_select_data {
struct { // merge data: only used with --merge
struct zsv_select_uint_list *indexes, **last_index;
} merge;
} * out2in; // array of .output_cols_count length; out2in[x] = y where x = output ix, y = input info
} *out2in; // array of .output_cols_count length; out2in[x] = y where x = output ix, y = input info

unsigned int output_cols_count; // total count of output columns

Expand Down
5 changes: 3 additions & 2 deletions app/utils/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ unsigned char *zsv_cache_path(const unsigned char *data_filepath, const unsigned
return NULL;
const unsigned char *last_slash = (void *)strrchr((void *)data_filepath, '/');
const unsigned char *last_backslash = (void *)strrchr((void *)data_filepath, '\\');
const unsigned char *dir_end =
(!last_slash && !last_backslash ? NULL : last_backslash > last_slash ? last_backslash : last_slash);
const unsigned char *dir_end = (!last_slash && !last_backslash ? NULL
: last_backslash > last_slash ? last_backslash
: last_slash);
char *s = NULL;
char *filename_suffix = NULL;
if (cache_filename)
Expand Down
2 changes: 1 addition & 1 deletion include/zsv/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ enum zsv_status {
zsv_status_row,
zsv_status_done = 100
#ifdef ZSV_EXTRAS
,
,
zsv_status_max_rows_read = 999
#endif
};
Expand Down
6 changes: 5 additions & 1 deletion include/zsv/utils/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
*/
unsigned char *zsv_cache_path(const unsigned char *data_filepath, const unsigned char *cache_filename, char temp_file);

enum zsv_cache_type { zsv_cache_type_property = 1, zsv_cache_type_tag, zsv_cache_type_overwrite };
enum zsv_cache_type {
zsv_cache_type_property = 1,
zsv_cache_type_tag,
zsv_cache_type_overwrite
};

unsigned char *zsv_cache_filepath(const unsigned char *data_filepath, enum zsv_cache_type type, char create_dir,
char temp_file);
Expand Down
7 changes: 6 additions & 1 deletion include/zsv/utils/jq.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
#include <ctype.h>
#include <jq.h>

enum zsv_jq_status { zsv_jq_status_ok = 0, zsv_jq_status_compile, zsv_jq_status_memory, zsv_jq_status_error };
enum zsv_jq_status {
zsv_jq_status_ok = 0,
zsv_jq_status_compile,
zsv_jq_status_memory,
zsv_jq_status_error
};

size_t zsv_jq_fwrite1(void *restrict FILE_ptr, const void *restrict buff, size_t len);

Expand Down
2 changes: 1 addition & 1 deletion src/zsv_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ struct zsv_scanner {
union {
struct zsv_scan_delim_regs delim;
struct zsv_scan_fixed_regs fixed;
} * regs;
} *regs;
enum zsv_status stat; // last status
unsigned char *buff;
size_t bytes_read;
Expand Down

0 comments on commit 498ed45

Please sign in to comment.