]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - ppdc/ppdc-source.cxx
Update Github repository to match macOS 11.2 CUPS sources (cups-494.1).
[thirdparty/cups.git] / ppdc / ppdc-source.cxx
index 4e8cba7bb3472dab415f0e0548a2d67dcbeba8ae..a42449765076be5b039f0dab0bc1b96d91e11ae4 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Source class for the CUPS PPD Compiler.
 //
-// Copyright 2007-2018 by Apple Inc.
+// Copyright 2007-2020 by Apple Inc.
 // Copyright 2002-2007 by Easy Software Products.
 //
 // Licensed under Apache License v2.0.  See the file "LICENSE" for more
@@ -20,9 +20,9 @@
 #include "data/epson.h"
 #include "data/hp.h"
 #include "data/label.h"
-#ifndef WIN32
+#ifndef _WIN32
 #  include <sys/utsname.h>
-#endif // !WIN32
+#endif // !_WIN32
 
 
 //
@@ -70,7 +70,7 @@ ppdcSource::ppdcSource(const char  *f,        // I - File to read
   vars->add(new ppdcVariable("CUPS_VERSION_MINOR", MAKE_STRING(CUPS_VERSION_MINOR)));
   vars->add(new ppdcVariable("CUPS_VERSION_PATCH", MAKE_STRING(CUPS_VERSION_PATCH)));
 
-#ifdef WIN32
+#ifdef _WIN32
   vars->add(new ppdcVariable("PLATFORM_NAME", "Windows"));
   vars->add(new ppdcVariable("PLATFORM_ARCH", "X86"));
 
@@ -87,7 +87,7 @@ ppdcSource::ppdcSource(const char  *f,        // I - File to read
     vars->add(new ppdcVariable("PLATFORM_NAME", "unknown"));
     vars->add(new ppdcVariable("PLATFORM_ARCH", "unknown"));
   }
-#endif // WIN32
+#endif // _WIN32
 
   if (f)
     read_file(f, ffp);
@@ -1743,15 +1743,17 @@ ppdcSource::get_resolution(ppdcFile *fp)// I - File to read
 
   switch (sscanf(name, "%dx%d", &xdpi, &ydpi))
   {
-    case 0 :
-        _cupsLangPrintf(stderr,
-                       _("ppdc: Bad resolution name \"%s\" on line %d of "
-                         "%s."), name, fp->line, fp->filename);
-        break;
     case 1 :
         ydpi = xdpi;
-       break;
-  }
+        break;
+    case 2 :
+        break;
+    default :
+        _cupsLangPrintf(stderr,
+                  _("ppdc: Bad resolution name \"%s\" on line %d of "
+        "%s."), name, fp->line, fp->filename);
+        break;
+}
 
   // Create the necessary PS commands...
   snprintf(command, sizeof(command),