From fc454577b135b2fdab4b26be20541101c1702f26 Mon Sep 17 00:00:00 2001
From: Dominik Loidolt <dominik.loidolt@univie.ac.at>
Date: Wed, 17 Nov 2021 11:16:29 +0100
Subject: [PATCH] add code feedback from Armin

---
 lib/cmp_guess.c    | 10 +++++-----
 lib/cmp_support.c  |  4 ++--
 lib/cmp_tool_lib.c |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/cmp_guess.c b/lib/cmp_guess.c
index e272cff..265b9c5 100644
--- a/lib/cmp_guess.c
+++ b/lib/cmp_guess.c
@@ -62,8 +62,8 @@ uint16_t cmp_guess_model_value(int n_model_updates)
 		return 11;
 	if (n_model_updates <= 21)
 		return 12;
-	else
-		return 13;
+
+	return 13;
 }
 
 
@@ -84,7 +84,7 @@ static uint32_t pre_cal_method(struct cmp_cfg *cfg)
 	uint32_t golomb_par_best = 0;
 	uint32_t spill_best = 0;
 
-	for (g = MIN_RDCU_GOLOMB_PAR; g < MAX_RDCU_GOLOMB_PAR; ++g) {
+	for (g = MIN_RDCU_GOLOMB_PAR; g < MAX_RDCU_GOLOMB_PAR; g++) {
 		uint32_t s = cmp_get_good_spill(g, cfg->cmp_mode);
 
 		cfg->golomb_par = g;
@@ -133,8 +133,8 @@ static uint32_t brute_force(struct cmp_cfg *cfg)
 	printf("0%%... ");
 	fflush(stdout);
 
-	for (g = MIN_RDCU_GOLOMB_PAR; g < MAX_RDCU_GOLOMB_PAR; ++g) {
-		for (s = MIN_RDCU_SPILL; s < get_max_spill(g, cfg->cmp_mode); ++s) {
+	for (g = MIN_RDCU_GOLOMB_PAR; g < MAX_RDCU_GOLOMB_PAR; g++) {
+		for (s = MIN_RDCU_SPILL; s < get_max_spill(g, cfg->cmp_mode); s++) {
 			cfg->golomb_par = g;
 			cfg->spill = s;
 
diff --git a/lib/cmp_support.c b/lib/cmp_support.c
index 6e69b11..c078319 100644
--- a/lib/cmp_support.c
+++ b/lib/cmp_support.c
@@ -426,9 +426,9 @@ uint32_t get_max_spill(unsigned int golomb_par, unsigned int cmp_mode)
 
 		return LUT_MAX_RDCU[golomb_par];
 	} else {
-		if (golomb_par > MAX_ICU_GOLOMB_PAR)
+		if (golomb_par > MAX_ICU_GOLOMB_PAR) {
 			return 0;
-		else {
+		} else {
 			/* the ICU compressor can generate code words with a length of
 			 * maximal 32 bits.  */
 			unsigned int max_cw_bits = 32;
diff --git a/lib/cmp_tool_lib.c b/lib/cmp_tool_lib.c
index 8c3226b..41f7763 100644
--- a/lib/cmp_tool_lib.c
+++ b/lib/cmp_tool_lib.c
@@ -250,7 +250,7 @@ static void remove_spaces(char *s)
 
 	do {
 		while (*d == ' ' || *d == '\t')
-			++d;
+			d++;
 	} while ((*s++ = *d++) != '\0');
 }
 
-- 
GitLab