Browse Source

Workaround for unused warning (maybe the code will be removed later)

bel2125 8 years ago
parent
commit
f2a56b3b06
1 changed files with 17 additions and 17 deletions
  1. 17 17
      src/main.c

+ 17 - 17
src/main.c

@@ -343,22 +343,6 @@ create_config_file(const struct mg_context *ctx, const char *path)
 #endif
 
 
-static unsigned
-hex2dec(char x)
-{
-	if ((x >= '0') && (x <= '9')) {
-		return (unsigned)x - (unsigned)'0';
-	}
-	if ((x >= 'A') && (x <= 'F')) {
-		return (unsigned)x - (unsigned)'A' + 10u;
-	}
-	if ((x >= 'a') && (x <= 'f')) {
-		return (unsigned)x - (unsigned)'a' + 10u;
-	}
-	return 0;
-}
-
-
 static char *
 sdup(const char *str)
 {
@@ -373,7 +357,23 @@ sdup(const char *str)
 }
 
 
-#if 0
+#if 0 /* Unused code from "string duplicate with escape" */
+static unsigned
+hex2dec(char x)
+{
+    if ((x >= '0') && (x <= '9')) {
+        return (unsigned)x - (unsigned)'0';
+    }
+    if ((x >= 'A') && (x <= 'F')) {
+        return (unsigned)x - (unsigned)'A' + 10u;
+    }
+    if ((x >= 'a') && (x <= 'f')) {
+        return (unsigned)x - (unsigned)'a' + 10u;
+    }
+    return 0;
+}
+
+
 static char *
 sdupesc(const char *str)
 {