--- embedaddon/mpd/src/web.c 2016/11/01 09:56:12 1.1.1.2 +++ embedaddon/mpd/src/web.c 2021/03/17 00:39:23 1.1.1.3 @@ -28,7 +28,7 @@ * INTERNAL FUNCTIONS */ - static int WebSetCommand(Context ctx, int ac, char *av[], void *arg); + static int WebSetCommand(Context ctx, int ac, const char *const av[], const void *arg); static int WebServletRun(struct http_servlet *servlet, struct http_request *req, struct http_response *resp); @@ -60,7 +60,7 @@ WebSetCommand, NULL, 2, (void *) SET_ENABLE }, { "disable [opt ...]", "Disable web option" , WebSetCommand, NULL, 2, (void *) SET_DISABLE }, - { NULL }, + { NULL, NULL, NULL, NULL, 0, NULL }, }; @@ -157,11 +157,15 @@ WebClose(Web w) */ int -WebStat(Context ctx, int ac, char *av[], void *arg) +WebStat(Context ctx, int ac, const char *const av[], const void *arg) { Web w = &gWeb; char addrstr[64]; + (void)ac; + (void)av; + (void)arg; + Printf("Web configuration:\r\n"); Printf("\tState : %s\r\n", w->srv ? "OPENED" : "CLOSED"); Printf("\tIP-Address : %s\r\n", u_addrtoa(&w->addr,addrstr,sizeof(addrstr))); @@ -446,6 +450,7 @@ WebShowJSONSummary(FILE *f, int priv) Rep R; char buf[64],buf2[64]; + (void)priv; int first_l = 1; fprintf(f, "{\"links\":[\n"); for (b = 0; bccp.fsm.state)); fprintf(f, "\"ecp\": \"%s\",\n", FsmStateName(B->ecp.fsm.state)); - int first_l = 1; + first_l = 1; fprintf(f, "\"links\":[\n"); for (l = 0; l < NG_PPP_MAX_LINKS; l++) { if ((L=B->links[l]) != NULL) { @@ -560,7 +565,7 @@ WebShowJSONSummary(FILE *f, int priv) fprintf(f, "\"repeater\": \"%s\",\n", R->name); - int first_l = 1; + first_l = 1; fprintf(f, "\"links\":[\n"); for (l = 0; l < 2; l++) { if ((L=R->links[l]) != NULL) { @@ -641,7 +646,7 @@ WebRunBinCmd(FILE *f, const char *query, int priv) for (k = 0; k < argc; k++) { int ac, rtn; - char *av[MAX_CONSOLE_ARGS]; + char *av[MAX_CONSOLE_ARGS]; char *buf1; buf1 = Malloc(MB_WEB, strlen(argv[k]) + 1); @@ -652,7 +657,7 @@ WebRunBinCmd(FILE *f, const char *query, int priv) buf1)); ac = ParseLine(buf1, av, sizeof(av) / sizeof(*av), 0); cs->context.errmsg[0] = 0; - rtn = DoCommandTab(&cs->context, gCommands, ac, av); + rtn = DoCommandTab(&cs->context, gCommands, ac, (const char *const *)av); Freee(buf1); fprintf(f, "RESULT: %d %s\n", rtn, cs->context.errmsg); } @@ -700,7 +705,7 @@ WebRunCmd(FILE *f, const char *query, int priv) fprintf(f, "
\n");
     for (k = 0; k < argc; k++) {
 	int	ac;
-	char	*av[MAX_CONSOLE_ARGS];
+	char *av[MAX_CONSOLE_ARGS];
 	char	*buf1;
 
 	buf1 = Malloc(MB_WEB, strlen(argv[k]) + 1);
@@ -714,7 +719,7 @@ WebRunCmd(FILE *f, const char *query, int priv)
 	cs->write(cs, "%s\n", buf1);
     
 	ac = ParseLine(buf1, av, sizeof(av) / sizeof(*av), 0);
-	DoCommand(&cs->context, ac, av, NULL, 0);
+	DoCommand(&cs->context, ac, (const char *const *)av, NULL, 0);
 	Freee(buf1);
     }
     fprintf(f, "
\n"); @@ -727,7 +732,9 @@ done: } static void -WebServletRunCleanup(void *cookie) { +WebServletRunCleanup(void *cookie) NO_THREAD_SAFETY_ANALYSIS +{ + (void)cookie; GIANT_MUTEX_UNLOCK(); } @@ -740,6 +747,7 @@ WebServletRun(struct http_servlet *servlet, const char *query; int priv = 0; + (void)servlet; if (Enabled(&gWeb.options, WEB_AUTH)) { const char *username; const char *password; @@ -824,6 +832,7 @@ WebServletRun(struct http_servlet *servlet, static void WebServletDestroy(struct http_servlet *servlet) { + (void)servlet; } static void @@ -831,6 +840,7 @@ WebLogger(int sev, const char *fmt, ...) { va_list args; + (void)sev; va_start(args, fmt); vLogPrintf(fmt, args); va_end(args); @@ -841,7 +851,7 @@ WebLogger(int sev, const char *fmt, ...) */ static int -WebSetCommand(Context ctx, int ac, char *av[], void *arg) +WebSetCommand(Context ctx, int ac, const char *const av[], const void *arg) { Web w = &gWeb; int port;