--- embedaddon/mpd/src/log.c 2019/10/22 13:49:55 1.1.1.3 +++ embedaddon/mpd/src/log.c 2021/03/17 00:39:23 1.1.1.4 @@ -176,11 +176,13 @@ LogClose(void) */ int -LogCommand(Context ctx, int ac, char *av[], void *arg) +LogCommand(Context ctx, int ac, const char *const av[], const void *arg) { u_int k; int bits, add; + const char *s; + (void)arg; if (ac == 0) { #define LG_FMT " %-12s %-10s %s\r\n" @@ -195,28 +197,29 @@ LogCommand(Context ctx, int ac, char *av[], void *arg) } while (ac--) { - switch (**av) { + s = *av; + switch (*s) { case '+': - (*av)++; + s++; default: add = TRUE; break; case '-': add = FALSE; - (*av)++; + s++; break; } for (k = 0; - k < NUM_LOG_LEVELS && strcasecmp(*av, LogOptionList[k].name); + k < NUM_LOG_LEVELS && strcasecmp(s, LogOptionList[k].name); k++); if (k < NUM_LOG_LEVELS) bits = LogOptionList[k].mask; else { - if (!strcasecmp(*av, "all")) { + if (!strcasecmp(s, "all")) { for (bits = k = 0; k < NUM_LOG_LEVELS; k++) bits |= LogOptionList[k].mask; } else { - Printf("\"%s\" is unknown. Enter \"log\" for list.\r\n", *av); + Printf("\"%s\" is unknown. Enter \"log\" for list.\r\n", s); bits = 0; } } @@ -246,7 +249,7 @@ LogPrintf(const char *fmt, ...) } void -vLogPrintf(const char *fmt, va_list args) +vLogPrintf(const char *fmt, va_list args) NO_THREAD_SAFETY_ANALYSIS { if (!SLIST_EMPTY(&gConsole.sessions)) { char buf[1000]; @@ -297,7 +300,8 @@ LogPrintf2(const char *fmt, ...) void LogDumpBp2(Mbuf bp, const char *fmt, ...) { - int k, total; + int k; + unsigned total; u_char bytes[DUMP_BYTES_PER_LINE]; char line[128]; int linelen; @@ -317,7 +321,8 @@ LogDumpBp2(Mbuf bp, const char *fmt, ...) total = 0; if (bp) { - int start, stop, last = 0; + int start, last = 0; + unsigned stop; stop = ROUNDUP(total + MBLEN(bp), DUMP_BYTES_PER_LINE); for (start = total; total < stop; ) {