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.
diff --git a/wrbmp.c b/wrbmp.c
index 5e307de..50e469c 100644
--- a/wrbmp.c
+++ b/wrbmp.c
@@ -58,7 +58,7 @@
JDIMENSION cur_output_row; /* next row# to write to virtual array */
} bmp_dest_struct;
-typedef bmp_dest_struct * bmp_dest_ptr;
+typedef bmp_dest_struct *bmp_dest_ptr;
/* Forward declarations */
@@ -333,7 +333,7 @@
{
JSAMPARRAY colormap = cinfo->colormap;
int num_colors = cinfo->actual_number_of_colors;
- FILE * outfile = dest->pub.output_file;
+ FILE *outfile = dest->pub.output_file;
int i;
if (colormap != NULL) {
@@ -383,7 +383,7 @@
finish_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
{
bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;
- register FILE * outfile = dest->pub.output_file;
+ register FILE *outfile = dest->pub.output_file;
JSAMPARRAY image_ptr;
register JSAMPROW data_ptr;
JDIMENSION row;