aboutsummaryrefslogtreecommitdiffstats
path: root/utils.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-10 19:05:48 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-10 19:05:48 +0000
commit9ded857bf6bed71f477322c64d4813ebb7856e37 (patch)
tree33176ce63675a2ab5cbbbf7cf1c5bc5f313bf7d1 /utils.c
parent0ba03dd946dd3a888651da225930033e0e26c973 (diff)
Whitespace changes only
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37345 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/utils.c b/utils.c
index 51e9e8c13..bdb022e42 100644
--- a/utils.c
+++ b/utils.c
@@ -112,7 +112,7 @@ static int gethostbyname_r (const char *name, struct hostent *ret, char *buf,
/* here nbytes is the number of bytes required in buffer */
/* as a terminator must be there, the minimum value is ph->h_length */
- if(nbytes > buflen) {
+ if (nbytes > buflen) {
*result = NULL;
ast_mutex_unlock(&__mutex); /* end critical area */
return ERANGE; /* not enough space in buf!! */
@@ -136,7 +136,7 @@ static int gethostbyname_r (const char *name, struct hostent *ret, char *buf,
/* copy addresses */
q = (char **)buf; /* pointer to pointers area (type: char **) */
ret->h_addr_list = q; /* update pointer to address list */
- pbuf = buf + ((naddr+naliases+2)*sizeof(*p)); /* skip that area */
+ pbuf = buf + ((naddr + naliases + 2) * sizeof(*p)); /* skip that area */
for (p = ph->h_addr_list; *p != 0; p++) {
memcpy(pbuf, *p, ph->h_length); /* copy address bytes */
*q++ = pbuf; /* the pointer is the one inside buf... */
@@ -294,7 +294,7 @@ void ast_md5_hash(char *output, char *input)
MD5Update(&md5, (unsigned char *)input, strlen(input));
MD5Final(digest, &md5);
ptr = output;
- for (x=0; x<16; x++)
+ for (x = 0; x < 16; x++)
ptr += sprintf(ptr, "%2.2x", digest[x]);
}
@@ -353,7 +353,7 @@ int ast_base64encode_full(char *dst, const unsigned char *src, int srclen, int m
int cntin = 0;
/* Reserve space for null byte at end of string */
max--;
- while((cntin < srclen) && (cnt < max)) {
+ while ((cntin < srclen) && (cnt < max)) {
byte <<= 8;
byte |= *(src++);
bits += 8;
@@ -405,7 +405,7 @@ static void base64_init(void)
int x;
memset(b2a, -1, sizeof(b2a));
/* Initialize base-64 Conversion table */
- for (x=0;x<26;x++) {
+ for (x = 0; x < 26; x++) {
/* A-Z */
base64[x] = 'A' + x;
b2a['A' + x] = x;
@@ -795,7 +795,7 @@ size_t strnlen(const char *s, size_t n)
{
size_t len;
- for (len=0; len < n; len++)
+ for (len = 0; len < n; len++)
if (s[len] == '\0')
break;
@@ -1034,14 +1034,14 @@ char *ast_process_quotes_and_slashes(char *start, char find, char replace_with)
if (inEscape) {
*dataPut++ = *start; /* Always goes verbatim */
inEscape = 0;
- } else {
+ } else {
if (*start == '\\') {
inEscape = 1; /* Do not copy \ into the data */
} else if (*start == '\'') {
- inQuotes = 1-inQuotes; /* Do not copy ' into the data */
+ inQuotes = 1 - inQuotes; /* Do not copy ' into the data */
} else {
/* Replace , with |, unless in quotes */
- *dataPut++ = inQuotes ? *start : ((*start==find) ? replace_with : *start);
+ *dataPut++ = inQuotes ? *start : ((*start == find) ? replace_with : *start);
}
}
}
@@ -1050,7 +1050,7 @@ char *ast_process_quotes_and_slashes(char *start, char find, char replace_with)
return dataPut;
}
-void ast_join(char *s, size_t len, char * const w[])
+void ast_join(char *s, size_t len, const char *w[])
{
int x, ofs = 0;
const char *src;
@@ -1058,7 +1058,7 @@ void ast_join(char *s, size_t len, char * const w[])
/* Join words into a string */
if (!s)
return;
- for (x=0; ofs < len && w[x]; x++) {
+ for (x = 0; ofs < len && w[x]; x++) {
if (x > 0)
s[ofs++] = ' ';
for (src = w[x]; *src && ofs < len; src++)
@@ -1156,6 +1156,7 @@ void __ast_string_field_index_build(struct ast_string_field_mgr *mgr,
}
AST_MUTEX_DEFINE_STATIC(fetchadd_m); /* used for all fetc&add ops */
+
int ast_atomic_fetchadd_int_slow(volatile int *p, int v)
{
int ret;
@@ -1191,3 +1192,4 @@ int ast_get_time_t(const char *src, time_t *dst, time_t _default, int *consumed)
} else
return -1;
}
+