Coding style change

This commit is contained in:
Nils O. Selåsdal
2012-12-05 18:53:58 +01:00
parent d9c8b2b48a
commit 16e1ac52ec
32 changed files with 236 additions and 234 deletions
+9 -9
View File
@@ -9,7 +9,7 @@ uc_new_gbuf(size_t initsz)
{
GBuf *p;
p = malloc(sizeof *p);
if(p == NULL)
if (p == NULL)
return NULL;
p->used = 0;
@@ -17,7 +17,7 @@ uc_new_gbuf(size_t initsz)
p->buf = NULL;
p->ref_cnt = 1;
if(initsz != 0 && (p->buf = malloc(initsz)) == NULL) {
if (initsz != 0 && (p->buf = malloc(initsz)) == NULL) {
free(p);
return NULL;
}
@@ -36,7 +36,7 @@ uc_gbuf_unref(GBuf *buf)
{
buf->ref_cnt--;
if(buf->ref_cnt == 0) {
if (buf->ref_cnt == 0) {
free(buf->buf);
free(buf);
}
@@ -47,8 +47,8 @@ uc_gbuf_append(GBuf *buf,const void *data,size_t len)
{
unsigned char *gbuf;
if(buf->len - buf->used < len)
if(uc_gbuf_grow(buf, len + len/2))
if (buf->len - buf->used < len)
if (uc_gbuf_grow(buf, len + len/2))
return -1;
gbuf = buf->buf;
@@ -74,8 +74,8 @@ int uc_gbuf_printf(GBuf *buf, const char *fmt, ...)
char *gbuf;
remaining = uc_gbuf_remaining(buf);
if(rc >= remaining) {
if(uc_gbuf_grow(buf, buf->len + (rc - remaining) + 1)) {
if (rc >= remaining) {
if (uc_gbuf_grow(buf, buf->len + (rc - remaining) + 1)) {
rc = -1;
va_end(apc);
break;
@@ -88,7 +88,7 @@ int uc_gbuf_printf(GBuf *buf, const char *fmt, ...)
rc = vsnprintf(gbuf + buf->used, remaining, fmt, apc);
va_end(apc);
} while(rc >= remaining);
} while (rc >= remaining);
if(rc > 0) {
buf->used += rc;
@@ -108,7 +108,7 @@ uc_gbuf_grow(GBuf *buf, size_t addlen)
newsz = buf->len + addlen;
tmp = realloc(buf->buf,newsz);
if(tmp == NULL)
if (tmp == NULL)
return -1;
buf->buf = tmp;