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/jdhuff.h b/jdhuff.h
index 1bf0390..87d4465 100644
--- a/jdhuff.h
+++ b/jdhuff.h
@@ -101,7 +101,7 @@
typedef struct { /* Bitreading working state within an MCU */
/* Current data source location */
/* We need a copy, rather than munging the original, in case of suspension */
- const JOCTET * next_input_byte; /* => next byte to read from source */
+ const JOCTET *next_input_byte; /* => next byte to read from source */
size_t bytes_in_buffer; /* # of bytes remaining in source buffer */
/* Bit input buffer --- note these values are kept in register variables,
* not in this struct, inside the inner loops.
@@ -166,7 +166,7 @@
/* Load up the bit buffer to a depth of at least nbits */
EXTERN(boolean) jpeg_fill_bit_buffer
- (bitread_working_state * state, register bit_buf_type get_buffer,
+ (bitread_working_state *state, register bit_buf_type get_buffer,
register int bits_left, int nbits);
@@ -230,5 +230,5 @@
/* Out-of-line case for Huffman code fetching */
EXTERN(int) jpeg_huff_decode
- (bitread_working_state * state, register bit_buf_type get_buffer,
- register int bits_left, d_derived_tbl * htbl, int min_bits);
+ (bitread_working_state *state, register bit_buf_type get_buffer,
+ register int bits_left, d_derived_tbl *htbl, int min_bits);