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/jmemsys.h b/jmemsys.h
index 614ac7f..f7dfe87 100644
--- a/jmemsys.h
+++ b/jmemsys.h
@@ -32,7 +32,7 @@
*/
EXTERN(void *) jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject);
-EXTERN(void) jpeg_free_small (j_common_ptr cinfo, void * object,
+EXTERN(void) jpeg_free_small (j_common_ptr cinfo, void *object,
size_t sizeofobject);
/*
@@ -44,7 +44,7 @@
*/
EXTERN(void *) jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject);
-EXTERN(void) jpeg_free_large (j_common_ptr cinfo, void * object,
+EXTERN(void) jpeg_free_large (j_common_ptr cinfo, void *object,
size_t sizeofobject);
/*
@@ -117,15 +117,15 @@
#endif /* USE_MAC_MEMMGR */
-typedef struct backing_store_struct * backing_store_ptr;
+typedef struct backing_store_struct *backing_store_ptr;
typedef struct backing_store_struct {
/* Methods for reading/writing/closing this backing-store object */
void (*read_backing_store) (j_common_ptr cinfo, backing_store_ptr info,
- void * buffer_address, long file_offset,
+ void *buffer_address, long file_offset,
long byte_count);
void (*write_backing_store) (j_common_ptr cinfo, backing_store_ptr info,
- void * buffer_address, long file_offset,
+ void *buffer_address, long file_offset,
long byte_count);
void (*close_backing_store) (j_common_ptr cinfo, backing_store_ptr info);
@@ -142,7 +142,7 @@
char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
#else
/* For a typical implementation with temp files, we need: */
- FILE * temp_file; /* stdio reference to temp file */
+ FILE *temp_file; /* stdio reference to temp file */
char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */
#endif
#endif