about summary refs log tree commit diff
path: root/lib/util
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-09-20 18:10:34 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-09-20 18:10:34 +0000
commit553be9f71998e872838769b1a9be6972ab8ccb8e (patch)
treeae3bab030ec894e3ab33a34d66d0cd1783667e3b /lib/util
parentc57fb692012684f1a5b1e84c2e31dc289ef70219 (diff)
downloadnetpbm-mirror-553be9f71998e872838769b1a9be6972ab8ccb8e.tar.gz
netpbm-mirror-553be9f71998e872838769b1a9be6972ab8ccb8e.tar.xz
netpbm-mirror-553be9f71998e872838769b1a9be6972ab8ccb8e.zip
whitespace
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4672 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/LICENSE.txt40
-rw-r--r--lib/util/bitio.c14
-rw-r--r--lib/util/bitio.h12
-rw-r--r--lib/util/bitreverse.h2
-rw-r--r--lib/util/floatcode.h12
-rw-r--r--lib/util/intcode.h18
-rw-r--r--lib/util/io.c4
-rw-r--r--lib/util/matrix.c4
-rw-r--r--lib/util/nstring.h6
-rw-r--r--lib/util/pm_c_util.h2
-rw-r--r--lib/util/runlength.h4
-rw-r--r--lib/util/shhopt.c46
-rw-r--r--lib/util/testnstring.c4
-rw-r--r--lib/util/token.c2
14 files changed, 85 insertions, 85 deletions
diff --git a/lib/util/LICENSE.txt b/lib/util/LICENSE.txt
index 4baac593..98d7e10e 100644
--- a/lib/util/LICENSE.txt
+++ b/lib/util/LICENSE.txt
@@ -1,7 +1,7 @@
 The Frontier Artistic License Version 1.0
 Derived from the Artistic License at OpenSource.org.
 Submitted to OpenSource.org for Open Source Initiative certification.
-   
+
 Preamble
 
 The intent of this document is to state the conditions under which a
@@ -10,7 +10,7 @@ semblance of artistic control over the development of the package,
 while giving the users of the package the right to use and distribute
 the Package in a more-or-less customary fashion, plus the right to
 make reasonable modifications.
-   
+
 Definitions
 
   "Package" refers to the script, suite, file, or collection of
@@ -37,7 +37,7 @@ Definitions
   itself, though there may be fees involved in handling the item.
   It also means that recipients of the item may redistribute it under
   the same conditions they received it.
-       
+
 
 Terms
 
@@ -45,50 +45,50 @@ Terms
 the Standard Version of this Package without restriction, provided
 that you duplicate all of the original copyright notices and
 associated disclaimers.
-   
+
 2. You may apply bug fixes, portability fixes, and other modifications
 derived from the Public Domain or from the Copyright Holder. A Package
 modified in such a way shall still be considered the Standard Version.
-   
+
 3. You may otherwise modify your copy of this Package in any way,
 provided that you insert a prominent notice in each changed script,
 suite, or file stating how and when you changed that script, suite,
 or file, and provided that you do at least ONE of the following:
-   
+
   a) Use the modified Package only within your corporation or
   organization, or retain the modified Package solely for personal use.
-     
+
   b) Place your modifications in the Public Domain or otherwise make
   them Freely Available, such as by posting said modifications to Usenet
   or an equivalent medium, or placing the modifications on a major archive
   site such as ftp.uu.net, or by allowing the Copyright Holder to include
   your modifications in the Standard Version of the Package.
-     
+
   c) Rename any non-standard executables so the names do not conflict
   with standard executables, which must also be provided, and provide
   a separate manual page (or equivalent) for each non-standard executable
   that clearly documents how it differs from the Standard Version.
-     
+
   d) Make other distribution arrangements with the Copyright Holder.
-     
+
 4. You may distribute the programs of this Package in object code or
 executable form, provided that you do at least ONE of the following:
-   
+
   a) Distribute a Standard Version of the executables and library
   files, together with instructions (in the manual page or
   equivalent) on where to get the Standard Version.
-     
+
   b) Accompany the distribution with the machine-readable source of
   the Package with your modifications.
