diff options
author | DRC <information@libjpeg-turbo.org> | 2016-02-19 08:53:33 -0600 |
---|---|---|
committer | DRC <information@libjpeg-turbo.org> | 2016-02-19 09:10:07 -0600 |
commit | bd49803f92da151be5c4bd3910a2840d2068e7e3 (patch) | |
tree | 9f4259d57ac62d064779ab10879d13ce9fc67ec0 /jcmaster.c | |
parent | ae4112884525c9ae4390c2020668831a9bade412 (diff) |
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.
Diffstat (limited to 'jcmaster.c')
-rw-r--r-- | jcmaster.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -40,7 +40,7 @@ typedef struct { int scan_number; /* current index in scan_info[] */ } my_comp_master; -typedef my_comp_master * my_master_ptr; +typedef my_comp_master *my_master_ptr; /* @@ -168,12 +168,12 @@ validate_script (j_compress_ptr cinfo) * determine whether it uses progressive JPEG, and set cinfo->progressive_mode. */ { - const jpeg_scan_info * scanptr; + const jpeg_scan_info *scanptr; int scanno, ncomps, ci, coefi, thisi; int Ss, Se, Ah, Al; boolean component_sent[MAX_COMPONENTS]; #ifdef C_PROGRESSIVE_SUPPORTED - int * last_bitpos_ptr; + int *last_bitpos_ptr; int last_bitpos[MAX_COMPONENTS][DCTSIZE2]; /* -1 until that coefficient has been seen; then last Al for it */ #endif @@ -309,7 +309,7 @@ select_scan_parameters (j_compress_ptr cinfo) if (cinfo->scan_info != NULL) { /* Prepare for current scan --- the script is already validated */ my_master_ptr master = (my_master_ptr) cinfo->master; - const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number; + const jpeg_scan_info *scanptr = cinfo->scan_info + master->scan_number; cinfo->comps_in_scan = scanptr->comps_in_scan; for (ci = 0; ci < scanptr->comps_in_scan; ci++) { |