]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters/libppd: More coding style clean-up ...
authorTill Kamppeter <till.kamppeter@gmail.com>
Mon, 17 Oct 2022 17:29:10 +0000 (19:29 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Mon, 17 Oct 2022 17:29:10 +0000 (19:29 +0200)
16 files changed:
cupsfilters/bitmap.c
cupsfilters/catalog.c
cupsfilters/colord.c
cupsfilters/filter.c
cupsfilters/fontembed/embed-sfnt.c
cupsfilters/fontembed/fontfile.c
cupsfilters/ghostscript.c
cupsfilters/imagetopdf.c
cupsfilters/ipp.c
cupsfilters/pdftopdf/intervalset.cxx
cupsfilters/pdftopdf/nup.cxx
cupsfilters/pdftopdf/pdftopdf-processor.cxx
cupsfilters/pwgtopdf.cxx
cupsfilters/pwgtoraster.c
cupsfilters/universal.c
ppd/ppd-collection.cxx

index c82b6c725d9030baff6a3daddb721aaa445f8320..5bd109d3a777e260d5d9b730e3029de07c49c2b5 100644 (file)
@@ -431,7 +431,8 @@ cfOneBitLine(unsigned char *src,  // I - Input line
     for (int k = 0; k < 8; k++)
     {
       t <<= 1;
-      if (w + k < width) {
+      if (w + k < width)
+      {
        if (bi_level)
          threshold = 128;
         else
index 23e34269a601b4dd0ebd7c8723aa35ed60d0f90d..ef2a2950aca7784b7aaeeb3d3e952800af70f553 100644 (file)
@@ -132,7 +132,8 @@ cfCatalogSearchDir(const char *dirname)
       i = 3;
     else
       i = 2;
-    if (c1[i] == '_') {
+    if (c1[i] == '_')
+    {
       i ++;
       if (c1[i] < 'A' || c1[i] > 'Z' || c1[i + 1] < 'A' || c1[i + 1] > 'Z')
        continue;
@@ -461,7 +462,9 @@ cfCatalogLoad(const char *location,
     }
     else
       filename = location;
-  } else {
+  }
+  else
+  {
     if (cfGetURI(location, tmpfile, sizeof(tmpfile)))
       filename = tmpfile;
   }
@@ -645,7 +648,8 @@ cfCatalogLoad(const char *location,
              *end ++ = *ptr;
            ptr ++;
          }
-       } else
+       }
+       else
          *end ++ = *ptr ++;
       }
       *end = '\0';
index 641a83157fdfdb92baee1fc0225a3849de1ee002..3e00ff1d74856edc52480aca1d31ee473d77efb0 100644 (file)
@@ -263,7 +263,8 @@ get_profile_for_device_path(cf_filter_data_t *data,
     dbus_message_unref(message);
   if (reply != NULL)
     dbus_message_unref(reply);
-  if (key != NULL) {
+  if (key != NULL)
+  {
     for (i = 0; i < max_keys; i ++)
       free(key[i]);
     free(key);
index fb6f46fcbce9813eeb361fafe98a37e4615dbcd6..80b1634d06b72d072ef8d87d108bd1026b45db01 100644 (file)
@@ -444,7 +444,8 @@ cfFilterPOpen(cf_filter_function_t filter_func,
   // Open a pipe ...
   //
 
-  if (pipe(pipefds) < 0) {
+  if (pipe(pipefds) < 0)
+  {
     if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPOpen: Could not create pipe for %s: %s",
                 inputfd < 0 ? "input" : "output",
@@ -452,19 +453,23 @@ cfFilterPOpen(cf_filter_function_t filter_func,
     return (-1);
   }
 
-  if ((pid = fork()) == 0) {
+  if ((pid = fork()) == 0)
+  {
     //
     // Child process goes here...
     //
     // Update input and output FDs as needed...
     //
 
-    if (inputfd < 0) {
+    if (inputfd < 0)
+    {
       inputseekable = 0;
       infd = pipefds[0];
       outfd = outputfd;
       close(pipefds[1]);
-    } else {
+    }
+    else
+    {
       infd = inputfd;
       outfd = pipefds[1];
       close(pipefds[0]);
@@ -487,7 +492,9 @@ cfFilterPOpen(cf_filter_function_t filter_func,
                 ret);
     exit(ret);
 
-  } else if (pid > 0) {
+  }
+  else if (pid > 0)
+  {
     if (log) log(ld, CF_LOGLEVEL_INFO,
                 "cfFilterPOpen: Filter function (PID %d) started.", pid);
 
@@ -501,15 +508,20 @@ cfFilterPOpen(cf_filter_function_t filter_func,
     // Return file descriptor to stream to or from
     //
 
-    if (inputfd < 0) {
+    if (inputfd < 0)
+    {
       close(pipefds[0]);
       return (pipefds[1]);
-    } else {
+    }
+    else
+    {
       close(pipefds[1]);
       return (pipefds[0]);
     }
 
-  } else {
+  }
+  else
+  {
 
     //
     // fork() error
@@ -639,13 +651,16 @@ cfFilterChain(int inputfd,         // I - File descriptor input stream
 
   for (filter = (cf_filter_filter_in_chain_t *)cupsArrayFirst(filter_chain);
        filter;
-       filter = (cf_filter_filter_in_chain_t *)cupsArrayNext(filter_chain)) {
-    if (!filter->function) {
+       filter = (cf_filter_filter_in_chain_t *)cupsArrayNext(filter_chain))
+  {
+    if (!filter->function)
+    {
       if (log) log(ld, CF_LOGLEVEL_INFO,
                   "cfFilterChain: Invalid filter: %s - Removing...",
                   filter->name ? filter->name : "Unspecified");
       cupsArrayRemove(filter_chain, filter);
-    } else
+    }
+    else
       if (log) log(ld, CF_LOGLEVEL_INFO,
                   "cfFilterChain: Running filter: %s",
                   filter->name ? filter->name : "Unspecified");
@@ -692,20 +707,25 @@ cfFilterChain(int inputfd,         // I - File descriptor input stream
 
   for (filter = (cf_filter_filter_in_chain_t *)cupsArrayFirst(filter_chain);
        filter;
-       filter = next, current = 1 - current) {
+       filter = next, current = 1 - current)
+  {
     next = (cf_filter_filter_in_chain_t *)cupsArrayNext(filter_chain);
 
-    if (filterfds[1 - current][0] > 1) {
+    if (filterfds[1 - current][0] > 1)
+    {
       close(filterfds[1 - current][0]);
       filterfds[1 - current][0] = -1;
     }
-    if (filterfds[1 - current][1] > 1) {
+    if (filterfds[1 - current][1] > 1)
+    {
       close(filterfds[1 - current][1]);
       filterfds[1 - current][1] = -1;
     }
 
-    if (next) {
-      if (pipe(filterfds[1 - current]) < 0) {
+    if (next)
+    {
+      if (pipe(filterfds[1 - current]) < 0)
+      {
        if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterChain: Could not create pipe for output of %s: %s",
                     filter->name ? filter->name : "Unspecified filter",
@@ -714,10 +734,12 @@ cfFilterChain(int inputfd,         // I - File descriptor input stream
       }
       fcntl_add_cloexec(filterfds[1 - current][0]);
       fcntl_add_cloexec(filterfds[1 - current][1]);
-    } else
+    }
+    else
       filterfds[1 - current][1] = outputfd;
 
-    if ((pid = fork()) == 0) {
+    if ((pid = fork()) == 0)
+    {
       //
       // Child process goes here...
       //
@@ -751,7 +773,9 @@ cfFilterChain(int inputfd,         // I - File descriptor input stream
                   filter->name ? filter->name : "Unspecified filter", ret);
       exit(ret);
 
-    } else if (pid > 0) {
+    }
+    else if (pid > 0)
+    {
       if (log) log(ld, CF_LOGLEVEL_INFO,
                   "cfFilterChain: %s (PID %d) started.",
                   filter->name ? filter->name : "Unspecified filter", pid);
@@ -760,7 +784,9 @@ cfFilterChain(int inputfd,         // I - File descriptor input stream
       pid_entry->pid = pid;
       pid_entry->name = filter->name ? filter->name : "Unspecified filter";
       cupsArrayAdd(pids, pid_entry);
-    } else {
+    }
+    else
+    {
       if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterChain: Could not fork to start %s: %s",
                   filter->name ? filter->name : "Unspecified filter",
@@ -790,39 +816,51 @@ cfFilterChain(int inputfd,         // I - File descriptor input stream
 
   retval = 0;
 
-  while (cupsArrayCount(pids) > 0) {
-    if ((pid = wait(&status)) < 0) {
-      if (errno == EINTR && iscanceled && iscanceled(icd)) {
+  while (cupsArrayCount(pids) > 0)
+  {
+    if ((pid = wait(&status)) < 0)
+    {
+      if (errno == EINTR && iscanceled && iscanceled(icd))
+      {
        if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterChain: Job canceled, killing filters ...");
        for (pid_entry = (filter_function_pid_t *)cupsArrayFirst(pids);
             pid_entry;
-            pid_entry = (filter_function_pid_t *)cupsArrayNext(pids)) {
+            pid_entry = (filter_function_pid_t *)cupsArrayNext(pids))
+       {
          kill(pid_entry->pid, SIGTERM);
          free(pid_entry);
        }
        break;
-      } else
+      }
+      else
        continue;
     }
 
     key.pid = pid;
     if ((pid_entry = (filter_function_pid_t *)cupsArrayFind(pids, &key)) !=
-       NULL) {
+       NULL)
+    {
       cupsArrayRemove(pids, pid_entry);
 
-      if (status) {
-       if (WIFEXITED(status)) {
+      if (status)
+      {
+       if (WIFEXITED(status))
+       {
          if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterChain: %s (PID %d) stopped with status %d",
                       pid_entry->name, pid, WEXITSTATUS(status));
-       } else {
+       }
+       else
+       {
          if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterChain: %s (PID %d) crashed on signal %d",
                       pid_entry->name, pid, WTERMSIG(status));
        }
        retval = 1;
-      } else {
+      }
+      else
+      {
        if (log) log(ld, CF_LOGLEVEL_INFO,
                       "cfFilterChain: %s (PID %d) exited with no errors.",
                       pid_entry->name, pid);
@@ -1208,7 +1246,8 @@ cfFilterExternal(int inputfd,              // I - File descriptor input stream
                       "cfFilterExternal (%s): Failed to connect input file descriptor with CUPS filter's stdin - %s",
                       filter_name, strerror(errno));
          goto fd_error;
-       } else
+       }
+       else
          if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterExternal (%s): Connected input file descriptor %d to CUPS filter's stdin.",
                       filter_name, inputfd);
@@ -1230,7 +1269,8 @@ cfFilterExternal(int inputfd,              // I - File descriptor input stream
       if (outputfd < 0)
         outputfd = open("/dev/null", O_WRONLY);
 
-      if (outputfd > 1) {
+      if (outputfd > 1)
+      {
        fcntl_add_cloexec(outputfd);
        dup2(outputfd, 1);
        close(outputfd);
@@ -1246,7 +1286,8 @@ cfFilterExternal(int inputfd,              // I - File descriptor input stream
        fcntl_add_cloexec(fd);
        dup2(fd, 2);
        close(fd);
-      } else
+      }
+      else
         close(fd);
     }
     else
@@ -1293,7 +1334,8 @@ cfFilterExternal(int inputfd,              // I - File descriptor input stream
        {
          dup2(sidefd, 4);
          close(sidefd);
-       } else
+       }
+       else
          close(sidefd);
        fcntl_add_nonblock(4);
       }
index 3120ecc0c1622c46867d402617864f9ff41c761e..ff6a17a8c8bce10270012ef0898783116e975660 100644 (file)
@@ -79,7 +79,8 @@ __cfFontEmbedEmbOTFGetFontName(_cf_fontembed_otf_file_t *otf) // {{{
         fontname[iB ++] = fname[iA];
     }
     fontname[iB] = 0;
-  } else
+  }
+  else
     fontname[0] = 0;
 
   if (!*fontname)
@@ -199,7 +200,9 @@ __cfFontEmbedEmbOTFGetPDFFontDescr(_cf_fontembed_otf_file_t *otf,
       free(os2);
       os2 = NULL;
     }
-  } else {
+  }
+  else
+  {
     fprintf(stderr,"WARNING: no OS/2 table\n");
     // e.g. Subsetted font from Ghostscript // e.g. CFF
   }
index 1c8c24687db6db576023b699cb7dd2902de1b360..60cb89d6c5880ddb69e7ba9800ba7a0da38bdc21 100644 (file)
@@ -10,7 +10,8 @@ _cf_fontembed_fontfile_t *
 _cfFontEmbedFontFileOpen(const char *filename)
 {
   // TODO? check magic
-  if (...) {
+  if (...)
+  {
   }
 }
 #endif // 0
index 8b2d513f0c885bfeb4c5fae6eb88b1288d20f925..6e7a153aa5e68bfd0cffa03d448338a55c19bd24 100644 (file)
@@ -248,7 +248,8 @@ header_to_gs_args(gs_page_header *h,
          mediapos = 7;
        else
          mediapos = 0;
-      } else
+      }
+      else
        mediapos = h->MediaPosition;
       snprintf(tmpstr, sizeof(tmpstr), "-dMediaPosition=%d",
               (unsigned)(mediapos));
@@ -969,7 +970,8 @@ cfFilterGhostscript(int inputfd,            // I - File descriptor input
 
        goto out;
       }
-    } else
+    }
+    else
       filename = NULL;
 
     if (!inputseekable)
@@ -983,7 +985,7 @@ cfFilterGhostscript(int inputfd,            // I - File descriptor input
       if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
          outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
          outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
-       if (write(outputfd, "RaS2", 4)) {};
+       if (write(outputfd, "RaS2", 4));
       goto out;
     }
     if (doc_type == GS_DOC_TYPE_UNKNOWN)
@@ -1005,7 +1007,7 @@ cfFilterGhostscript(int inputfd,            // I - File descriptor input
        if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
            outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
            outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
-         if (write(outputfd, "RaS2", 4)) {};
+         if (write(outputfd, "RaS2", 4));
        goto out;
       }
       if (pages < 0)
@@ -1050,7 +1052,7 @@ cfFilterGhostscript(int inputfd,            // I - File descriptor input
        if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
            outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
            outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
-         if (write(outputfd, "RaS2", 4)) {};
+         if (write(outputfd, "RaS2", 4));
        goto out;
       }
       if (pagecount < 0)
index 1faf78fc3a7d5d17c1d2713b1afa667b5d21153a..417236409764bf839dd0999a53cac4b1d1f50867 100644 (file)
@@ -675,7 +675,8 @@ cfFilterImageToPDF(int inputfd,         // I - File descriptor input stream
   // Copy input into temporary file if needed ...
   //
 
-  if (!inputseekable) {
+  if (!inputseekable)
+  {
     if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
     {
       if (log) log(ld, CF_LOGLEVEL_ERROR,
@@ -1343,7 +1344,9 @@ cfFilterImageToPDF(int inputfd,         // I - File descriptor input stream
     // Because calculation error may be caused and
     // result of ceil function may be larger than 1.
     doc.xpages = doc.ypages = 1;
-  } else {
+  }
+  else
+  {
     doc.xpages = ceil(doc.xinches / doc.xprint);
     doc.ypages = ceil(doc.yinches / doc.yprint);
   }
@@ -1530,7 +1533,8 @@ cfFilterImageToPDF(int inputfd,         // I - File descriptor input stream
     doc.Collate = 0;
   }
 
-  if (((doc.xpages*doc.ypages) % 2) == 0) {
+  if (((doc.xpages*doc.ypages) % 2) == 0)
+  {
     // even pages, disable EvenDuplex
     doc.EvenDuplex = 0;
   }
index 6956408b50bfe84d28dcbace2e8ff6a484c15e6b..741e599cc0387938263c90a1d03c23f858806528 100644 (file)
@@ -667,7 +667,7 @@ cfippfindBasedURIConverter (const char *uri, int is_fax)
     // Wait until we get a valid process ID or the job is canceled...
     //
 
-    while ((wait_pid = wait(&wait_status)) < 0 && errno == EINTR) {};
+    while ((wait_pid = wait(&wait_status)) < 0 && errno == EINTR);
 
     if (wait_pid < 0)
       break;
@@ -822,12 +822,14 @@ cfIPPAttrIntValForPrinter(ipp_t *printer_attrs, // I - Printer attributes, same
          retval = 0; // Job attribute value out of range
       }
     }
-    if (retval == 0) {
+    if (retval == 0)
+    {
       // Use default value from printer attributes
       snprintf(printer_attr_name, sizeof(printer_attr_name) - 1,
               "%s-default", attr_name);
       if ((attr = ippFindAttribute(printer_attrs, printer_attr_name,
-                                  IPP_TAG_ZERO)) != NULL) {
+                                  IPP_TAG_ZERO)) != NULL)
+      {
        retval = 1;
        val = ippGetInteger(attr, 0);
       }
@@ -1330,10 +1332,13 @@ cfStrFormatd(char         *buf,         // I - String
   // Next, find the decimal point...
   //
 
-  if (loc && loc->decimal_point) {
+  if (loc && loc->decimal_point)
+  {
     dec    = loc->decimal_point;
     declen = (int)strlen(dec);
-  } else {
+  }
+  else
+  {
     dec    = ".";
     declen = 1;
   }
@@ -1347,14 +1352,16 @@ cfStrFormatd(char         *buf,         // I - String
   // Copy everything up to the decimal point...
   //
 
-  if (tempdec) {
+  if (tempdec)
+  {
     for (tempptr = temp, bufptr = buf;
          tempptr < tempdec && bufptr < bufend;
         *bufptr++ = *tempptr++);
 
     tempptr += declen;
 
-    if (*tempptr && bufptr < bufend) {
+    if (*tempptr && bufptr < bufend)
+    {
       *bufptr++ = '.';
 
       while (*tempptr && bufptr < bufend)
@@ -1362,7 +1369,9 @@ cfStrFormatd(char         *buf,           // I - String
     }
 
     *bufptr = '\0';
-  } else {
+  }
+  else
+  {
     strlcpy(buf, temp, (size_t)(bufend - buf + 1));
     bufptr = buf + strlen(buf);
   }
@@ -1594,7 +1603,8 @@ cfJoinResolutionArrays(cups_array_t **current,
        *current_default = cfCopyResolution(*new_default, NULL);
     }
     retval = 1;
-  } else
+  }
+  else
     retval = 0;
 
  finish:
@@ -2034,7 +2044,8 @@ cfGenerateSizes(ipp_t *response,
         i < count; i ++)
       if (ippGetInteger(attr, i) < *custom_left)
         *custom_left = ippGetInteger(attr, i);
-  } else
+  }
+  else
     *custom_left = 635;
 
   if (custom_bottom == NULL)
@@ -2047,7 +2058,8 @@ cfGenerateSizes(ipp_t *response,
         i < count; i ++)
       if (ippGetInteger(attr, i) < *custom_bottom)
         *custom_bottom = ippGetInteger(attr, i);
-  } else
+  }
+  else
     *custom_bottom = 1270;
 
   if (custom_right == NULL)
@@ -2060,7 +2072,8 @@ cfGenerateSizes(ipp_t *response,
         i < count; i ++)
       if (ippGetInteger(attr, i) < *custom_right)
         *custom_right = ippGetInteger(attr, i);
-  } else
+  }
+  else
     *custom_right = 635;
 
   if (custom_top == NULL)
@@ -2073,7 +2086,8 @@ cfGenerateSizes(ipp_t *response,
         i < count; i ++)
       if (ippGetInteger(attr, i) < *custom_top)
         *custom_top = ippGetInteger(attr, i);
-  } else
+  }
+  else
     *custom_top = 1270;
 
   if (mode != CF_GEN_SIZES_DEFAULT)
@@ -2154,7 +2168,8 @@ cfGenerateSizes(ipp_t *response,
        x = ippGetInteger(x_dim, 0);
        y = ippGetInteger(y_dim, 0);
        if (x > 0 && y > 0 &&
-           (pwg = pwgMediaForSize(x, y)) != NULL) {
+           (pwg = pwgMediaForSize(x, y)) != NULL)
+       {
          psname = (pwg->ppd != NULL ? pwg->ppd : pwg->pwg);
          if (local_bottom == 0 && local_left == 0 &&
              local_right == 0 && local_top == 0)
@@ -2327,7 +2342,8 @@ cfGenerateSizes(ipp_t *response,
       y_dim       = ippFindAttribute(media_size, "y-dimension", IPP_TAG_ZERO);
       // Move "if" for custom size parameters here 
       //if (ippGetValueTag(x_dim) == IPP_TAG_RANGE ||
-      //        ippGetValueTag(y_dim) == IPP_TAG_RANGE) {
+      //    ippGetValueTag(y_dim) == IPP_TAG_RANGE)
+      //{
       pwg         = pwgMediaForSize(ippGetInteger(x_dim, 0),
                                    ippGetInteger(y_dim, 0));
       name        = ippFindAttribute(media_col, "media-size-name",
@@ -2516,7 +2532,8 @@ cfGenerateSizes(ipp_t *response,
       pwg         = pwgMediaForSize(ippGetInteger(x_dim, 0),
                                    ippGetInteger(y_dim, 0));
 
-      if (pwg) {
+      if (pwg)
+      {
        if (!sizes && mode == CF_GEN_SIZES_DEFAULT)
          continue;
 
@@ -2664,7 +2681,8 @@ cfGenerateSizes(ipp_t *response,
                snprintf(temp2->media + strlen(temp2->media),
                         sizeof(temp2->media) - strlen(temp2->media),
                         " %s", pwg_size);
-           } else
+           }
+           else
              cupsArrayAdd(*sizes, &temp);
          }
        }
index 549c04c54cf299b71ac58d0fe2730c247bae388d..8dc924ac9126d20d432f255ee5649112a0c2f9c0 100644 (file)
@@ -74,7 +74,8 @@ _cfPDFToPDFIntervalSet::next(key_t val) const // {{{
   val ++;
   data_t::const_iterator it =
     std::upper_bound(data.begin(), data.end(), std::make_pair(val, npos));
-  if (it == data.begin()) {
+  if (it == data.begin())
+  {
     if (it == data.end()) // empty
       return (npos);
     return (it->first);
@@ -114,22 +115,27 @@ void
 _cfPDFToPDFIntervalSet::dump(pdftopdf_doc_t *doc) const // {{{
 {
   int len = data.size();
-  if (len == 0) {
+  if (len == 0)
+  {
     if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: (empty)");
     return;
   }
   len --;
-  for (int iA = 0; iA < len; iA ++) {
+  for (int iA = 0; iA < len; iA ++)
+  {
     if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: [%d,%d)",
                                   data[iA].first, data[iA].second);
   }
-  if (data[len].second == npos) {
+  if (data[len].second == npos)
+  {
     if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: [%d,inf)",
                                   data[len].first);
-  } else {
+  }
+  else
+  {
     if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: [%d,%d)",
                                   data[len].first, data[len].second);
index c0039057c7e003447fd197511fe60ef7143617bf..21fcac291e609a10fb8320f64152e77208405c1d 100644 (file)
@@ -165,10 +165,13 @@ std::pair<int,int>
 _cfPDFToPDFNupState::convert_order(int subpage) const // {{{
 {
   int subx, suby;
-  if (param.first==pdftopdf_axis_e::X) {
+  if (param.first==pdftopdf_axis_e::X)
+  {
     subx = subpage % param.nupX;
     suby = subpage / param.nupX;
-  } else {
+  }
+  else
+  {
     subx = subpage / param.nupY;
     suby = subpage % param.nupY;
   }
index 926cd4415c60a508836ebd2585c21a43b24f5339..0afe1a615c7cb8a737d0a54da831b4e033dfa142 100644 (file)
@@ -497,7 +497,8 @@ _cfProcessPDFToPDF(_cfPDFToPDFProcessor &proc,
                                     param.copies_to_be_logged);
   }
 
-  if ((param.even_duplex || !param.odd_pages) && (outputno & 1)) {
+  if ((param.even_duplex || !param.odd_pages) && (outputno & 1))
+  {
     // need to output empty page to not confuse duplex
     proc.add_page(proc.new_page(param.page.width,
                                param.page.height, doc), param.reverse);
index 5d81ceb9355676e246d7a5593dbd84b45e956ff9..244bfb63e34b69e98b6f04f6393cc6c731e410b6 100644 (file)
@@ -364,10 +364,13 @@ static int
 create_pdf_file(struct pdf_info * info,
                const cf_filter_out_format_t &outformat)
 {
-  try {
+  try
+  {
     info->pdf.emptyPDF();
     info->outformat = outformat;
-  } catch (...) {
+  }
+  catch (...)
+  {
     return (1);
   }
   return (0);
@@ -659,13 +662,15 @@ get_calibration_array(const char *color_space,
     bp_str[0] = '\0';
 
   // Matrix
-  if (!strcmp("/CalRGB", color_space) && matrix != NULL) {
+  if (!strcmp("/CalRGB", color_space) && matrix != NULL)
+  {
     snprintf(matrix_str, sizeof(matrix_str),
             "/Matrix [%g %g %g %g %g %g %g %g %g]", 
             matrix[0], matrix[1], matrix[2],
             matrix[3], matrix[4], matrix[5],
             matrix[6], matrix[7], matrix[8]);
-  } else
+  }
+  else
     matrix_str[0] = '\0';
 
   // Write array string...
@@ -1777,11 +1782,12 @@ cfFilterPWGToPDF(int inputfd,  // I - File descriptor input stream
     // for testing. Forces color management to enable.
     if (outformat == CF_FILTER_OUT_FORMAT_PDF &&
         (profile_name = cupsGetOption("profile", data->num_options,
-                                     data->options)) != NULL) {
+                                     data->options)) != NULL)
+    {
       set_profile(profile_name, &doc);
       doc.cm_disabled = 0;
     }
-    if (doc.colorProfile != NULL)       
+    if (doc.colorProfile != NULL)
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPWGToPDF: TEST ICC Profile specified (color "
                   "management forced ON): \n[%s]", profile_name);
index e69973bb263fb0685fba1b7207064d2349842656..6f66b4fe85ea7e94e250ea9341706624c5bada24 100644 (file)
@@ -518,7 +518,8 @@ rgb_to_kcmy_line(unsigned char *src,
 
   cfImageRGBToCMYK(src, dst, pixels);
   // CMYK to KCMY
-  for (unsigned int i = 0; i < pixels; i ++, bp += 3, dp += 4) {
+  for (unsigned int i = 0; i < pixels; i ++, bp += 3, dp += 4)
+  {
     d = dp[3];
     dp[3] = dp[2];
     dp[2] = dp[1];
index 3b6acbddec2c81680007cd1ef101771d62a1287d..ef8ef62754898ab8d90b65420f18d9766d1f2ca4 100644 (file)
@@ -229,7 +229,8 @@ cfFilterUniversal(int inputfd,              // I - File descriptor input stream
       !strcasecmp(input_type, "urf") ||
       !strcasecmp(input_type, "pwg-raster"))
   {
-    if (strcasecmp(output_type, "pdf")) {
+    if (strcasecmp(output_type, "pdf"))
+    {
       if (strcasecmp(input_type, "vnd.cups-pdf"))
       {
        filter = malloc(sizeof(cf_filter_filter_in_chain_t));
@@ -306,7 +307,8 @@ cfFilterUniversal(int inputfd,              // I - File descriptor input stream
 
  out:
 
-  if (ret) {
+  if (ret)
+  {
     if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterUniversal: Unsupported combination of input and output formats: %s -> %s",
                 input, output);
index f8ee32eaeecb90f7e1fcbdd292038bf0150d382e..68ea4db182cd93634b9a2defc23973e4d54a312a 100644 (file)
@@ -835,7 +835,8 @@ ppdCollectionDumpCache(const char *filename,        // I - Filename
   // See if we a PPD database file...
   //
 
-  if (load_ppds_dat(filename, 0, &ppdlist, log, ld)) {
+  if (load_ppds_dat(filename, 0, &ppdlist, log, ld))
+  {
     free_ppdlist(&ppdlist);
     return(1);
   }
@@ -3023,23 +3024,35 @@ PipeCommand(int        *cpid,           // O - Process ID or 0 on error
       close(efds[1]);
       logfp = cupsFileOpenFd(efds[0], "r");
       while (cupsFileGets(logfp, buf, sizeof(buf)))
-       if (log) {
-         if (strncmp(buf, "DEBUG: ", 7) == 0) {
+       if (log)
+       {
+         if (strncmp(buf, "DEBUG: ", 7) == 0)
+         {
            log_level = CF_LOGLEVEL_DEBUG;
            msg = buf + 7;
-         } else if (strncmp(buf, "DEBUG2: ", 8) == 0) {
+         }
+         else if (strncmp(buf, "DEBUG2: ", 8) == 0)
+         {
            log_level = CF_LOGLEVEL_DEBUG;
            msg = buf + 8;
-         } else if (strncmp(buf, "INFO: ", 6) == 0) {
+         }
+         else if (strncmp(buf, "INFO: ", 6) == 0)
+         {
            log_level = CF_LOGLEVEL_INFO;
            msg = buf + 6;
-         } else if (strncmp(buf, "WARNING: ", 9) == 0) {
+         }
+         else if (strncmp(buf, "WARNING: ", 9) == 0)
+         {
            log_level = CF_LOGLEVEL_WARN;
            msg = buf + 9;
-         } else if (strncmp(buf, "ERROR: ", 7) == 0) {
+         }
+         else if (strncmp(buf, "ERROR: ", 7) == 0)
+         {
            log_level = CF_LOGLEVEL_ERROR;
            msg = buf + 7;
-         } else {
+         }
+         else
+         {
            log_level = CF_LOGLEVEL_DEBUG;
            msg = buf;
          }
@@ -3095,7 +3108,8 @@ ClosePipeCommand(cups_file_t *fp,
   // Wait for the child process to exit...
   //
 
-  while (cpid > 0 || epid > 0) {
+  while (cpid > 0 || epid > 0)
+  {
     if ((pid = wait(&wstatus)) < 0)
     {
       if (errno == EINTR)