-     
+
   c) Accompany any non-standard executables with their corresponding
   Standard Version executables, give the non-standard executables
   non-standard names, and clearly document the differences in manual
   pages (or equivalent), together with instructions on where to get
   the Standard Version.
-     
+
   d) Make other distribution arrangements with the Copyright Holder.
-     
+
 5. You may charge a reasonable copying fee for any distribution of
 this Package. You may charge any fee you choose for support of this
 Package. You may not charge a fee for this Package itself. However,
@@ -96,25 +96,25 @@ you may distribute this Package in aggregate with other (possibly
 commercial) programs as part of a larger (possibly commercial)
 software distribution provided that you do not advertise this Package
 as a product of your own.
-   
+
 6. The scripts and library files supplied as input to or produced as
 output from the programs of this Package do not automatically fall
 under the copyright of this Package, but belong to whomever generated
 them, and may be sold commercially, and may be aggregated with this
 Package.
-   
+
 7. Scripts, suites, or programs supplied by you that depend on or
 otherwise make use of this Package shall not be considered part of
 this Package.
-   
+
 8. The name of the Copyright Holder may not be used to endorse or
 promote products derived from this software without specific prior
 written permission.
-   
+
 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-   
+
                         The End
 
 
diff --git a/lib/util/bitio.c b/lib/util/bitio.c
index ca1b55f9..9d96892c 100644
--- a/lib/util/bitio.c
+++ b/lib/util/bitio.c
@@ -6,7 +6,7 @@
  * Works for (sizeof(unsigned long)-1)*8 bits.
  *
  * Copyright (C) 1992 by David W. Sanderson.
- * 
+ *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation for any purpose and without fee is hereby granted,
  * provided that the above copyright notice appear in all copies and
