diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2015-01-17 22:49:24 +0100 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2015-01-17 23:33:57 +0100 |
commit | bce31907c030849f85c7777a53052fef31f80515 (patch) | |
tree | 31d3ab9d5b12c3ed11227cadce4420a2dad3a953 | |
parent | 42b94c089c97b7f8d41ace2af5a90c161c1815f9 (diff) | |
download | sds-bce31907c030849f85c7777a53052fef31f80515.tar.xz |
sds.h: Clean up sdshdr struct pointer arithmetic
Remove the unnecessary casting of the pointer arithmetic result in
sdslen and sdsavail to a void pointer since it will already be an
sdshdr struct.
-rw-r--r-- | src/sds.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -42,12 +42,12 @@ struct sdshdr { }; static inline size_t sdslen(const sds s) { - struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr))); + struct sdshdr *sh = s - (sizeof (struct sdshdr)); return sh->len; } static inline size_t sdsavail(const sds s) { - struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr))); + struct sdshdr *sh = s - (sizeof (struct sdshdr)); return sh->free; } |