From 58ae952853bf3d2863b0fd6ecce81d182b4fe5fb Mon Sep 17 00:00:00 2001
From: Dominik Loidolt <dominik.loidolt@univie.ac.at>
Date: Wed, 4 Oct 2023 16:56:43 +0200
Subject: [PATCH] unify header definition names

---
 include/cmp_icu.h                | 6 +++---
 include/cmp_io.h                 | 6 ++++++
 include/cmp_max_used_bits_list.h | 6 +++---
 include/cmp_rdcu.h               | 7 +++----
 include/cmp_rdcu_cfg.h           | 7 +++----
 include/decmp.h                  | 6 +++---
 include/my_inttypes.h            | 7 +++----
 include/rdcu_cmd.h               | 8 ++++----
 include/rdcu_ctrl.h              | 8 +++-----
 include/rdcu_pkt_to_file.h       | 6 +++---
 include/rdcu_rmap.h              | 6 +++---
 lib/cmp_io.c                     | 1 -
 test/cmp_icu/test_decmp.c        | 6 ++++--
 test/test_common/test_common.h   | 8 ++++----
 14 files changed, 45 insertions(+), 43 deletions(-)

diff --git a/include/cmp_icu.h b/include/cmp_icu.h
index 75f8114..f536bec 100644
--- a/include/cmp_icu.h
+++ b/include/cmp_icu.h
@@ -17,8 +17,8 @@
  * @see Data Compression User Manual PLATO-UVIE-PL-UM-0001
  */
 
-#ifndef _CMP_ICU_H_
-#define _CMP_ICU_H_
+#ifndef CMP_ICU_H
+#define CMP_ICU_H
 
 #include <cmp_support.h>
 
