Browse code

- removed nested function (made it static inline)

Andrei Pelinescu-Onciul authored on 08/05/2007 08:49:22
Showing 1 changed files
... ...
@@ -39,21 +39,23 @@
39 39
 #define READ(val) \
40 40
 (*(val + 0) + (*(val + 1) << 8) + (*(val + 2) << 16) + (*(val + 3) << 24))
41 41
 
42
+inline static int char2int (char *p, int *t)
43
+{
44
+	if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9')
45
+		return -1;
46
+	*t = (*p - '0')*10 + *(p + 1) - '0';
47
+
48
+	return 0;
49
+}
50
+
42 51
 /*
43 52
  * Converts a RFC 1123 formatted date string to stuct tm
44 53
  */
45
-int rfc1123totm (char *stime, struct tm *ttm ) {
54
+static int rfc1123totm (char *stime, struct tm *ttm ) {
46 55
 	char *ptime = stime;
47 56
 	unsigned int uval;
48 57
 	int ires;
49 58
 
50
-	int char2int (char *p, int *t){
51
-		if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') return -1;
52
-		*t = (*p - '0')*10 + *(p + 1) - '0';
53
-
54
-		return 0;
55
-	}
56
-
57 59
 	uval = READ(ptime);
58 60
 	ptime+=4;
59 61
 	switch (uval) {