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:
16
cdjpeg.h
16
cdjpeg.h
@@ -24,7 +24,7 @@
|
||||
* Object interface for cjpeg's source file decoding modules
|
||||
*/
|
||||
|
||||
typedef struct cjpeg_source_struct * cjpeg_source_ptr;
|
||||
typedef struct cjpeg_source_struct *cjpeg_source_ptr;
|
||||
|
||||
struct cjpeg_source_struct {
|
||||
void (*start_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);
|
||||
@@ -42,7 +42,7 @@ struct cjpeg_source_struct {
|
||||
* Object interface for djpeg's output file encoding modules
|
||||
*/
|
||||
|
||||
typedef struct djpeg_dest_struct * djpeg_dest_ptr;
|
||||
typedef struct djpeg_dest_struct *djpeg_dest_ptr;
|
||||
|
||||
struct djpeg_dest_struct {
|
||||
/* start_output is called after jpeg_start_decompress finishes.
|
||||
@@ -56,7 +56,7 @@ struct djpeg_dest_struct {
|
||||
void (*finish_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo);
|
||||
|
||||
/* Target file spec; filled in by djpeg.c after object is created. */
|
||||
FILE * output_file;
|
||||
FILE *output_file;
|
||||
|
||||
/* Output pixel-row buffer. Created by module init or start_output.
|
||||
* Width is cinfo->output_width * cinfo->output_components;
|
||||
@@ -83,7 +83,7 @@ struct cdjpeg_progress_mgr {
|
||||
int percent_done;
|
||||
};
|
||||
|
||||
typedef struct cdjpeg_progress_mgr * cd_progress_ptr;
|
||||
typedef struct cdjpeg_progress_mgr *cd_progress_ptr;
|
||||
|
||||
|
||||
/* Module selection routines for I/O modules. */
|
||||
@@ -102,9 +102,9 @@ EXTERN(djpeg_dest_ptr) jinit_write_targa (j_decompress_ptr cinfo);
|
||||
|
||||
/* cjpeg support routines (in rdswitch.c) */
|
||||
|
||||
EXTERN(boolean) read_quant_tables (j_compress_ptr cinfo, char * filename,
|
||||
EXTERN(boolean) read_quant_tables (j_compress_ptr cinfo, char *filename,
|
||||
boolean force_baseline);
|
||||
EXTERN(boolean) read_scan_script (j_compress_ptr cinfo, char * filename);
|
||||
EXTERN(boolean) read_scan_script (j_compress_ptr cinfo, char *filename);
|
||||
EXTERN(boolean) set_quality_ratings (j_compress_ptr cinfo, char *arg,
|
||||
boolean force_baseline);
|
||||
EXTERN(boolean) set_quant_slots (j_compress_ptr cinfo, char *arg);
|
||||
@@ -112,7 +112,7 @@ EXTERN(boolean) set_sample_factors (j_compress_ptr cinfo, char *arg);
|
||||
|
||||
/* djpeg support routines (in rdcolmap.c) */
|
||||
|
||||
EXTERN(void) read_color_map (j_decompress_ptr cinfo, FILE * infile);
|
||||
EXTERN(void) read_color_map (j_decompress_ptr cinfo, FILE *infile);
|
||||
|
||||
/* common support routines (in cdjpeg.c) */
|
||||
|
||||
@@ -120,7 +120,7 @@ EXTERN(void) enable_signal_catcher (j_common_ptr cinfo);
|
||||
EXTERN(void) start_progress_monitor (j_common_ptr cinfo,
|
||||
cd_progress_ptr progress);
|
||||
EXTERN(void) end_progress_monitor (j_common_ptr cinfo);
|
||||
EXTERN(boolean) keymatch (char * arg, const char * keyword, int minchars);
|
||||
EXTERN(boolean) keymatch (char *arg, const char *keyword, int minchars);
|
||||
EXTERN(FILE *) read_stdin (void);
|
||||
EXTERN(FILE *) write_stdout (void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user