summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brewer <ben.brewer@codethink.co.uk>2014-05-29 12:02:38 +0100
committerBen Brewer <ben.brewer@codethink.co.uk>2014-06-02 11:03:00 +0100
commitab5dbf22791338239c72c8e9a0a1ae4dd5523e1b (patch)
treeea4dad4e9e8b4f7d3efb91c2df1f378d2f57d54f
parent9bb191462e637bc97b6bcbcfe798cc254ba7a7e4 (diff)
downloadtbdiff-ab5dbf22791338239c72c8e9a0a1ae4dd5523e1b.tar.gz
Use correct pointer type for parent member in tbd_stat_t
The parent pointer in tbd_stat_t was void since it pointed to itself, to make the code more clear I've typedef'd the struct above so that the pointer can now point to itself as an incomplete type.
-rw-r--r--tbdiff/tbdiff-stat.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/tbdiff/tbdiff-stat.h b/tbdiff/tbdiff-stat.h
index 85d7e1b..22da466 100644
--- a/tbdiff/tbdiff-stat.h
+++ b/tbdiff/tbdiff-stat.h
@@ -37,8 +37,10 @@ typedef enum {
TBD_STAT_TYPE_SOCKET = 's'
} tbd_stat_type_e;
-typedef struct {
- void* parent;
+typedef struct tbd_stat_s tbd_stat_t;
+
+struct tbd_stat_s {
+ tbd_stat_t* parent;
char* name;
tbd_stat_type_e type;
time_t mtime;
@@ -47,7 +49,7 @@ typedef struct {
gid_t gid;
mode_t mode;
uint32_t rdev;
-} tbd_stat_t;
+};
extern tbd_stat_t* tbd_stat(const char *path);
extern void tbd_stat_free(tbd_stat_t *file);