aboutsummaryrefslogtreecommitdiff
path: root/wrjpgcom.c
diff options
context:
space:
mode:
authorDRC <information@libjpeg-turbo.org>2016-02-19 08:53:33 -0600
committerDRC <information@libjpeg-turbo.org>2016-02-19 09:10:07 -0600
commitbd49803f92da151be5c4bd3910a2840d2068e7e3 (patch)
tree9f4259d57ac62d064779ab10879d13ce9fc67ec0 /wrjpgcom.c
parentae4112884525c9ae4390c2020668831a9bade412 (diff)
downloadlibjpeg-turbo-bd49803f92da151be5c4bd3910a2840d2068e7e3.tar.gz
Use consistent/modern code formatting for pointers
The convention used by libjpeg: type * variable; is not very common anymore, because it looks too much like multiplication. Some (particularly C++ programmers) prefer to tuck the pointer symbol against the type: type* variable; to emphasize that a pointer to a type is effectively a new type. However, this can also be confusing, since defining multiple variables on the same line would not work properly: type* variable1, variable2; /* Only variable1 is actually a pointer. */ This commit reformats the entirety of the libjpeg-turbo code base so that it uses the same code formatting convention for pointers that the TurboJPEG API code uses: type *variable1, *variable2; This seems to be the most common convention among C programmers, and it is the convention used by other codec libraries, such as libpng and libtiff.
Diffstat (limited to 'wrjpgcom.c')
-rw-r--r--wrjpgcom.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/wrjpgcom.c b/wrjpgcom.c
index 8409dd21..cd67afd3 100644
--- a/wrjpgcom.c
+++ b/wrjpgcom.c
@@ -18,7 +18,7 @@
#include "jinclude.h" /* get auto-config symbols, <stdio.h> */
#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc() */
-extern void * malloc ();
+extern void *malloc ();
#endif
#include <ctype.h> /* to declare isupper(), tolower() */
#ifdef USE_SETMODE
@@ -66,12 +66,12 @@ extern void * malloc ();
* To reuse this code in another application, you might need to change these.
*/
-static FILE * infile; /* input JPEG file */
+static FILE *infile; /* input JPEG file */
/* Return next input byte, or EOF if no more */
#define NEXTBYTE() getc(infile)
-static FILE * outfile; /* output JPEG file */
+static FILE *outfile; /* output JPEG file */
/* Emit an output byte */
#define PUTBYTE(x) putc((x), outfile)
@@ -338,7 +338,7 @@ scan_JPEG_header (int keep_COM)
/* Command line parsing code */
-static const char * progname; /* program name for error messages */
+static const char *progname; /* program name for error messages */
static void
@@ -375,7 +375,7 @@ usage (void)
static int
-keymatch (char * arg, const char * keyword, int minchars)
+keymatch (char *arg, const char *keyword, int minchars)
/* Case-insensitive matching of (possibly abbreviated) keyword switches. */
/* keyword is the constant keyword (must be lower case already), */
/* minchars is length of minimum legal abbreviation. */
@@ -407,10 +407,10 @@ int
main (int argc, char **argv)
{
int argn;
- char * arg;
+ char *arg;
int keep_COM = 1;
- char * comment_arg = NULL;
- FILE * comment_file = NULL;
+ char *comment_arg = NULL;
+ FILE *comment_file = NULL;
unsigned int comment_length = 0;
int marker;
@@ -544,7 +544,7 @@ main (int argc, char **argv)
/* Collect comment text from comment_file or stdin, if necessary */
if (comment_arg == NULL) {
- FILE * src_file;
+ FILE *src_file;
int c;
comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);