]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - ppdc/ppdc.cxx
Full sweep of all Clang warnings, plus some bug fixes for incorrect memcpy usage.
[thirdparty/cups.git] / ppdc / ppdc.cxx
index 9d4b11e21f012a69868f058580fb76a76fdc74ae..9074df17358c0b3a4eb58cc9d2c07cc46a97e9be 100644 (file)
@@ -3,7 +3,7 @@
 //
 //   PPD file compiler main entry for the CUPS PPD Compiler.
 //
-//   Copyright 2007-2010 by Apple Inc.
+//   Copyright 2007-2012 by Apple Inc.
 //   Copyright 2002-2007 by Easy Software Products.
 //
 //   These coded instructions, statements, and computer programs are the
@@ -80,7 +80,7 @@ main(int  argc,                               // I - Number of command-line arguments
   src             = new ppdcSource();
   use_model_name  = 0;
   verbose         = 0;
-  filenames       = cupsArrayNew((cups_array_func_t)strcasecmp, NULL);
+  filenames       = cupsArrayNew((cups_array_func_t)_cups_strcasecmp, NULL);
 
   for (i = 1; i < argc; i ++)
     if (argv[i][0] == '-')
@@ -213,7 +213,7 @@ main(int  argc,                             // I - Number of command-line arguments
           case 'v' :                   // Be verbose...
              verbose ++;
              break;
-           
+
           case 'z' :                   // Compress files...
              comp = 1;
              break;
@@ -237,7 +237,7 @@ main(int  argc,                             // I - Number of command-line arguments
                opt += strlen(opt) - 1;
                break;
              }
-           
+
          default :                     // Unknown
              usage();
              break;
@@ -319,7 +319,7 @@ main(int  argc,                             // I - Number of command-line arguments
        // Write the PPD file for this driver...
        if (use_model_name)
        {
-         if (!strncasecmp(d->model_name->value, d->manufacturer->value,
+         if (!_cups_strncasecmp(d->model_name->value, d->manufacturer->value,
                           strlen(d->manufacturer->value)))
          {
            // Model name already starts with the manufacturer...
@@ -344,7 +344,7 @@ main(int  argc,                             // I - Number of command-line arguments
          for (j = 0;
               outname[j] && j < (int)(sizeof(pcfilename) - 1);
               j ++)
-           pcfilename[j] = tolower(outname[j] & 255);
+           pcfilename[j] = (char)tolower(outname[j] & 255);
 
          pcfilename[j] = '\0';
        }
@@ -435,30 +435,29 @@ usage(void)
   _cupsLangPuts(stdout, _("Usage: ppdc [options] filename.drv [ ... "
                           "filenameN.drv ]"));
   _cupsLangPuts(stdout, _("Options:"));
-  _cupsLangPuts(stdout, _("  -D name=value        Set named variable to "
+  _cupsLangPuts(stdout, _("  -D name=value           Set named variable to "
                           "value."));
-  _cupsLangPuts(stdout, _("  -I include-dir       Add include directory to "
+  _cupsLangPuts(stdout, _("  -I include-dir          Add include directory to "
                           "search path."));
-  _cupsLangPuts(stdout, _("  -c catalog.po        Load the specified message "
-                          "catalog."));
-  _cupsLangPuts(stdout, _("  -d output-dir        Specify the output "
+  _cupsLangPuts(stdout, _("  -c catalog.po           Load the specified "
+                          "message catalog."));
+  _cupsLangPuts(stdout, _("  -d output-dir           Specify the output "
                           "directory."));
-  _cupsLangPuts(stdout, _("  -l lang[,lang,...]   Specify the output "
+  _cupsLangPuts(stdout, _("  -l lang[,lang,...]      Specify the output "
                           "language(s) (locale)."));
-  _cupsLangPuts(stdout, _("  -m                   Use the ModelName value as "
-                          "the filename."));
-  _cupsLangPuts(stdout, _("  -t                   Test PPDs instead of "
+  _cupsLangPuts(stdout, _("  -m                      Use the ModelName value "
+                          "as the filename."));
+  _cupsLangPuts(stdout, _("  -t                      Test PPDs instead of "
                           "generating them."));
-  _cupsLangPuts(stdout, _("  -v                   Be verbose (more v's for "
-                          "more verbosity)."));
-  _cupsLangPuts(stdout, _("  -z                   Compress PPD files using GNU "
-                          "zip."));
-  _cupsLangPuts(stdout, _("  --cr                 End lines with CR (Mac OS "
-                          "9)."));
-  _cupsLangPuts(stdout, _("  --crlf               End lines with CR + LF "
+  _cupsLangPuts(stdout, _("  -v                      Be verbose."));
+  _cupsLangPuts(stdout, _("  -z                      Compress PPD files using "
+                          "GNU zip."));
+  _cupsLangPuts(stdout, _("  --cr                    End lines with CR (Mac "
+                          "OS 9)."));
+  _cupsLangPuts(stdout, _("  --crlf                  End lines with CR + LF "
                           "(Windows)."));
-  _cupsLangPuts(stdout, _("  --lf                 End lines with LF (UNIX/"
-                          "Linux/Mac OS X)."));
+  _cupsLangPuts(stdout, _("  --lf                    End lines with LF "
+                          "(UNIX/Linux/OS X)."));
 
   exit(1);
 }