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:
DRC
2016-02-19 08:53:33 -06:00
parent ae41128845
commit bd49803f92
125 changed files with 980 additions and 978 deletions

View File

@@ -164,7 +164,7 @@ typedef struct {
boolean on_odd_row; /* flag to remember which row we are on */
} my_cquantizer;
typedef my_cquantizer * my_cquantize_ptr;
typedef my_cquantizer *my_cquantize_ptr;
/*
@@ -523,7 +523,7 @@ quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
register JSAMPROW input_ptr;
register JSAMPROW output_ptr;
JSAMPROW colorindex_ci;
int * dither; /* points to active row of dither matrix */
int *dither; /* points to active row of dither matrix */
int row_index, col_index; /* current indexes into dither matrix */
int nc = cinfo->out_color_components;
int ci;
@@ -575,9 +575,9 @@ quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPROW colorindex0 = cquantize->colorindex[0];
JSAMPROW colorindex1 = cquantize->colorindex[1];
JSAMPROW colorindex2 = cquantize->colorindex[2];
int * dither0; /* points to active row of dither matrix */
int * dither1;
int * dither2;
int *dither0; /* points to active row of dither matrix */
int *dither1;
int *dither2;
int row_index, col_index; /* current indexes into dither matrix */
int row;
JDIMENSION col;