summaryrefslogtreecommitdiff
path: root/sds.c
diff options
context:
space:
mode:
Diffstat (limited to 'sds.c')
-rw-r--r--sds.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sds.c b/sds.c
index 72d623e..5d55b77 100644
--- a/sds.c
+++ b/sds.c
@@ -103,7 +103,7 @@ void sdsfree(sds s) {
* the output will be "6" as the string was modified but the logical length
* remains 6 bytes. */
void sdsupdatelen(sds s) {
- struct sdshdr *sh = (void*) (s-sizeof *sh);;
+ struct sdshdr *sh = (void*) (s-sizeof *sh);
int reallen = strlen(s);
sh->free += (sh->len-reallen);
sh->len = reallen;
@@ -114,7 +114,7 @@ void sdsupdatelen(sds s) {
* so that next append operations will not require allocations up to the
* number of bytes previously available. */
void sdsclear(sds s) {
- struct sdshdr *sh = (void*) (s-sizeof *sh);;
+ struct sdshdr *sh = (void*) (s-sizeof *sh);
sh->free += sh->len;
sh->len = 0;
sh->buf[0] = '\0';
@@ -133,7 +133,7 @@ sds sdsMakeRoomFor(sds s, size_t addlen) {
if (free >= addlen) return s;
len = sdslen(s);
- sh = (void*) (s-sizeof *sh);;
+ sh = (void*) (s-sizeof *sh);
newlen = (len+addlen);
if (newlen < SDS_MAX_PREALLOC)
newlen *= 2;
@@ -155,7 +155,7 @@ sds sdsMakeRoomFor(sds s, size_t addlen) {
sds sdsRemoveFreeSpace(sds s) {
struct sdshdr *sh;
- sh = (void*) (s-sizeof *sh);;
+ sh = (void*) (s-sizeof *sh);
sh = realloc(sh, sizeof *sh+sh->len+1);
sh->free = 0;
return sh->buf;
@@ -169,7 +169,7 @@ sds sdsRemoveFreeSpace(sds s) {
* 4) The implicit null term.
*/
size_t sdsAllocSize(sds s) {
- struct sdshdr *sh = (void*) (s-sizeof *sh);;
+ struct sdshdr *sh = (void*) (s-sizeof *sh);
return sizeof(*sh)+sh->len+sh->free+1;
}
@@ -198,7 +198,7 @@ size_t sdsAllocSize(sds s) {
* sdsIncrLen(s, nread);
*/
void sdsIncrLen(sds s, int incr) {
- struct sdshdr *sh = (void*) (s-sizeof *sh);;
+ struct sdshdr *sh = (void*) (s-sizeof *sh);
assert(sh->free >= incr);
sh->len += incr;
@@ -240,7 +240,7 @@ sds sdscatlen(sds s, const void *t, size_t len) {
s = sdsMakeRoomFor(s,len);
if (s == NULL) return NULL;
- sh = (void*) (s-sizeof *sh);;
+ sh = (void*) (s-sizeof *sh);
memcpy(s+curlen, t, len);
sh->len = curlen+len;
sh->free = sh->free-len;
@@ -267,13 +267,13 @@ sds sdscatsds(sds s, const sds t) {
/* Destructively modify the sds string 's' to hold the specified binary
* safe string pointed by 't' of length 'len' bytes. */
sds sdscpylen(sds s, const char *t, size_t len) {
- struct sdshdr *sh = (void*) (s-sizeof *sh);;
+ struct sdshdr *sh = (void*) (s-sizeof *sh);
size_t totlen = sh->free+sh->len;
if (totlen < len) {
s = sdsMakeRoomFor(s,len-sh->len);
if (s == NULL) return NULL;
- sh = (void*) (s-sizeof *sh);;
+ sh = (void*) (s-sizeof *sh);
totlen = sh->free+sh->len;
}
memcpy(s, t, len);
@@ -541,7 +541,7 @@ sds sdscatfmt(sds s, char const *fmt, ...) {
* Output will be just "Hello World".
*/
void sdstrim(sds s, const char *cset) {
- struct sdshdr *sh = (void*) (s-sizeof *sh);;
+ struct sdshdr *sh = (void*) (s-sizeof *sh);
char *start, *end, *sp, *ep;
size_t len;
@@ -573,7 +573,7 @@ void sdstrim(sds s, const char *cset) {
* sdsrange(s,1,-1); => "ello World"
*/
void sdsrange(sds s, int start, int end) {
- struct sdshdr *sh = (void*) (s-sizeof *sh);;
+ struct sdshdr *sh = (void*) (s-sizeof *sh);
size_t newlen, len = sdslen(s);
if (len == 0) return;