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.
This commit is contained in:
18
wrjpgcom.c
18
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);
|
||||
|
||||
Reference in New Issue
Block a user