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-05-29 17:43:56 +0100
commite88762d670d9f5af42ccd97754b97389aa9f963f (patch)
tree376405ed5863f6d87b2c2b4e1ca88205ccfe7fcc
parentddb34c207bab1ee6491a55587cffae9d9cd8f7f3 (diff)
downloadtbdiff-e88762d670d9f5af42ccd97754b97389aa9f963f.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);