From bce31907c030849f85c7777a53052fef31f80515 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sat, 17 Jan 2015 22:49:24 +0100 Subject: 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. --- src/sds.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sds.h b/src/sds.h index 98124a5..9b81489 100644 --- a/src/sds.h +++ b/src/sds.h @@ -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; } -- cgit v1.2.3-70-g09d2