diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-08 04:02:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-08 06:37:55 +0300 |
commit | 586a3084677b03e314a906ffdac3560a24058409 (patch) | |
tree | b2b920b14e5408b09556c514814e82a188a1d38d /source/blender/imbuf/intern/dds | |
parent | f1b1a0745f53564ed8eedd90d2de41cdf1d72836 (diff) |
Cleanup: remove redundant return parenthesis
Diffstat (limited to 'source/blender/imbuf/intern/dds')
-rw-r--r-- | source/blender/imbuf/intern/dds/DirectDrawSurface.cpp | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/dds/Stream.cpp | 20 | ||||
-rw-r--r-- | source/blender/imbuf/intern/dds/dds_api.cpp | 32 |
3 files changed, 27 insertions, 27 deletions
diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp index 92dd475813a..7ec059607c5 100644 --- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp +++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp @@ -1353,7 +1353,7 @@ uint DirectDrawSurface::mipmapSize(uint mipmap) const } printf("DDS: mipmap format not supported\n"); - return (0); + return 0; } uint DirectDrawSurface::faceSize() const diff --git a/source/blender/imbuf/intern/dds/Stream.cpp b/source/blender/imbuf/intern/dds/Stream.cpp index 271717f165c..e1c5eb1d505 100644 --- a/source/blender/imbuf/intern/dds/Stream.cpp +++ b/source/blender/imbuf/intern/dds/Stream.cpp @@ -42,55 +42,55 @@ unsigned int mem_read(Stream &mem, unsigned long long &i) { if (mem.pos + 8 > mem.size) { mem.set_failed(msg_error_seek); - return (0); + return 0; } memcpy(&i, mem.mem + mem.pos, 8); // @@ todo: make sure little endian mem.pos += 8; - return (8); + return 8; } unsigned int mem_read(Stream &mem, unsigned int &i) { if (mem.pos + 4 > mem.size) { mem.set_failed(msg_error_read); - return (0); + return 0; } memcpy(&i, mem.mem + mem.pos, 4); // @@ todo: make sure little endian mem.pos += 4; - return (4); + return 4; } unsigned int mem_read(Stream &mem, unsigned short &i) { if (mem.pos + 2 > mem.size) { mem.set_failed(msg_error_read); - return (0); + return 0; } memcpy(&i, mem.mem + mem.pos, 2); // @@ todo: make sure little endian mem.pos += 2; - return (2); + return 2; } unsigned int mem_read(Stream &mem, unsigned char &i) { if (mem.pos + 1 > mem.size) { mem.set_failed(msg_error_read); - return (0); + return 0; } i = (mem.mem + mem.pos)[0]; mem.pos += 1; - return (1); + return 1; } unsigned int mem_read(Stream &mem, unsigned char *i, unsigned int cnt) { if (mem.pos + cnt > mem.size) { mem.set_failed(msg_error_read); - return (0); + return 0; } memcpy(i, mem.mem + mem.pos, cnt); mem.pos += cnt; - return (cnt); + return cnt; } void Stream::set_failed(const char *msg) diff --git a/source/blender/imbuf/intern/dds/dds_api.cpp b/source/blender/imbuf/intern/dds/dds_api.cpp index 83d304203a0..309b5d6410f 100644 --- a/source/blender/imbuf/intern/dds/dds_api.cpp +++ b/source/blender/imbuf/intern/dds/dds_api.cpp @@ -44,14 +44,14 @@ extern "C" { int imb_save_dds(struct ImBuf *ibuf, const char *name, int /*flags*/) { - return (0); /* todo: finish this function */ + return 0; /* todo: finish this function */ /* check image buffer */ if (ibuf == 0) { - return (0); + return 0; } if (ibuf->rect == 0) { - return (0); + return 0; } /* open file for writing */ @@ -69,7 +69,7 @@ int imb_save_dds(struct ImBuf *ibuf, const char *name, int /*flags*/) fildes << "DDS "; fildes.close(); - return (1); + return 1; } int imb_is_a_dds(const unsigned char *mem) // note: use at most first 32 bytes @@ -77,13 +77,13 @@ int imb_is_a_dds(const unsigned char *mem) // note: use at most first 32 bytes /* heuristic check to see if mem contains a DDS file */ /* header.fourcc == FOURCC_DDS */ if ((mem[0] != 'D') || (mem[1] != 'D') || (mem[2] != 'S') || (mem[3] != ' ')) { - return (0); + return 0; } /* header.size == 124 */ if ((mem[4] != 124) || mem[5] || mem[6] || mem[7]) { - return (0); + return 0; } - return (1); + return 1; } struct ImBuf *imb_load_dds(const unsigned char *mem, @@ -109,27 +109,27 @@ struct ImBuf *imb_load_dds(const unsigned char *mem, colorspace_set_default_role(colorspace, IM_MAX_SPACE, COLOR_ROLE_DEFAULT_BYTE); if (!imb_is_a_dds(mem)) { - return (0); + return 0; } /* check if DDS is valid and supported */ if (!dds.isValid()) { /* no need to print error here, just testing if it is a DDS */ if (flags & IB_test) { - return (0); + return 0; } printf("DDS: not valid; header follows\n"); dds.printInfo(); - return (0); + return 0; } if (!dds.isSupported()) { printf("DDS: format not supported\n"); - return (0); + return 0; } if ((dds.width() > 65535) || (dds.height() > 65535)) { printf("DDS: dimensions too large\n"); - return (0); + return 0; } /* convert DDS into ImBuf */ @@ -149,7 +149,7 @@ struct ImBuf *imb_load_dds(const unsigned char *mem, } ibuf = IMB_allocImBuf(dds.width(), dds.height(), bits_per_pixel, 0); if (ibuf == 0) { - return (0); /* memory allocation failed */ + return 0; /* memory allocation failed */ } ibuf->ftype = IMB_FTYPE_DDS; @@ -158,10 +158,10 @@ struct ImBuf *imb_load_dds(const unsigned char *mem, if ((flags & IB_test) == 0) { if (!imb_addrectImBuf(ibuf)) { - return (ibuf); + return ibuf; } if (ibuf->rect == 0) { - return (ibuf); + return ibuf; } rect = ibuf->rect; @@ -196,7 +196,7 @@ struct ImBuf *imb_load_dds(const unsigned char *mem, IMB_flipy(ibuf); } - return (ibuf); + return ibuf; } } // extern "C" |