diff --git a/image/encoders/bmp/nsBMPEncoder.cpp b/image/encoders/bmp/nsBMPEncoder.cpp index 0f6a5614cf4..71d60677f4c 100644 --- a/image/encoders/bmp/nsBMPEncoder.cpp +++ b/image/encoders/bmp/nsBMPEncoder.cpp @@ -206,7 +206,7 @@ nsBMPEncoder::AddImageFrame(const uint8_t* aData, } } else if (aInputFormat == INPUT_FORMAT_RGBA) { // simple RGBA, no conversion needed - for (int32_t y = 0; y < mBMPInfoHeader.height; y ++) { + for (int32_t y = 0; y < mBMPInfoHeader.height; y++) { if (mBMPInfoHeader.bpp == 24) { EncodeImageDataRow24(row); } else { @@ -215,7 +215,7 @@ nsBMPEncoder::AddImageFrame(const uint8_t* aData, } } else if (aInputFormat == INPUT_FORMAT_RGB) { // simple RGB, no conversion needed - for (int32_t y = 0; y < mBMPInfoHeader.height; y ++) { + for (int32_t y = 0; y < mBMPInfoHeader.height; y++) { if (mBMPInfoHeader.bpp == 24) { EncodeImageDataRow24(&aData[y * aStride]); } else { @@ -700,7 +700,7 @@ nsBMPEncoder::EncodeImageDataRow24(const uint8_t* aData) void nsBMPEncoder::EncodeImageDataRow32(const uint8_t* aData) { - for (int32_t x = 0; x < mBMPInfoHeader.width; x ++) { + for (int32_t x = 0; x < mBMPInfoHeader.width; x++) { uint32_t pos = x * BytesPerPixel(mBMPInfoHeader.bpp); SetPixel32(mImageBufferCurr, aData[pos], aData[pos + 1], aData[pos + 2], aData[pos + 3]); @@ -708,7 +708,7 @@ nsBMPEncoder::EncodeImageDataRow32(const uint8_t* aData) } for (uint32_t x = 0; x < PaddingBytes(mBMPInfoHeader.bpp, - mBMPInfoHeader.width); x ++) { + mBMPInfoHeader.width); x++) { *mImageBufferCurr++ = 0; } } diff --git a/image/encoders/bmp/nsBMPEncoder.h b/image/encoders/bmp/nsBMPEncoder.h index 5fa202e0b62..5abfd50dec8 100644 --- a/image/encoders/bmp/nsBMPEncoder.h +++ b/image/encoders/bmp/nsBMPEncoder.h @@ -2,6 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef mozilla_image_encoders_bmp_nsBMPEncoder_h +#define mozilla_image_encoders_bmp_nsBMPEncoder_h + #include "mozilla/Attributes.h" #include "mozilla/ReentrantMonitor.h" @@ -91,3 +94,5 @@ protected: nsCOMPtr mCallbackTarget; uint32_t mNotifyThreshold; }; + +#endif // mozilla_image_encoders_bmp_nsBMPEncoder_h diff --git a/image/encoders/ico/nsICOEncoder.h b/image/encoders/ico/nsICOEncoder.h index e4ad20bab28..ffa5cb138d4 100644 --- a/image/encoders/ico/nsICOEncoder.h +++ b/image/encoders/ico/nsICOEncoder.h @@ -2,6 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef mozilla_image_encoders_ico_nsICOEncoder_h +#define mozilla_image_encoders_ico_nsICOEncoder_h + #include "mozilla/Attributes.h" #include "mozilla/ReentrantMonitor.h" @@ -96,3 +99,5 @@ protected: nsCOMPtr mCallbackTarget; uint32_t mNotifyThreshold; }; + +#endif // mozilla_image_encoders_ico_nsICOEncoder_h diff --git a/image/encoders/jpeg/nsJPEGEncoder.h b/image/encoders/jpeg/nsJPEGEncoder.h index 3616b3b871a..2bcf5c2f3ed 100644 --- a/image/encoders/jpeg/nsJPEGEncoder.h +++ b/image/encoders/jpeg/nsJPEGEncoder.h @@ -3,6 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef mozilla_image_encoders_jpeg_nsJPEGEncoder_h +#define mozilla_image_encoders_jpeg_nsJPEGEncoder_h + #include "imgIEncoder.h" #include "mozilla/ReentrantMonitor.h" @@ -77,3 +80,5 @@ protected: // that only one thread dispatches a callback for each call to AsyncWait. ReentrantMonitor mReentrantMonitor; }; + +#endif // mozilla_image_encoders_jpeg_nsJPEGEncoder_h diff --git a/image/encoders/png/nsPNGEncoder.cpp b/image/encoders/png/nsPNGEncoder.cpp index d21ea4ebdba..141e5418442 100644 --- a/image/encoders/png/nsPNGEncoder.cpp +++ b/image/encoders/png/nsPNGEncoder.cpp @@ -36,8 +36,7 @@ nsPNGEncoder::nsPNGEncoder() : mPNG(nullptr), mPNGinfo(nullptr), mCallbackTarget(nullptr), mNotifyThreshold(0), mReentrantMonitor( "nsPNGEncoder.mReentrantMonitor") -{ -} +{ } nsPNGEncoder::~nsPNGEncoder() { @@ -291,7 +290,7 @@ nsPNGEncoder::AddImageFrame(const uint8_t* aData, // PNG requires RGBA with post-multiplied alpha, so we need to // convert uint8_t* row = new uint8_t[aWidth * 4]; - for (uint32_t y = 0; y < aHeight; y ++) { + for (uint32_t y = 0; y < aHeight; y++) { ConvertHostARGBRow(&aData[y * aStride], row, aWidth, useTransparency); png_write_row(mPNG, row); } @@ -300,7 +299,7 @@ nsPNGEncoder::AddImageFrame(const uint8_t* aData, } else if (aInputFormat == INPUT_FORMAT_RGBA && !useTransparency) { // RBGA, but we need to strip the alpha uint8_t* row = new uint8_t[aWidth * 4]; - for (uint32_t y = 0; y < aHeight; y ++) { + for (uint32_t y = 0; y < aHeight; y++) { StripAlpha(&aData[y * aStride], row, aWidth); png_write_row(mPNG, row); } @@ -309,7 +308,7 @@ nsPNGEncoder::AddImageFrame(const uint8_t* aData, } else if (aInputFormat == INPUT_FORMAT_RGB || aInputFormat == INPUT_FORMAT_RGBA) { // simple RBG(A), no conversion needed - for (uint32_t y = 0; y < aHeight; y ++) { + for (uint32_t y = 0; y < aHeight; y++) { png_write_row(mPNG, (uint8_t*)&aData[y * aStride]); } @@ -655,7 +654,7 @@ nsPNGEncoder::ConvertHostARGBRow(const uint8_t* aSrc, uint8_t* aDest, bool aUseTransparency) { uint32_t pixelStride = aUseTransparency ? 4 : 3; - for (uint32_t x = 0; x < aPixelWidth; x ++) { + for (uint32_t x = 0; x < aPixelWidth; x++) { const uint32_t& pixelIn = ((const uint32_t*)(aSrc))[x]; uint8_t* pixelOut = &aDest[x * pixelStride]; @@ -684,7 +683,7 @@ void nsPNGEncoder::StripAlpha(const uint8_t* aSrc, uint8_t* aDest, uint32_t aPixelWidth) { - for (uint32_t x = 0; x < aPixelWidth; x ++) { + for (uint32_t x = 0; x < aPixelWidth; x++) { const uint8_t* pixelIn = &aSrc[x * 4]; uint8_t* pixelOut = &aDest[x * 3]; pixelOut[0] = pixelIn[0];