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:
10
rdjpgcom.c
10
rdjpgcom.c
@@ -57,7 +57,7 @@
|
||||
* 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)
|
||||
@@ -279,7 +279,7 @@ process_SOFn (int marker)
|
||||
unsigned int length;
|
||||
unsigned int image_height, image_width;
|
||||
int data_precision, num_components;
|
||||
const char * process;
|
||||
const char *process;
|
||||
int ci;
|
||||
|
||||
length = read_2_bytes(); /* usual parameter length count */
|
||||
@@ -397,7 +397,7 @@ scan_JPEG_header (int verbose, int raw)
|
||||
|
||||
/* Command line parsing code */
|
||||
|
||||
static const char * progname; /* program name for error messages */
|
||||
static const char *progname; /* program name for error messages */
|
||||
|
||||
|
||||
static void
|
||||
@@ -417,7 +417,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. */
|
||||
@@ -449,7 +449,7 @@ int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
int argn;
|
||||
char * arg;
|
||||
char *arg;
|
||||
int verbose = 0, raw = 0;
|
||||
|
||||
/* On Mac, fetch a command line. */
|
||||
|
||||
Reference in New Issue
Block a user