Minor formatting fixes;
This commit is contained in:
parent
ffde81cb11
commit
2201d30118
@ -78,7 +78,7 @@ find_sexp (const char *name, sexp_t * start)
|
|||||||
sexp_t *bfs_find_sexp(const char *str, sexp_t *sx) {
|
sexp_t *bfs_find_sexp(const char *str, sexp_t *sx) {
|
||||||
sexp_t *t = sx;
|
sexp_t *t = sx;
|
||||||
sexp_t *rt;
|
sexp_t *rt;
|
||||||
|
|
||||||
if (sx == NULL) return NULL;
|
if (sx == NULL) return NULL;
|
||||||
|
|
||||||
while (t != NULL) {
|
while (t != NULL) {
|
||||||
@ -88,7 +88,7 @@ sexp_t *bfs_find_sexp(const char *str, sexp_t *sx) {
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
t = t->next;
|
t = t->next;
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ sexp_t *bfs_find_sexp(const char *str, sexp_t *sx) {
|
|||||||
rt = bfs_find_sexp(str,t->list);
|
rt = bfs_find_sexp(str,t->list);
|
||||||
if (rt != NULL) return rt;
|
if (rt != NULL) return rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
t = t->next;
|
t = t->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ int sexp_list_length(const sexp_t *sx) {
|
|||||||
if (sx->ty == SEXP_VALUE) return 1;
|
if (sx->ty == SEXP_VALUE) return 1;
|
||||||
|
|
||||||
t = sx->list;
|
t = sx->list;
|
||||||
|
|
||||||
while (t != NULL) {
|
while (t != NULL) {
|
||||||
len++;
|
len++;
|
||||||
t = t->next;
|
t = t->next;
|
||||||
@ -161,9 +161,9 @@ sexp_t *copy_sexp(const sexp_t *s) {
|
|||||||
sexp_t_deallocate(s_new);
|
sexp_t_deallocate(s_new);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_new->binlength = s->binlength;
|
s_new->binlength = s->binlength;
|
||||||
|
|
||||||
if (s->bindata == NULL) {
|
if (s->bindata == NULL) {
|
||||||
s_new->bindata = NULL;
|
s_new->bindata = NULL;
|
||||||
} else {
|
} else {
|
||||||
@ -183,7 +183,7 @@ sexp_t *copy_sexp(const sexp_t *s) {
|
|||||||
|
|
||||||
memcpy(s_new->bindata,s->bindata,s->binlength*sizeof(char));
|
memcpy(s_new->bindata,s->bindata,s->binlength*sizeof(char));
|
||||||
|
|
||||||
/* non-binary */
|
/* non-binary */
|
||||||
} else {
|
} else {
|
||||||
if (s->val == NULL && (s->val_used > 0 || s->val_allocated > 0)) {
|
if (s->val == NULL && (s->val_used > 0 || s->val_allocated > 0)) {
|
||||||
sexp_errno = SEXP_ERR_BADCONTENT;
|
sexp_errno = SEXP_ERR_BADCONTENT;
|
||||||
@ -210,13 +210,13 @@ sexp_t *copy_sexp(const sexp_t *s) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(s_new->val, s->val, sizeof(char)*s->val_used);
|
memcpy(s_new->val, s->val, sizeof(char)*s->val_used);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
s_new->list = copy_sexp(s->list);
|
s_new->list = copy_sexp(s->list);
|
||||||
}
|
}
|
||||||
|
|
||||||
s_new->next = copy_sexp(s->next);
|
s_new->next = copy_sexp(s->next);
|
||||||
|
|
||||||
return s_new;
|
return s_new;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user