From: Michael R Sweet Date: Wed, 17 Oct 2018 20:54:15 +0000 (-0400) Subject: Cleanup. X-Git-Tag: v2.3b6~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b353e63ec5c3caa91ed4c5859a35807e8654452;p=thirdparty%2Fcups.git Cleanup. --- diff --git a/cups/http-support.c b/cups/http-support.c index 3ce38885ef..eebba9906e 100644 --- a/cups/http-support.c +++ b/cups/http-support.c @@ -1322,7 +1322,7 @@ _httpSetDigestAuthString( size_t hashsize; /* Size of hash */ - DEBUG_printf(("2_httpSetDigestAuthString(http=%p, nonce=\"%s\", method=\"%s\", resource=\"%s\")", http, nonce, method, resource)); + DEBUG_printf(("2_httpSetDigestAuthString(http=%p, nonce=\"%s\", method=\"%s\", resource=\"%s\")", (void *)http, nonce, method, resource)); if (nonce && *nonce && strcmp(nonce, http->nonce)) { diff --git a/cups/ipp-file.c b/cups/ipp-file.c index dabc5356e1..8fd53dc2af 100644 --- a/cups/ipp-file.c +++ b/cups/ipp-file.c @@ -217,6 +217,8 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ * Skip whitespace and comments... */ + DEBUG_printf(("1_ippFileReadToken: linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp))); + while ((ch = cupsFileGetChar(f->fp)) != EOF) { if (_cups_isspace(ch)) @@ -226,7 +228,10 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ */ if (ch == '\n') + { f->linenum ++; + DEBUG_printf(("1_ippFileReadToken: LF in leading whitespace, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp))); + } } else if (ch == '#') { @@ -234,6 +239,8 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ * Comment... */ + DEBUG_puts("1_ippFileReadToken: Skipping comment in leading whitespace..."); + while ((ch = cupsFileGetChar(f->fp)) != EOF) { if (ch == '\n') @@ -241,7 +248,10 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ } if (ch == '\n') + { f->linenum ++; + DEBUG_printf(("1_ippFileReadToken: LF at end of comment, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp))); + } else break; } @@ -262,7 +272,10 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ while (ch != EOF) { if (ch == '\n') + { f->linenum ++; + DEBUG_printf(("1_ippFileReadToken: LF in token, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp))); + } if (ch == quote) { @@ -271,7 +284,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ */ *tokptr = '\0'; - DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token)); + DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" at closing quote.", token)); return (1); } else if (!quote && _cups_isspace(ch)) @@ -281,7 +294,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ */ *tokptr = '\0'; - DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token)); + DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" before whitespace.", token)); return (1); } else if (!quote && (ch == '\'' || ch == '\"')) @@ -291,6 +304,8 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ */ quote = ch; + + DEBUG_printf(("1_ippFileReadToken: Start of quoted string, quote=%c, pos=%ld", quote, (long)cupsFileTell(f->fp))); } else if (!quote && ch == '#') { @@ -300,7 +315,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ cupsFileSeek(f->fp, cupsFileTell(f->fp) - 1); *tokptr = '\0'; - DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token)); + DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" before comment.", token)); return (1); } else if (!quote && (ch == '{' || ch == '}' || ch == ',')) @@ -338,6 +353,8 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ * Quoted character... */ + DEBUG_printf(("1_ippFileReadToken: Quoted character at pos=%ld", (long)cupsFileTell(f->fp))); + if ((ch = cupsFileGetChar(f->fp)) == EOF) { *token = '\0'; @@ -345,7 +362,10 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ return (0); } else if (ch == '\n') + { f->linenum ++; + DEBUG_printf(("1_ippFileReadToken: quoted LF, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp))); + } } if (tokptr < tokend) @@ -376,7 +396,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */ } *tokptr = '\0'; - DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token)); + DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" at EOF.", token)); return (tokptr > token); } diff --git a/cups/testraster.c b/cups/testraster.c index a1d24cd2a1..d3dab4bbcc 100644 --- a/cups/testraster.c +++ b/cups/testraster.c @@ -34,13 +34,12 @@ int /* O - Exit status */ main(int argc, /* I - Number of command-line args */ char *argv[]) /* I - Command-line arguments */ { - int errors; /* Number of errors */ - const char *ext; /* Filename extension */ + int errors = 0; /* Number of errors */ if (argc == 1) { - errors = do_raster_tests(CUPS_RASTER_WRITE); + errors += do_raster_tests(CUPS_RASTER_WRITE); errors += do_raster_tests(CUPS_RASTER_WRITE_COMPRESSED); errors += do_raster_tests(CUPS_RASTER_WRITE_PWG); errors += do_raster_tests(CUPS_RASTER_WRITE_APPLE); @@ -49,7 +48,7 @@ main(int argc, /* I - Number of command-line args */ { int i; /* Looping var */ - for (errors = 0, i = 1; i < argc; i ++) + for (i = 1; i < argc; i ++) errors += do_ras_file(argv[i]); }