masqmail-0.2
diff src/timeival.c @ 10:26e34ae9a3e3
changed indention and line wrapping to a more consistent style
author | meillo@marmaro.de |
---|---|
date | Mon, 27 Oct 2008 16:23:10 +0100 |
parents | 08114f7dcc23 |
children | f671821d8222 |
line diff
1.1 --- a/src/timeival.c Mon Oct 27 16:21:27 2008 +0100 1.2 +++ b/src/timeival.c Mon Oct 27 16:23:10 2008 +0100 1.3 @@ -21,34 +21,35 @@ 1.4 1.5 #include "masqmail.h" 1.6 1.7 -gint time_interval(gchar *str, gint *pos) 1.8 +gint 1.9 +time_interval(gchar * str, gint * pos) 1.10 { 1.11 - gchar buf[16]; 1.12 - gchar *p = str, *q = buf; 1.13 - gint factor = 1, val; 1.14 + gchar buf[16]; 1.15 + gchar *p = str, *q = buf; 1.16 + gint factor = 1, val; 1.17 1.18 - while(*p && isdigit(*p) && (q < buf+15)){ 1.19 - *(q++) = *(p++); 1.20 - (*pos)++; 1.21 - } 1.22 - (*pos)++; 1.23 - *q = 0; 1.24 - val = atoi(buf); 1.25 - 1.26 - /* fall through: */ 1.27 - switch(*p){ 1.28 - case 'w': 1.29 - factor *= 7; 1.30 - case 'd': 1.31 - factor *= 24; 1.32 - case 'h': 1.33 - factor *= 60; 1.34 - case 'm': 1.35 - factor *= 60; 1.36 - case 's': 1.37 - break; 1.38 - default: 1.39 - return -1; 1.40 - } 1.41 - return val * factor; 1.42 + while (*p && isdigit(*p) && (q < buf + 15)) { 1.43 + *(q++) = *(p++); 1.44 + (*pos)++; 1.45 + } 1.46 + (*pos)++; 1.47 + *q = 0; 1.48 + val = atoi(buf); 1.49 + 1.50 + /* fall through: */ 1.51 + switch (*p) { 1.52 + case 'w': 1.53 + factor *= 7; 1.54 + case 'd': 1.55 + factor *= 24; 1.56 + case 'h': 1.57 + factor *= 60; 1.58 + case 'm': 1.59 + factor *= 60; 1.60 + case 's': 1.61 + break; 1.62 + default: 1.63 + return -1; 1.64 + } 1.65 + return val * factor; 1.66 }