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/rdrle.c b/rdrle.c
index bb14879..e3509e7 100644
--- a/rdrle.c
+++ b/rdrle.c
@@ -62,7 +62,7 @@
* then fetch the required row from the virtual array on subsequent calls.
*/
-typedef struct _rle_source_struct * rle_source_ptr;
+typedef struct _rle_source_struct *rle_source_ptr;
typedef struct _rle_source_struct {
struct cjpeg_source_struct pub; /* public fields */
@@ -216,7 +216,7 @@
colormap = source->header.cmap;
dest_row = source->pub.buffer[0];
source->row--;
- src_row = * (*cinfo->mem->access_virt_sarray)
+ src_row = *(*cinfo->mem->access_virt_sarray)
((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE);
for (col = cinfo->image_width; col > 0; col--) {
@@ -289,7 +289,7 @@
case MAPPEDGRAY:
case TRUECOLOR:
for (row = 0; row < cinfo->image_height; row++) {
- scanline = * (*cinfo->mem->access_virt_sarray)
+ scanline = *(*cinfo->mem->access_virt_sarray)
((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);
rle_row = source->rle_row;
rle_getrow(&source->header, rle_row);
@@ -312,7 +312,7 @@
case DIRECTCOLOR:
for (row = 0; row < cinfo->image_height; row++) {
- scanline = * (*cinfo->mem->access_virt_sarray)
+ scanline = *(*cinfo->mem->access_virt_sarray)
((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);
rle_getrow(&source->header, rle_row);