@@ -59,4 +59,4 @@ int cmp_cfg_icu_max_used_bits(struct cmp_cfg *cfg, const struct cmp_max_used_bit
 /* start the compression */
 int icu_compress_data(const struct cmp_cfg *cfg);
 
-#endif /* _CMP_ICU_H_ */
+#endif /* CMP_ICU_H */
diff --git a/include/cmp_io.h b/include/cmp_io.h
index bb30f04..c5aa5b8 100644
--- a/include/cmp_io.h
+++ b/include/cmp_io.h
@@ -17,6 +17,10 @@
  * @brief compression tool input/output library header file
  */
 
+
+#ifndef CMP_IO_H
+#define CMP_IO_H
+
 #include <string.h>
 
 #include <cmp_support.h>
@@ -59,3 +63,5 @@ int cmp_mode_parse(const char *cmp_mode_str, enum cmp_mode *cmp_mode);
 
 enum cmp_data_type string2data_type(const char *data_type_str);
 const char *data_type2string(enum cmp_data_type data_type);
+
+#endif /* CMP_IO_H */
diff --git a/include/cmp_max_used_bits_list.h b/include/cmp_max_used_bits_list.h
index 82a4cce..b533b01 100644
--- a/include/cmp_max_used_bits_list.h
+++ b/include/cmp_max_used_bits_list.h
@@ -20,8 +20,8 @@
  */
 
 
-#ifndef _CMP_MAX_USED_LIST_H_
-#define _CMP_MAX_USED_LIST_H_
+#ifndef CMP_MAX_USED_LIST_H
+#define CMP_MAX_USED_LIST_H
 
 #include <stdint.h>
 
@@ -36,4 +36,4 @@ int cmp_max_used_bits_list_delet(uint8_t version);
 
 void cmp_max_used_bits_list_empty(void);
 
-#endif /* _CMP_MAX_USED_LIST_H_ */
+#endif /* CMP_MAX_USED_LIST_H */
diff --git a/include/cmp_rdcu.h b/include/cmp_rdcu.h
index 8b16a7a..0e4ef1c 100644
--- a/include/cmp_rdcu.h
+++ b/include/cmp_rdcu.h
@@ -17,9 +17,8 @@
  * @see Data Compression User Manual PLATO-UVIE-PL-UM-0001
  */
 
-
-#ifndef _CMP_RDCU_H_
-#define _CMP_RDCU_H_
+#ifndef CMP_RDCU_H
+#define CMP_RDCU_H
 
 #include <cmp_support.h>
 #include <cmp_rdcu_cfg.h>
@@ -53,4 +52,4 @@ int rdcu_interrupt_compression(void);
 void rdcu_enable_interrput_signal(void);
 void rdcu_disable_interrput_signal(void);
 
-#endif /* _CMP_RDCU_H_ */
+#endif /* CMP_RDCU_H */
diff --git a/include/cmp_rdcu_cfg.h b/include/cmp_rdcu_cfg.h
index d757a68..19e6f97 100644
--- a/include/cmp_rdcu_cfg.h
+++ b/include/cmp_rdcu_cfg.h
@@ -16,9 +16,8 @@
  * @brief hardware compressor configuration library
  */
 
-
-#ifndef _CMP_RDCU_CFG_H_
-#define _CMP_RDCU_CFG_H_
+#ifndef CMP_RDCU_CFG_H
+#define CMP_RDCU_CFG_H
 
 #include <cmp_support.h>
 
@@ -40,4 +39,4 @@ int rdcu_cfg_imagette_default(struct cmp_cfg *cfg);
 
 int rdcu_cmp_cfg_is_invalid(const struct cmp_cfg *cfg);
 
-#endif /* _CMP_RDCU_CFG_H_ */
+#endif /* CMP_RDCU_CFG_H */
diff --git a/include/decmp.h b/include/decmp.h
index c09da34..5acf8ff 100644
--- a/include/decmp.h
+++ b/include/decmp.h
@@ -16,8 +16,8 @@
  * @brief software decompression library
  */
 
-#ifndef DECMP_H_
-#define DECMP_H_
+#ifndef DECMP_H
+#define DECMP_H
 
 #include <cmp_entity.h>
 #include <cmp_support.h>
@@ -29,4 +29,4 @@ int decompress_rdcu_data(uint32_t *compressed_data, const struct cmp_info *info,
 			 uint16_t *model_of_data, uint16_t *up_model_buf,
 			 uint16_t *decompressed_data);
 
-#endif /* DECMP_H_ */
+#endif /* DECMP_H */
diff --git a/include/my_inttypes.h b/include/my_inttypes.h
index 3d7f911..83c3723 100644
--- a/include/my_inttypes.h
+++ b/include/my_inttypes.h
@@ -18,9 +18,8 @@
  * @warning Does not fully implement the standard.
  */
 
-
-#ifndef _MY_INTTYPES_H
-#define _MY_INTTYPES_H
+#ifndef MY_INTTYPES_H
+#define MY_INTTYPES_H
 
 #ifndef __sparc__
 #  include <inttypes.h>
@@ -52,4 +51,4 @@
 
 #endif /* __sparc__ */
 
-#endif /* _MY_INTTYPES_H */
+#endif /* MY_INTTYPES_H */
diff --git a/include/rdcu_cmd.h b/include/rdcu_cmd.h
index d124472..fbbbb31 100644
--- a/include/rdcu_cmd.h
+++ b/include/rdcu_cmd.h
@@ -16,8 +16,9 @@
  * @brief RMAP RDCU RMAP command library header file
  * @see FPGA Requirement Specification PLATO-IWF-PL-RS-005 Issue 0.6
  */
-#ifndef _RDCU_CMD_H_
-#define _RDCU_CMD_H_
+
+#ifndef RDCU_CMD_H
+#define RDCU_CMD_H
 
 #include <stdint.h>
 
@@ -159,5 +160,4 @@ int rdcu_read_cmd_sram_edac_status(uint16_t trans_id, uint8_t *cmd);
 /* SRAM EDAC write accessors */
 int rdcu_write_cmd_sram_edac_ctrl(uint16_t trans_id, uint8_t *cmd);
 
-
-#endif /* _RDCU_CMD_H_ */
+#endif /* RDCU_CMD_H */
diff --git a/include/rdcu_ctrl.h b/include/rdcu_ctrl.h
index 6b73f4b..4caa127 100644
--- a/include/rdcu_ctrl.h
+++ b/include/rdcu_ctrl.h
@@ -17,9 +17,8 @@
  * @see FPGA Requirement Specification PLATO-IWF-PL-RS-005 Issue 0.6
  */
 
-
-#ifndef _RDCU_CTRL_H_
-#define _RDCU_CTRL_H_
+#ifndef RDCU_CTRL_H
+#define RDCU_CTRL_H
 
 #include <stdint.h>
 
@@ -290,5 +289,4 @@ int rdcu_write_sram_32(uint32_t *buf, uint32_t addr, uint32_t size);
 
 int rdcu_ctrl_init(void);
 
-
-#endif /* _RDCU_CTRL_H_ */
+#endif /* RDCU_CTRL_H */
diff --git a/include/rdcu_pkt_to_file.h b/include/rdcu_pkt_to_file.h
index a536440..d185e59 100644
--- a/include/rdcu_pkt_to_file.h
+++ b/include/rdcu_pkt_to_file.h
@@ -16,8 +16,8 @@
  * @brief RDCU packets to file library header file
  */
 
-#ifndef _RDCU_PKT_TO_FILE_H_
-#define _RDCU_PKT_TO_FILE_H_
+#ifndef RDCU_PKT_TO_FILE_H
+#define RDCU_PKT_TO_FILE_H
 
 #include <cmp_support.h>
 
@@ -42,4 +42,4 @@ int gen_read_rdcu_pkts(const struct cmp_info *info);
 int gen_rdcu_parallel_pkts(const struct cmp_cfg *cfg,
 			   const struct cmp_info *last_info);
 
-#endif /* _RDCU_PKT_TO_FILE_H_ */
+#endif /* RDCU_PKT_TO_FILE_H */
diff --git a/include/rdcu_rmap.h b/include/rdcu_rmap.h
index 4b9629d..2f157a5 100644
--- a/include/rdcu_rmap.h
+++ b/include/rdcu_rmap.h
@@ -16,8 +16,8 @@
  * @brief RMAP RDCU link interface header file
  */
 
-#ifndef _RDCU_RMAP_H_
-#define _RDCU_RMAP_H_
+#ifndef RDCU_RMAP_H
+#define RDCU_RMAP_H
 
 #include <stdint.h>
 
@@ -63,4 +63,4 @@ int rdcu_rmap_init(uint32_t mtu,
 
 
 
-#endif /* _RDCU_RMAP_H_ */
+#endif /* RDCU_RMAP_H */
diff --git a/lib/cmp_io.c b/lib/cmp_io.c
index 3aba7b2..9cb0a7e 100644
--- a/lib/cmp_io.c
+++ b/lib/cmp_io.c
@@ -35,7 +35,6 @@
 #include <byteorder.h>
 #include <cmp_data_types.h>
 #include <my_inttypes.h>
-#include <cmp_io.h>
 
 
 /* directory to convert from data_type to string */
diff --git a/test/cmp_icu/test_decmp.c b/test/cmp_icu/test_decmp.c
index 0ceca57..7f07cdf 100644
--- a/test/cmp_icu/test_decmp.c
+++ b/test/cmp_icu/test_decmp.c
@@ -22,8 +22,10 @@
 
 #include "unity.h"
 
-#include "compiler.h"
-#include "cmp_entity.h"
+#include <compiler.h>
+#include <cmp_entity.h>
+#include <cmp_icu.h>
+#include <decmp.h>
 #include "../../lib/cmp_icu.c" /* .c file included to test static functions */
 #include "../../lib/decmp.c" /* .c file included to test static functions */
 
diff --git a/test/test_common/test_common.h b/test/test_common/test_common.h
index 750a534..f0fd84a 100644
--- a/test/test_common/test_common.h
+++ b/test/test_common/test_common.h
@@ -1,7 +1,7 @@
-#include <stdint.h>
+#ifndef TEST_COMMON_H
+#define TEST_COMMON_H
 
-#ifndef TEST_COMMON_H_
-#define TEST_COMMON_H_
+#include <stdint.h>
 
 void cmp_rand_seed(uint64_t seed);
 
@@ -11,4 +11,4 @@ uint32_t cmp_rand_between(uint32_t min, uint32_t max);
 
 uint32_t cmp_rand_nbits(unsigned int nbits);
 
-#endif /* TEST_COMMON_H_ */
+#endif /* TEST_COMMON_H */
-- 
GitLab