From 73230dfaff923021cea63728c4262555d7fd4608 Mon Sep 17 00:00:00 2001 From: Sebastian Achim Mueller Date: Tue, 4 Jun 2024 19:40:56 +0200 Subject: [PATCH] clang-format --- libs/mli/src/mliIo.c | 5 ++- libs/mli/src/mliIo.h | 4 +-- libs/mli/src/mliTarIo.c | 7 +++-- libs/mli/src/mliTarIo.h | 10 ++++-- .../mli_corsika/src/mli_corsika_Histogram2d.c | 31 +++++++++---------- .../mli_corsika/src/mli_corsika_Histogram2d.h | 5 ++- 6 files changed, 35 insertions(+), 27 deletions(-) diff --git a/libs/mli/src/mliIo.c b/libs/mli/src/mliIo.c index 9054746..960ba0d 100644 --- a/libs/mli/src/mliIo.c +++ b/libs/mli/src/mliIo.c @@ -412,7 +412,7 @@ int mli_line_viewer_write( return 0; } -int mliIo_write_from_file(struct mliIo *byt, FILE* f, const uint64_t size) +int mliIo_write_from_file(struct mliIo *byt, FILE *f, const uint64_t size) { chk_msg(f, "Expected file to be open."); chk_msg(byt->cstr != NULL, "Expected buffer to be allocated."); @@ -427,8 +427,7 @@ int mliIo_write_from_file(struct mliIo *byt, FILE* f, const uint64_t size) return 0; } - -int mliIo_read_to_file(struct mliIo *byt, FILE* f, const uint64_t size) +int mliIo_read_to_file(struct mliIo *byt, FILE *f, const uint64_t size) { chk_msg(f, "Expected file to be open."); chk_msg(byt->cstr != NULL, "Expected buffer to be allocated."); diff --git a/libs/mli/src/mliIo.h b/libs/mli/src/mliIo.h index 15f1abc..bfbd57d 100644 --- a/libs/mli/src/mliIo.h +++ b/libs/mli/src/mliIo.h @@ -26,8 +26,8 @@ int mliIo_malloc_capacity(struct mliIo *byt, const uint64_t capacity); int mliIo_malloc(struct mliIo *byt); int64_t mliIo_malloc_cstr(struct mliIo *byt, const char *s); int mliIo_malloc_from_path(struct mliIo *byt, const char *path); -int mliIo_write_from_file(struct mliIo *byt, FILE* f, const uint64_t size); -int mliIo_read_to_file(struct mliIo *byt, FILE* f, const uint64_t size); +int mliIo_write_from_file(struct mliIo *byt, FILE *f, const uint64_t size); +int mliIo_read_to_file(struct mliIo *byt, FILE *f, const uint64_t size); int mliIo_read_to_path(struct mliIo *byt, const char *path); int mliIo_putc(struct mliIo *byt, const unsigned char c); int mliIo_putchar(struct mliIo *byt, const char c); diff --git a/libs/mli/src/mliTarIo.c b/libs/mli/src/mliTarIo.c index c077fc9..b08102c 100644 --- a/libs/mli/src/mliTarIo.c +++ b/libs/mli/src/mliTarIo.c @@ -3,7 +3,6 @@ #include #include "chk.h" - int mliTar_read_data_to_io( struct mliTar *tar, struct mliIo *buff, @@ -23,7 +22,9 @@ int mliTar_read_data_to_io( } int mliTar_write_data_from_io( - struct mliTar *tar, struct mliIo *buff, const uint64_t size) + struct mliTar *tar, + struct mliIo *buff, + const uint64_t size) { uint64_t i; chk_msg(tar->stream, "tar is not open."); @@ -32,7 +33,7 @@ int mliTar_write_data_from_io( unsigned char c; chk(rc != EOF); c = (char)(rc); - chk(mliTar_write_data(tar, (void*)(&c), 1)); + chk(mliTar_write_data(tar, (void *)(&c), 1)); } return 1; diff --git a/libs/mli/src/mliTarIo.h b/libs/mli/src/mliTarIo.h index b33b2bd..9abaea5 100644 --- a/libs/mli/src/mliTarIo.h +++ b/libs/mli/src/mliTarIo.h @@ -4,6 +4,12 @@ #include "mliIo.h" #include "mliTar.h" -int mliTar_read_data_to_io(struct mliTar *tar, struct mliIo *buff, const uint64_t size); -int mliTar_write_data_from_io(struct mliTar *tar, struct mliIo *buff, const uint64_t size); +int mliTar_read_data_to_io( + struct mliTar *tar, + struct mliIo *buff, + const uint64_t size); +int mliTar_write_data_from_io( + struct mliTar *tar, + struct mliIo *buff, + const uint64_t size); #endif diff --git a/libs/mli_corsika/src/mli_corsika_Histogram2d.c b/libs/mli_corsika/src/mli_corsika_Histogram2d.c index 20eb266..4d9a125 100644 --- a/libs/mli_corsika/src/mli_corsika_Histogram2d.c +++ b/libs/mli_corsika/src/mli_corsika_Histogram2d.c @@ -5,7 +5,10 @@ #include "../../mli/src/chk.h" #include "../../mli/src/mli_math.h" -MLIDYNARRAY_IMPLEMENTATION(mli, CorsikaHistogram2dBin, struct mliCorsikaHistogram2dBin) +MLIDYNARRAY_IMPLEMENTATION( + mli, + CorsikaHistogram2dBin, + struct mliCorsikaHistogram2dBin) struct key { int32_t x; @@ -80,20 +83,20 @@ int mliCorsikaHistogram2d_flatten__( bin.y = key.i4i4.y; bin.value = mli_interpret_int64_as_double(node->value); - chk_msg( - mliDynCorsikaHistogram2dBin_push_back(f, bin), - "Failed to push back bin-node." - ); - + chk_msg(mliDynCorsikaHistogram2dBin_push_back(f, bin), + "Failed to push back bin-node."); if (node->avl.left != NULL) { - struct mliAvlNode *left = (struct mliAvlNode *)(node->avl.left); - chk_msg(mliCorsikaHistogram2d_flatten__(left, f), "Failed left"); + struct mliAvlNode *left = + (struct mliAvlNode *)(node->avl.left); + chk_msg(mliCorsikaHistogram2d_flatten__(left, f), + "Failed left"); } if (node->avl.right != NULL) { struct mliAvlNode *right = (struct mliAvlNode *)(node->avl.right); - chk_msg(mliCorsikaHistogram2d_flatten__(right, f), "Failed right"); + chk_msg(mliCorsikaHistogram2d_flatten__(right, f), + "Failed right"); } return 1; } @@ -106,13 +109,9 @@ int mliCorsikaHistogram2d_flatten( const struct mliCorsikaHistogram2d *hist, struct mliDynCorsikaHistogram2dBin *f) { - chk_msg( - mliCorsikaHistogram2d_flatten__( - (const struct mliAvlNode *)hist->dict.tree.root, - f - ), - "Failed to write dict." - ); + chk_msg(mliCorsikaHistogram2d_flatten__( + (const struct mliAvlNode *)hist->dict.tree.root, f), + "Failed to write dict."); return 1; chk_error: diff --git a/libs/mli_corsika/src/mli_corsika_Histogram2d.h b/libs/mli_corsika/src/mli_corsika_Histogram2d.h index e3fbda8..a3e9e9f 100644 --- a/libs/mli_corsika/src/mli_corsika_Histogram2d.h +++ b/libs/mli_corsika/src/mli_corsika_Histogram2d.h @@ -17,7 +17,10 @@ struct mliCorsikaHistogram2dBin { double value; }; -MLIDYNARRAY_DEFINITON(mli, CorsikaHistogram2dBin, struct mliCorsikaHistogram2dBin) +MLIDYNARRAY_DEFINITON( + mli, + CorsikaHistogram2dBin, + struct mliCorsikaHistogram2dBin) struct mliCorsikaHistogram2d mliCorsikaHistogram2d_init(void);