[PATCH 13/15] libdebian-installer: reorder to get rid of typedef
nuke gratious typedef in log.c
reorder structs in hash and package to not need the typedefs.
WARNING: untested, due to libdebian-installer build troubles.
Signed-off-by: maximilian attems <max@stro.at>
---
packages/libdebian-installer/src/hash.c | 24 +++++++++----------
packages/libdebian-installer/src/log.c | 2 -
packages/libdebian-installer/src/mem_chunk.c | 32 ++++++++++++-------------
3 files changed, 26 insertions(+), 32 deletions(-)
diff --git a/packages/libdebian-installer/src/hash.c b/packages/libdebian-installer/src/hash.c
index f90d290..c26087c 100644
--- a/packages/libdebian-installer/src/hash.c
+++ b/packages/libdebian-installer/src/hash.c
@@ -30,8 +30,6 @@
#include <string.h>
-typedef struct di_hash_node di_hash_node;
-
/**
* @addtogroup di_hash_table
* @{
@@ -39,6 +37,17 @@ typedef struct di_hash_node di_hash_node;
/**
* @internal
+ * @brief Node of a hash table
+ */
+struct di_hash_node
+{
+ void *key; /**< key */
+ void *value; /**< value */
+ di_hash_node *next; /**< the next node */
+};
+
+/**
+ * @internal
* @brief Hash table
*/
struct di_hash_table
@@ -55,17 +64,6 @@ struct di_hash_table
/**
* @internal
- * @brief Node of a hash table
- */
-struct di_hash_node
-{
- void *key; /**< key */
- void *value; /**< value */
- di_hash_node *next; /**< the next node */
-};
-
-/**
- * @internal
* Defines if a resize is necessary
*
* @param hash_table a di_hash_table
diff --git a/packages/libdebian-installer/src/log.c b/packages/libdebian-installer/src/log.c
index ccfa31d..7083544 100644
--- a/packages/libdebian-installer/src/log.c
+++ b/packages/libdebian-installer/src/log.c
@@ -36,8 +36,6 @@
#include <sys/types.h>
#include <unistd.h>
-typedef struct di_log_handler_struct di_log_handler_struct;
-
/**
* @addtogroup di_log
*/
diff --git a/packages/libdebian-installer/src/mem_chunk.c b/packages/libdebian-installer/src/mem_chunk.c
index 79c2a31..027db4b 100644
--- a/packages/libdebian-installer/src/mem_chunk.c
+++ b/packages/libdebian-installer/src/mem_chunk.c
@@ -35,8 +35,6 @@
#define MEM_ALIGN sizeof (void *)
#define MEM_AREA_SIZE sizeof (void *)
-typedef struct di_mem_area di_mem_area;
-
/**
* @addtogroup di_mem_chunk
* @{
@@ -44,21 +42,6 @@ typedef struct di_mem_area di_mem_area;
/**
* @internal
- * @brief a mem chunk
- */
-struct di_mem_chunk
-{
- int num_mem_areas; /**< the number of memory areas */
- int num_marked_areas; /**< the number of areas marked for deletion */
- size_t atom_size; /**< the size of an atom */
- size_t area_size; /**< the size of a memory area */
- size_t rarea_size; /**< the size of a real memory area */
- di_mem_area *mem_area; /**< the current memory area */
- di_mem_area *mem_areas; /**< a list of all the mem areas owned by this chunk */
-};
-
-/**
- * @internal
* @brief a mem area
*/
struct di_mem_area
@@ -77,6 +60,21 @@ struct di_mem_area
*/
};
+/**
+ * @internal
+ * @brief a mem chunk
+ */
+struct di_mem_chunk
+{
+ int num_mem_areas; /**< the number of memory areas */
+ int num_marked_areas; /**< the number of areas marked for deletion */
+ size_t atom_size; /**< the size of an atom */
+ size_t area_size; /**< the size of a memory area */
+ size_t rarea_size; /**< the size of a real memory area */
+ di_mem_area *mem_area; /**< the current memory area */
+ di_mem_area *mem_areas; /**< a list of all the mem areas owned by this chunk */
+};
+
static size_t internal_di_mem_chunk_compute_size (size_t size, size_t min_size) __attribute__ ((nonnull));
/** @} */
--
1.7.2.3
Reply to: