diff options
author | Lars Næsbye Christensen <lars@naesbye.dk> | 2024-02-09 01:56:54 +0100 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-02-12 23:17:22 +0200 |
commit | 981470e0a1f4d3157d6528b3966922d825e77fce (patch) | |
tree | 076f1db900504c86e591566be5baffa8771939e0 /indra/llimage | |
parent | 79ceefe56b5fabdbcc1476d1d5b8253aa405ed21 (diff) |
llimage: BOOL (int) to real bool
Diffstat (limited to 'indra/llimage')
-rw-r--r-- | indra/llimage/llimagedimensionsinfo.cpp | 2 | ||||
-rw-r--r-- | indra/llimage/llimageworker.cpp | 16 | ||||
-rw-r--r-- | indra/llimage/llimageworker.h | 2 | ||||
-rw-r--r-- | indra/llimage/llpngwrapper.cpp | 20 | ||||
-rw-r--r-- | indra/llimage/llpngwrapper.h | 6 |
5 files changed, 23 insertions, 23 deletions
diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp index 97b543f3b6..234a504a14 100644 --- a/indra/llimage/llimagedimensionsinfo.cpp +++ b/indra/llimage/llimagedimensionsinfo.cpp @@ -197,7 +197,7 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg() jpeg_create_decompress (&cinfo); jpeg_stdio_src (&cinfo, fp); - jpeg_read_header (&cinfo, TRUE); + jpeg_read_header (&cinfo, true); cinfo.out_color_space = JCS_RGB; jpeg_start_decompress (&cinfo); diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index 44749343e1..dc99b34c57 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -35,7 +35,7 @@ class ImageRequest { public: ImageRequest(const LLPointer<LLImageFormatted>& image, - S32 discard, BOOL needs_aux, + S32 discard, bool needs_aux, const LLPointer<LLImageDecodeThread::Responder>& responder); virtual ~ImageRequest(); @@ -48,12 +48,12 @@ private: // input LLPointer<LLImageFormatted> mFormattedImage; S32 mDiscardLevel; - BOOL mNeedsAux; + bool mNeedsAux; // output LLPointer<LLImageRaw> mDecodedImageRaw; LLPointer<LLImageRaw> mDecodedImageAux; - BOOL mDecodedRaw; - BOOL mDecodedAux; + bool mDecodedRaw; + bool mDecodedAux; LLPointer<LLImageDecodeThread::Responder> mResponder; }; @@ -87,7 +87,7 @@ size_t LLImageDecodeThread::getPending() LLImageDecodeThread::handle_t LLImageDecodeThread::decodeImage( const LLPointer<LLImageFormatted>& image, S32 discard, - BOOL needs_aux, + bool needs_aux, const LLPointer<LLImageDecodeThread::Responder>& responder) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; @@ -124,13 +124,13 @@ LLImageDecodeThread::Responder::~Responder() //---------------------------------------------------------------------------- ImageRequest::ImageRequest(const LLPointer<LLImageFormatted>& image, - S32 discard, BOOL needs_aux, + S32 discard, bool needs_aux, const LLPointer<LLImageDecodeThread::Responder>& responder) : mFormattedImage(image), mDiscardLevel(discard), mNeedsAux(needs_aux), - mDecodedRaw(FALSE), - mDecodedAux(FALSE), + mDecodedRaw(false), + mDecodedAux(false), mResponder(responder) { } diff --git a/indra/llimage/llimageworker.h b/indra/llimage/llimageworker.h index ca4c0d93d0..c24fd31f0f 100644 --- a/indra/llimage/llimageworker.h +++ b/indra/llimage/llimageworker.h @@ -49,7 +49,7 @@ public: // meant to resemble LLQueuedThread::handle_t typedef U32 handle_t; handle_t decodeImage(const LLPointer<LLImageFormatted>& image, - S32 discard, BOOL needs_aux, + S32 discard, bool needs_aux, const LLPointer<Responder>& responder); size_t getPending(); size_t update(F32 max_time_ms); diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp index 27e23b577b..baf1330011 100644 --- a/indra/llimage/llpngwrapper.cpp +++ b/indra/llimage/llpngwrapper.cpp @@ -70,7 +70,7 @@ LLPngWrapper::~LLPngWrapper() } // Checks the src for a valid PNG header -BOOL LLPngWrapper::isValidPng(U8* src) +bool LLPngWrapper::isValidPng(U8* src) { const int PNG_BYTES_TO_CHECK = 8; @@ -78,10 +78,10 @@ BOOL LLPngWrapper::isValidPng(U8* src) if (sig != 0) { mErrorMessage = "Invalid or corrupt PNG file"; - return FALSE; + return false; } - return TRUE; + return true; } // Called by the libpng library when a fatal encoding or decoding error @@ -134,7 +134,7 @@ void LLPngWrapper::writeFlush(png_structp png_ptr) // The scanline also begins at the bottom of // the image (per SecondLife conventions) instead of at the top, so we // must assign row-pointers in "reverse" order. -BOOL LLPngWrapper::readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInfo *infop) +bool LLPngWrapper::readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInfo *infop) { try { @@ -210,18 +210,18 @@ BOOL LLPngWrapper::readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInf { mErrorMessage = msg.what(); releaseResources(); - return (FALSE); + return (false); } catch (std::bad_alloc&) { mErrorMessage = "LLPngWrapper"; releaseResources(); - return (FALSE); + return (false); } // Clean up and return releaseResources(); - return (TRUE); + return (true); } // Do transformations to normalize the input to 8-bpp RGBA @@ -283,7 +283,7 @@ void LLPngWrapper::updateMetaData() // Method to write raw image into PNG at dest. The raw scanline begins // at the bottom of the image per SecondLife conventions. -BOOL LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest, size_t destSize) +bool LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest, size_t destSize) { try { @@ -364,11 +364,11 @@ BOOL LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest, size_t destSiz { mErrorMessage = msg.what(); releaseResources(); - return (FALSE); + return (false); } releaseResources(); - return TRUE; + return true; } // Cleanup various internal structures diff --git a/indra/llimage/llpngwrapper.h b/indra/llimage/llpngwrapper.h index 8d42317b0f..b17e8d1f40 100644 --- a/indra/llimage/llpngwrapper.h +++ b/indra/llimage/llpngwrapper.h @@ -43,9 +43,9 @@ public: S8 mComponents; }; - BOOL isValidPng(U8* src); - BOOL readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInfo *infop = NULL); - BOOL writePng(const LLImageRaw* rawImage, U8* dst, size_t destSize); + bool isValidPng(U8* src); + bool readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInfo *infop = NULL); + bool writePng(const LLImageRaw* rawImage, U8* dst, size_t destSize); U32 getFinalSize(); const std::string& getErrorMessage(); |