aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-01-17 22:49:24 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2015-01-17 23:33:57 +0100
commitbce31907c030849f85c7777a53052fef31f80515 (patch)
tree31d3ab9d5b12c3ed11227cadce4420a2dad3a953
parent42b94c089c97b7f8d41ace2af5a90c161c1815f9 (diff)
downloadsds-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.h4
1 files 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;
}