diff options
author | Campbell Barton <campbell@blender.org> | 2022-10-07 14:52:53 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-10-07 14:55:03 +0300 |
commit | 331f8500569df9b3b2aa776c5bcaad7b99c57295 (patch) | |
tree | 93547846177ff3415f9564ca54cb8f13433755cf /source/blender/imbuf/intern | |
parent | 11abeae99fdbfc8f047c4a3c1d2b9b8c47883516 (diff) |
Cleanup: redundant parenthesis
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/allocimbuf.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/bmp.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/cineon/logImageCore.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/indexer.c | 5 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jp2.c | 24 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jpeg.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/rectop.c | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/scaling.c | 8 | ||||
-rw-r--r-- | source/blender/imbuf/intern/tiff.c | 4 |
11 files changed, 29 insertions, 28 deletions
diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index 42b587c3c81..2860944e948 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -402,7 +402,7 @@ bool imb_addrectImBuf(ImBuf *ibuf) ibuf->mall |= IB_rect; ibuf->flags |= IB_rect; if (ibuf->planes > 32) { - return (addzbufImBuf(ibuf)); + return addzbufImBuf(ibuf); } return true; diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 36ebe2b7cff..4f8fe0d8cdc 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -131,7 +131,7 @@ static int an_stringdec(const char *string, char *head, char *tail, ushort *numl strcpy(head, string); head[nums] = '\0'; *numlen = nume - nums + 1; - return ((int)atoi(&(string[nums]))); + return (int)atoi(&(string[nums])); } tail[0] = '\0'; strcpy(head, string); diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c index af9b62f1a74..495ec286de3 100644 --- a/source/blender/imbuf/intern/bmp.c +++ b/source/blender/imbuf/intern/bmp.c @@ -135,7 +135,7 @@ ImBuf *imb_bmp_decode(const uchar *mem, size_t size, int flags, char colorspace[ } /* Validate and cross-check offsets and sizes. */ - if (x < 1 || !(ELEM(depth, 1, 4, 8, 16, 24, 32))) { + if (x < 1 || !ELEM(depth, 1, 4, 8, 16, 24, 32)) { return NULL; } diff --git a/source/blender/imbuf/intern/cineon/logImageCore.c b/source/blender/imbuf/intern/cineon/logImageCore.c index 8188d0d04b9..9ec48447884 100644 --- a/source/blender/imbuf/intern/cineon/logImageCore.c +++ b/source/blender/imbuf/intern/cineon/logImageCore.c @@ -365,7 +365,7 @@ static int logImageSetData12(LogImageFile *logImage, LogImageElement logElement, for (size_t y = 0; y < logImage->height; y++) { for (size_t x = 0; x < logImage->width * logImage->depth; x++) { row[x] = swap_ushort( - ((ushort)float_uint(data[y * logImage->width * logImage->depth + x], 4095)) << 4, + (ushort)float_uint(data[y * logImage->width * logImage->depth + x], 4095) << 4, logImage->isMSB); } diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 7c2ced512f6..735472b6bdf 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -1016,8 +1016,9 @@ static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context, context->pts_time_base = av_q2d(context->iStream->time_base); while (av_read_frame(context->iFormatCtx, next_packet) >= 0) { - float next_progress = - (float)((int)floor(((double)next_packet->pos) * 100 / ((double)stream_size) + 0.5)) / 100; + float next_progress = (float)(int)floor( + ((double)next_packet->pos) * 100 / ((double)stream_size) + 0.5) / + 100; if (*progress != next_progress) { *progress = next_progress; diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index f57d4382672..d2b94355f85 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -746,17 +746,17 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters, for (i = 0; i < parameters->tcp_numlayers; i++) { temp_rate = 0; if (img_fol->rates[i] == 0) { - parameters->tcp_rates[0] = ((float)(image->numcomps * image->comps[0].w * - image->comps[0].h * image->comps[0].prec)) / + parameters->tcp_rates[0] = (float)(image->numcomps * image->comps[0].w * + image->comps[0].h * image->comps[0].prec) / (CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy); } else { - temp_rate = ((float)(image->numcomps * image->comps[0].w * image->comps[0].h * - image->comps[0].prec)) / + temp_rate = (float)(image->numcomps * image->comps[0].w * image->comps[0].h * + image->comps[0].prec) / (img_fol->rates[i] * 8 * image->comps[0].dx * image->comps[0].dy); if (temp_rate > CINEMA_24_CS) { - parameters->tcp_rates[i] = ((float)(image->numcomps * image->comps[0].w * - image->comps[0].h * image->comps[0].prec)) / + parameters->tcp_rates[i] = (float)(image->numcomps * image->comps[0].w * + image->comps[0].h * image->comps[0].prec) / (CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy); } @@ -772,17 +772,17 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters, for (i = 0; i < parameters->tcp_numlayers; i++) { temp_rate = 0; if (img_fol->rates[i] == 0) { - parameters->tcp_rates[0] = ((float)(image->numcomps * image->comps[0].w * - image->comps[0].h * image->comps[0].prec)) / + parameters->tcp_rates[0] = (float)(image->numcomps * image->comps[0].w * + image->comps[0].h * image->comps[0].prec) / (CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy); } else { - temp_rate = ((float)(image->numcomps * image->comps[0].w * image->comps[0].h * - image->comps[0].prec)) / + temp_rate = (float)(image->numcomps * image->comps[0].w * image->comps[0].h * + image->comps[0].prec) / (img_fol->rates[i] * 8 * image->comps[0].dx * image->comps[0].dy); if (temp_rate > CINEMA_48_CS) { - parameters->tcp_rates[0] = ((float)(image->numcomps * image->comps[0].w * - image->comps[0].h * image->comps[0].prec)) / + parameters->tcp_rates[0] = (float)(image->numcomps * image->comps[0].w * + image->comps[0].h * image->comps[0].prec) / (CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy); } diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index e03765fea92..e2d49cad374 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -209,7 +209,7 @@ static void memory_source(j_decompress_ptr cinfo, const uchar *buffer, size_t si */ #define INPUT_2BYTES(cinfo, V, action) \ MAKESTMT(MAKE_BYTE_AVAIL(cinfo, action); bytes_in_buffer--; \ - V = ((uint)GETJOCTET(*next_input_byte++)) << 8; \ + V = (uint)GETJOCTET(*next_input_byte++) << 8; \ MAKE_BYTE_AVAIL(cinfo, action); \ bytes_in_buffer--; \ V += GETJOCTET(*next_input_byte++);) diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index c28e8350622..d4a89c9e1c9 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -1859,7 +1859,7 @@ static bool imb_exr_is_multilayer_file(MultiPartInputFile &file) * channels without a layer name will be single layer. */ channels.layers(layerNames); - return (!layerNames.empty()); + return !layerNames.empty(); } static void imb_exr_type_by_channels(ChannelList &channels, diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c index 4159aa851c4..81fdac40ee6 100644 --- a/source/blender/imbuf/intern/rectop.c +++ b/source/blender/imbuf/intern/rectop.c @@ -810,7 +810,7 @@ void IMB_rectblend(ImBuf *dbuf, else { for (x = width; x > 0; x--, dr++, or ++, sr++, cmr++) { uchar *src = (uchar *)sr; - float mask = (float)mask_max * ((float)(*cmr)); + float mask = (float)mask_max * (float)(*cmr); if (texmaskrect) { mask *= ((float)(*tmr++) / 65535.0f); @@ -908,7 +908,7 @@ void IMB_rectblend(ImBuf *dbuf, /* no destination mask buffer, do regular blend with masktexture if present */ else { for (x = width; x > 0; x--, drf += 4, orf += 4, srf += 4, cmr++) { - float mask = (float)mask_max * ((float)(*cmr)); + float mask = (float)mask_max * (float)(*cmr); if (texmaskrect) { mask *= ((float)(*tmr++) / 65535.0f); diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index acffc4e7f8f..42c19ce1a7e 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -91,7 +91,7 @@ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1) } if (ibuf1->x <= 1) { - return (IMB_dupImBuf(ibuf1)); + return IMB_dupImBuf(ibuf1); } ibuf2 = IMB_allocImBuf((ibuf1->x) / 2, ibuf1->y, ibuf1->planes, ibuf1->flags); @@ -244,7 +244,7 @@ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1) } if (ibuf1->y <= 1) { - return (IMB_dupImBuf(ibuf1)); + return IMB_dupImBuf(ibuf1); } ibuf2 = IMB_allocImBuf(ibuf1->x, (ibuf1->y) / 2, ibuf1->planes, ibuf1->flags); @@ -441,10 +441,10 @@ ImBuf *IMB_onehalf(struct ImBuf *ibuf1) } if (ibuf1->x <= 1) { - return (IMB_half_y(ibuf1)); + return IMB_half_y(ibuf1); } if (ibuf1->y <= 1) { - return (IMB_half_x(ibuf1)); + return IMB_half_x(ibuf1); } ibuf2 = IMB_allocImBuf((ibuf1->x) / 2, (ibuf1->y) / 2, ibuf1->planes, ibuf1->flags); diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index f4829386aac..0e20d0748db 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -142,7 +142,7 @@ static tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n) } /* all set -> do the read (copy) */ - srcAddr = (void *)(&(mfile->mem[mfile->offset])); + srcAddr = (void *)&(mfile->mem[mfile->offset]); memcpy((void *)data, srcAddr, nCopy); mfile->offset += nCopy; /* advance file ptr by copied bytes */ return nCopy; @@ -437,7 +437,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image) } /* simple RGBA image */ - if (!(ELEM(bitspersample, 32, 16))) { + if (!ELEM(bitspersample, 32, 16)) { success |= TIFFReadRGBAImage(image, ibuf->x, ibuf->y, tmpibuf->rect, 0); } /* contiguous channels: RGBRGBRGB */ |