Răsfoiți Sursa

- removed nested function (made it static inline)

Andrei Pelinescu-Onciul 18 ani în urmă
părinte
comite
6adb3164b8
1 a modificat fișierele cu 10 adăugiri și 8 ștergeri
  1. 10 8
      parser/parse_date.c

+ 10 - 8
parser/parse_date.c

@@ -39,21 +39,23 @@
 #define READ(val) \
 #define READ(val) \
 (*(val + 0) + (*(val + 1) << 8) + (*(val + 2) << 16) + (*(val + 3) << 24))
 (*(val + 0) + (*(val + 1) << 8) + (*(val + 2) << 16) + (*(val + 3) << 24))
 
 
+inline static int char2int (char *p, int *t)
+{
+	if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9')
+		return -1;
+	*t = (*p - '0')*10 + *(p + 1) - '0';
+
+	return 0;
+}
+
 /*
 /*
  * Converts a RFC 1123 formatted date string to stuct tm
  * Converts a RFC 1123 formatted date string to stuct tm
  */
  */
-int rfc1123totm (char *stime, struct tm *ttm ) {
+static int rfc1123totm (char *stime, struct tm *ttm ) {
 	char *ptime = stime;
 	char *ptime = stime;
 	unsigned int uval;
 	unsigned int uval;
 	int ires;
 	int ires;
 
 
-	int char2int (char *p, int *t){
-		if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') return -1;
-		*t = (*p - '0')*10 + *(p + 1) - '0';
-
-		return 0;
-	}
-
 	uval = READ(ptime);
 	uval = READ(ptime);
 	ptime+=4;
 	ptime+=4;
 	switch (uval) {
 	switch (uval) {