@@ -89,7 +89,7 @@ pm_bitinit(FILE * const f, const char * const mode) {
  * pm_bitfini() - deallocate the given struct bitstream *.
  *
  * You must call this after you are done with the struct bitstream *.
- * 
+ *
  * It may flush some bits left in the buffer.
  *
  * Returns the number of bytes written, -1 on error.
@@ -137,13 +137,13 @@ pm_bitfini(b)
 
 /*
  * pm_bitread() - read the next nbits into *val from the given file.
- * 
+ *
  * The last pm_bitread() must be followed by a call to pm_bitfini().
- * 
+ *
  * Returns the number of bytes read, -1 on error.
  */
 
-int 
+int
 pm_bitread(b, nbits, val)
     struct bitstream *b;
     unsigned long   nbits;
@@ -172,9 +172,9 @@ pm_bitread(b, nbits, val)
 
 /*
  * pm_bitwrite() - write the low nbits of val to the given file.
- * 
+ *
  * The last pm_bitwrite() must be followed by a call to pm_bitfini().
- * 
+ *
  * Returns the number of bytes written, -1 on error.
  */
 
diff --git a/lib/util/bitio.h b/lib/util/bitio.h
index dfc5a153..d1fbbff2 100644
--- a/lib/util/bitio.h
+++ b/lib/util/bitio.h
@@ -6,7 +6,7 @@
  * Works for (sizeof(unsigned long)-1)*8 bits.
  *
  * Copyright (C) 1992 by David W. Sanderson.
- * 
+ *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation for any purpose and without fee is hereby granted,
  * provided that the above copyright notice appear in all copies and
@@ -41,7 +41,7 @@ extern "C" {
 } /* to fake out automatic code indenters */
 #endif
 
-typedef struct bitstream	*BITSTREAM;
+typedef struct bitstream        *BITSTREAM;
 
 struct bitstream *
 pm_bitinit(FILE * const f, const char * const mode);
@@ -50,7 +50,7 @@ pm_bitinit(FILE * const f, const char * const mode);
  * pm_bitfini() - deallocate the given BITSTREAM.
  *
  * You must call this after you are done with the BITSTREAM.
- * 
+ *
  * It may flush some bits left in the buffer.
  *
  * Returns the number of bytes written, -1 on error.
@@ -61,7 +61,7 @@ pm_bitfini(BITSTREAM b);
 
 /*
  * pm_bitread() - read the next nbits into *val from the given file.
- * 
+ *
  * Returns the number of bytes read, -1 on error.
  */
 
@@ -72,9 +72,9 @@ pm_bitread(BITSTREAM       b,
 
 /*
  * pm_bitwrite() - write the low nbits of val to the given file.
- * 
+ *
  * The last pm_bitwrite() must be followed by a call to pm_bitflush().
- * 
+ *
  * Returns the number of bytes written, -1 on error.
  */
 
diff --git a/lib/util/bitreverse.h b/lib/util/bitreverse.h
index b3f0ea13..9acdc5fe 100644
--- a/lib/util/bitreverse.h
+++ b/lib/util/bitreverse.h
@@ -13,7 +13,7 @@
 **
 **     c = ((c >>  1) & 0x55) | ((c <<  1) & 0xaa);
 **     c = ((c >>  2) & 0x33) | ((c <<  2) & 0xcc);
-**     c = ((c >> 4) & 0x0f) | ((c << 4) & 0xf0); 
+**     c = ((c >> 4) & 0x0f) | ((c << 4) & 0xf0);
 */
 
 #ifndef _BITR_H_
diff --git a/lib/util/floatcode.h b/lib/util/floatcode.h
index dc31d038..07012dad 100644
--- a/lib/util/floatcode.h
+++ b/lib/util/floatcode.h
@@ -33,9 +33,9 @@ pm_floatFromBigendFloat(pm_bigendFloat const arg) {
             pm_bigendFloat bigend;
             float native;
         } converter;
-        
+
         converter.bigend = arg;
-        
+
         retval = converter.native;
     }; break;
     case LITTLE_ENDIAN: {
@@ -68,7 +68,7 @@ pm_bigendFloatFromFloat(float const arg) {
             pm_bigendFloat bigend;
             float native;
         } converter;
-        
+
         converter.native = arg;
 
         retval = converter.bigend;
@@ -117,9 +117,9 @@ pm_doubleFromBigendDouble(pm_bigendDouble const arg) {
             pm_bigendDouble bigend;
             double native;
         } converter;
-        
+
         converter.bigend = arg;
-        
+
         retval = converter.native;
     }; break;
     case LITTLE_ENDIAN: {
@@ -156,7 +156,7 @@ pm_bigendDoubleFromDouble(double const arg) {
             pm_bigendDouble bigend;
             double native;
         } converter;
-        
+
         converter.native = arg;
 
         retval = converter.bigend;
diff --git a/lib/util/intcode.h b/lib/util/intcode.h
index 1066ee9b..6f40a740 100644
--- a/lib/util/intcode.h
+++ b/lib/util/intcode.h
@@ -108,7 +108,7 @@ pm_uintFromBigend32(bigend32 const arg) {
 
 #if HAVE_GCC_BSWAP
     case LITTLE_ENDIAN: {
-        /* Use GCC built-in */  
+        /* Use GCC built-in */
         union {
             bigend32 bigend;
             uint32_t native;
@@ -117,7 +117,7 @@ pm_uintFromBigend32(bigend32 const arg) {
         retval = __builtin_bswap32(converter.native);
     } break;
 #endif
-    
+
     default:
         retval =
             (arg.bytes[0] << 24) |
@@ -146,9 +146,9 @@ pm_bigendFromUint32(uint32_t const arg) {
         retval = converter.bigend;
     } break;
 
-#if HAVE_GCC_BSWAP    
+#if HAVE_GCC_BSWAP
     case LITTLE_ENDIAN: {
-        /* Use GCC built-in */  
+        /* Use GCC built-in */
         union {
             bigend32 bigend;
             uint32_t native;
@@ -156,7 +156,7 @@ pm_bigendFromUint32(uint32_t const arg) {
         converter.native = __builtin_bswap32(arg);
         retval = converter.bigend;
     } break;
-#endif    
+#endif
 
     default: {
         uint32_t shift;
@@ -208,9 +208,9 @@ pm_uintFromBigend64(bigend64 const arg) {
         retval = converter.native;
     } break;
 
-#if HAVE_GCC_BSWAP    
+#if HAVE_GCC_BSWAP
     case LITTLE_ENDIAN: {
-        /* Use GCC built-in */  
+        /* Use GCC built-in */
         union {
             bigend64 bigend;
             uint64_t native;
@@ -249,7 +249,7 @@ pm_bigendFromUint64(uint64_t const arg) {
 #if HAVE_GCC_BSWAP
     case LITTLE_ENDIAN: {
 
-        /* Use GCC built-in */  
+        /* Use GCC built-in */
         union {
             bigend64 bigend;
             uint64_t native;
@@ -258,7 +258,7 @@ pm_bigendFromUint64(uint64_t const arg) {
         retval = converter.bigend;
     } break;
 #endif
-    
+
     default: {
         uint64_t shift;
         shift = arg;
diff --git a/lib/util/io.c b/lib/util/io.c
index 54ecb6a8..ad17f680 100644
--- a/lib/util/io.c
+++ b/lib/util/io.c
@@ -32,7 +32,7 @@ pm_freadline(FILE *        const fileP,
 
     bufferSize = 1024;  /* initial value */
     *errorP = NULL; /* initial value */
-    
+
     MALLOCARRAY(buffer, bufferSize);
 
     for (cursor = 0, gotLine = false, eof = false;
@@ -53,7 +53,7 @@ pm_freadline(FILE *        const fileP,
                         (unsigned int)bufferSize);
         else {
             int const rc = getc(fileP);
-        
+
             if (rc < 0) {
                 if (feof(fileP))
                     eof = true;
diff --git a/lib/util/matrix.c b/lib/util/matrix.c
index e9456e93..1849bf49 100644
--- a/lib/util/matrix.c
+++ b/lib/util/matrix.c
@@ -201,7 +201,7 @@ pm_solvelineareq(double **     const aArg,
             /* Work from the bottom up to solve for the unknowns x[], from
                the a and c rows in question and all the x[] below it
             */
-            
+
             unsigned int k;
             for (k = 0; k < n; ++k) {
                 unsigned int const m = n - k - 1;
@@ -210,7 +210,7 @@ pm_solvelineareq(double **     const aArg,
 
                 for (j = m+1, xwork = c[m]; j < n; ++j)
                     xwork -= a[m][j] * x[j];
-                    
+
                 x[m] = xwork / a[m][m];
             }
         }
diff --git a/lib/util/nstring.h b/lib/util/nstring.h
index 7ade39ef..1aa486c6 100644
--- a/lib/util/nstring.h
+++ b/lib/util/nstring.h
@@ -22,13 +22,13 @@ extern "C" {
    array.
 */
 #define STRSCPY(A,B) \
-	(strncpy((A), (B), sizeof(A)), *((A)+sizeof(A)-1) = '\0')
+        (strncpy((A), (B), sizeof(A)), *((A)+sizeof(A)-1) = '\0')
 #define STRSCMP(A,B) \
-	(strncmp((A), (B), sizeof(A)))
+        (strncmp((A), (B), sizeof(A)))
 #define STRSCAT(A,B) \
     (strncpy(A+strlen(A), B, sizeof(A)-strlen(A)), *((A)+sizeof(A)-1) = '\0')
 #define STRSEQ(A, B) \
-	(strneq((A), (B), sizeof(A)))
+        (strneq((A), (B), sizeof(A)))
 
 #define MEMSEQ(a,b) (memeq(a, b, sizeof(*(a))))
 
diff --git a/lib/util/pm_c_util.h b/lib/util/pm_c_util.h
index a0d69556..110d7536 100644
--- a/lib/util/pm_c_util.h
+++ b/lib/util/pm_c_util.h
@@ -13,7 +13,7 @@
 #undef ABS
 #define ABS(a) ((a) >= 0 ? (a) : -(a))
 #undef SGN
-#define SGN(a)		(((a)<0) ? -1 : 1)
+#define SGN(a)          (((a)<0) ? -1 : 1)
 #undef ODD
 #define ODD(n) ((n) & 1)
 #undef ROUND
diff --git a/lib/util/runlength.h b/lib/util/runlength.h
index de921650..f984267b 100644
--- a/lib/util/runlength.h
+++ b/lib/util/runlength.h
@@ -14,12 +14,12 @@ extern "C" {
 
 
 enum pm_RleMode { PM_RLE_PACKBITS,          /* most common mode */
-                  PM_RLE_GRAPHON,           /* reserved */ 
+                  PM_RLE_GRAPHON,           /* reserved */
                   PM_RLE_PPA,               /* reserved */
                   PM_RLE_SGI8,              /* reserved */
                   PM_RLE_SGI16,
                   PM_RLE_PALM16,
-                  PM_RLE_PALMPDB  
+                  PM_RLE_PALMPDB
                 };
 
 size_t
diff --git a/lib/util/shhopt.c b/lib/util/shhopt.c
index 00f9c341..32d0916d 100644
--- a/lib/util/shhopt.c
+++ b/lib/util/shhopt.c
@@ -252,10 +252,10 @@ static int
 optNeedsArgument(const optEntry opt)
 {
     return opt.type == OPT_STRING
-	|| opt.type == OPT_INT
-	|| opt.type == OPT_UINT
-	|| opt.type == OPT_LONG
-	|| opt.type == OPT_ULONG
+        || opt.type == OPT_INT
+        || opt.type == OPT_UINT
+        || opt.type == OPT_LONG
+        || opt.type == OPT_ULONG
     || opt.type == OPT_FLOAT
     || opt.type == OPT_NAMELIST
     || opt.type == OPT_STRINGLIST
@@ -717,28 +717,28 @@ parse_short_option_token(char *argv[], const int argc, const int ai,
     while (*o && !processed_arg) {
         bool found;
         int mi;   /* index into option table */
-		/* find matching option */
-		optMatch(opt_table, o, SL_SHORT, &found, &mi);
-		if (!found)
-		    optFatal("unrecognized option `-%c'", *o);
-
-		/* does this option take an argument? */
-		if (optNeedsArgument(opt_table[mi])) {
-		    /* option needs an argument. find it. */
-		    arg = o + 1;
-		    if (!*arg) {
+                /* find matching option */
+                optMatch(opt_table, o, SL_SHORT, &found, &mi);
+                if (!found)
+                    optFatal("unrecognized option `-%c'", *o);
+
+                /* does this option take an argument? */
+                if (optNeedsArgument(opt_table[mi])) {
+                    /* option needs an argument. find it. */
+                    arg = o + 1;
+                    if (!*arg) {
                 if (ai + 1 >= argc)
-			    optFatal("option `%s' requires an argument",
-				     optString(opt_table[mi], 0));
-			arg = argv[ai+1];
+                            optFatal("option `%s' requires an argument",
+                                     optString(opt_table[mi], 0));
+                        arg = argv[ai+1];
             (*tokens_consumed_p)++;
-		    }
-		    processed_arg = 1;
-		} else
+                    }
+                    processed_arg = 1;
+                } else
             arg = NULL;
-		/* perform the action of this option. */
-		optExecute(opt_table[mi], arg, 0);
-		++o;
+                /* perform the action of this option. */
+                optExecute(opt_table[mi], arg, 0);
+                ++o;
     }
 }
 
diff --git a/lib/util/testnstring.c b/lib/util/testnstring.c
index 87e6139e..0952f04c 100644
--- a/lib/util/testnstring.c
+++ b/lib/util/testnstring.c
@@ -12,7 +12,7 @@ int
 main(int argc, char **argv) {
 
     char snprintfNResult[80];
-    const char * asprintfNResult; 
+    const char * asprintfNResult;
 
     printf("Hello world.\n");
 
@@ -20,7 +20,7 @@ main(int argc, char **argv) {
 
     printf("snprintfN result='%s'\n", snprintfNResult);
 
-    asprintfN(&asprintfNResult, "asprintf'ed string %d %u %s", 
+    asprintfN(&asprintfNResult, "asprintf'ed string %d %u %s",
               5, 89, "substring");
 
     printf("asprintfN result='%s'\n", asprintfNResult);
diff --git a/lib/util/token.c b/lib/util/token.c
index a68a4821..c81432f7 100644
--- a/lib/util/token.c
+++ b/lib/util/token.c
@@ -65,7 +65,7 @@ pm_gettoken(const char *  const tokenStart,
                 token[charCount++] = *cursor++;
             }
             token[charCount] = '\0';
-            
+
             *tokenP = token;
             *nextP = cursor;
         }