Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-06-23 02:58:25 +0300
committerHans Goudey <h.goudey@me.com>2022-06-23 02:58:25 +0300
commit1160a3a3f83cafda98e7bf6fb111bdacc5f28a63 (patch)
treeb969f2508aac0cb59cd3fe81119dc1301a84bfb0 /source/blender/imbuf
parentd2a3b99ff7abb3d7deb30da4554b1cda6ff32766 (diff)
Cleanup: Clang tidy
Mainly duplicate includes and else after return.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/colormanagement.c25
-rw-r--r--source/blender/imbuf/intern/imageprocess.c1
-rw-r--r--source/blender/imbuf/intern/jpeg.c4
3 files changed, 14 insertions, 16 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 33873b5daa7..a58c2ba4c44 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -2481,22 +2481,21 @@ static ImBuf *imbuf_ensure_editable(ImBuf *ibuf, ImBuf *colormanaged_ibuf, bool
IMB_metadata_copy(colormanaged_ibuf, ibuf);
return colormanaged_ibuf;
}
- else {
- /* Render pipeline is constructing image buffer itself,
- * but it's re-using byte and float buffers from render result make copy of this buffers
- * here sine this buffers would be transformed to other color space here. */
- if (ibuf->rect && (ibuf->mall & IB_rect) == 0) {
- ibuf->rect = MEM_dupallocN(ibuf->rect);
- ibuf->mall |= IB_rect;
- }
- if (ibuf->rect_float && (ibuf->mall & IB_rectfloat) == 0) {
- ibuf->rect_float = MEM_dupallocN(ibuf->rect_float);
- ibuf->mall |= IB_rectfloat;
- }
+ /* Render pipeline is constructing image buffer itself,
+ * but it's re-using byte and float buffers from render result make copy of this buffers
+ * here sine this buffers would be transformed to other color space here. */
+ if (ibuf->rect && (ibuf->mall & IB_rect) == 0) {
+ ibuf->rect = MEM_dupallocN(ibuf->rect);
+ ibuf->mall |= IB_rect;
+ }
- return ibuf;
+ if (ibuf->rect_float && (ibuf->mall & IB_rectfloat) == 0) {
+ ibuf->rect_float = MEM_dupallocN(ibuf->rect_float);
+ ibuf->mall |= IB_rectfloat;
}
+
+ return ibuf;
}
ImBuf *IMB_colormanagement_imbuf_for_write(ImBuf *ibuf,
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index ec25b67af5f..13bf3697946 100644
--- a/source/blender/imbuf/intern/imageprocess.c
+++ b/source/blender/imbuf/intern/imageprocess.c
@@ -22,7 +22,6 @@
#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
-#include <math.h>
void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf)
{
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index cffa61977f7..06f9202a1c6 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -524,8 +524,8 @@ struct ImBuf *imb_thumbnail_jpeg(const char *filepath,
unsigned int i = JPEG_APP1_MAX;
/* All EXIF data is within this 64K header segment. Skip ahead until next SOI for thumbnail. */
while (!((fgetc(infile) == JPEG_MARKER_MSB) && (fgetc(infile) == JPEG_MARKER_SOI)) &&
- !feof(infile) && i--)
- ;
+ !feof(infile) && i--) {
+ }
if (i > 0 && !feof(infile)) {
/* We found a JPEG thumbnail inside this image. */
ImBuf *ibuf = NULL;