Skip to content

Commit

Permalink
Additional code formatting tweaks
Browse files Browse the repository at this point in the history
... detected with an improved version of our checkstyle script
  • Loading branch information
dcommander committed Apr 9, 2018
1 parent 450306a commit b628d69
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
12 changes: 6 additions & 6 deletions jcsample.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
(JSAMPLE)((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]) + bias) >> 2);
bias ^= 3; /* 1=>2, 2=>1 */
inptr0 += 2; inptr1 += 2;
inptr0 += 2; inptr1 += 2;
}
inrow += 2;
}
Expand Down Expand Up @@ -348,7 +348,7 @@ h2v2_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);
membersum = membersum * memberscale + neighsum * neighscale;
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;

for (colctr = output_cols - 2; colctr > 0; colctr--) {
/* sum of pixels directly mapped to this output element */
Expand All @@ -368,7 +368,7 @@ h2v2_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
membersum = membersum * memberscale + neighsum * neighscale;
/* round, descale and output it */
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
}

/* Special case for last column */
Expand Down Expand Up @@ -437,17 +437,17 @@ fullsize_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
neighsum = colsum + (colsum - membersum) + nextcolsum;
membersum = membersum * memberscale + neighsum * neighscale;
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
lastcolsum = colsum; colsum = nextcolsum;
lastcolsum = colsum; colsum = nextcolsum;

for (colctr = output_cols - 2; colctr > 0; colctr--) {
membersum = GETJSAMPLE(*inptr++);
above_ptr++; below_ptr++;
above_ptr++; below_ptr++;
nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
GETJSAMPLE(*inptr);
neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
membersum = membersum * memberscale + neighsum * neighscale;
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
lastcolsum = colsum; colsum = nextcolsum;
lastcolsum = colsum; colsum = nextcolsum;
}

/* Special case for last column */
Expand Down
8 changes: 4 additions & 4 deletions jdhuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ typedef struct { /* Bitreading working state within an MCU */
if (bits_left < (nbits)) { \
if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
{ action; } \
get_buffer = (state).get_buffer; bits_left = (state).bits_left; \
get_buffer = (state).get_buffer; bits_left = (state).bits_left; \
} \
}

Expand Down Expand Up @@ -193,9 +193,9 @@ EXTERN(boolean) jpeg_fill_bit_buffer(bitread_working_state *state,
if (bits_left < HUFF_LOOKAHEAD) { \
if (!jpeg_fill_bit_buffer(&state, get_buffer, bits_left, 0)) \
{ failaction; } \
get_buffer = state.get_buffer; bits_left = state.bits_left; \
get_buffer = state.get_buffer; bits_left = state.bits_left; \
if (bits_left < HUFF_LOOKAHEAD) { \
nb = 1; goto slowlabel; \
nb = 1; goto slowlabel; \
} \
} \
look = PEEK_BITS(HUFF_LOOKAHEAD); \
Expand All @@ -207,7 +207,7 @@ slowlabel: \
if ((result = \
jpeg_huff_decode(&state, get_buffer, bits_left, htbl, nb)) < 0) \
{ failaction; } \
get_buffer = state.get_buffer; bits_left = state.bits_left; \
get_buffer = state.get_buffer; bits_left = state.bits_left; \
} \
}

Expand Down
10 changes: 5 additions & 5 deletions jerror.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,24 +288,24 @@ JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
#define TRACEMS3(cinfo, lvl, code, p1, p2, p3) \
MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
#define TRACEMS4(cinfo, lvl, code, p1, p2, p3, p4) \
MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
#define TRACEMS5(cinfo, lvl, code, p1, p2, p3, p4, p5) \
MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
#define TRACEMS8(cinfo, lvl, code, p1, p2, p3, p4, p5, p6, p7, p8) \
MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
#define TRACEMSS(cinfo, lvl, code, str) \
Expand Down
2 changes: 1 addition & 1 deletion md5/md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static void byteReverse(unsigned char *buf, unsigned int longs)
{
uint32 t;
do {
t = (uint32) ((unsigned int)buf[3] << 8 | buf[2]) << 16 |
t = (uint32)((unsigned int)buf[3] << 8 | buf[2]) << 16 |
((unsigned int)buf[1] << 8 | buf[0]);
*(uint32 *) buf = t;
buf += 4;
Expand Down
3 changes: 2 additions & 1 deletion rdjpgcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ process_SOFn(int marker)
case M_SOF10: process = "Progressive, arithmetic coding"; break;
case M_SOF11: process = "Lossless, arithmetic coding"; break;
case M_SOF13: process = "Differential sequential, arithmetic coding"; break;
case M_SOF14: process = "Differential progressive, arithmetic coding"; break;
case M_SOF14:
process = "Differential progressive, arithmetic coding"; break;
case M_SOF15: process = "Differential lossless, arithmetic coding"; break;
default: process = "Unknown"; break;
}
Expand Down
4 changes: 2 additions & 2 deletions simd/loongson/jccolor-mmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include "jsimd_mmi.h"


#define F_0_081 ((short) 5329) /* FIX(0.08131) */
#define F_0_114 ((short) 7471) /* FIX(0.11400) */
#define F_0_081 ((short)5329) /* FIX(0.08131) */
#define F_0_114 ((short)7471) /* FIX(0.11400) */
#define F_0_168 ((short)11059) /* FIX(0.16874) */
#define F_0_250 ((short)16384) /* FIX(0.25000) */
#define F_0_299 ((short)19595) /* FIX(0.29900) */
Expand Down

0 comments on commit b628d69

Please sign in to comment.