Bug 1102048 (Part 03) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth
authorGlenn Randers-Pehrson <glennrp+bmo@gmail.com>
Thu, 11 Dec 2014 17:03:00 -0800
changeset 267869 5ab8bc709c1bbf2695becfe07894be8f11c1a4e3
parent 267868 44c475f5adc1d5c0706d98c26a422490d8c0e204
child 267870 3e9b7795214aaf7a8c81ecb478346b3289763b30
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth
bugs1102048
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1102048 (Part 03) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth
image/src/BMPFileHeaders.h
image/src/ICOFileHeaders.h
--- a/image/src/BMPFileHeaders.h
+++ b/image/src/BMPFileHeaders.h
@@ -1,105 +1,109 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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_IMAGELIB_BMPHEADERS_H_
-#define MOZILLA_IMAGELIB_BMPHEADERS_H_
+#ifndef mozilla_image_src_BMPFileHeaders_h
+#define mozilla_image_src_BMPFileHeaders_h
 
 namespace mozilla {
-  namespace image {
+namespace image {
 
-    struct BMPFILEHEADER {
-      char signature[2]; // String "BM"
-      uint32_t filesize;
-      int32_t reserved; // Zero
-      uint32_t dataoffset; // Offset to raster data
+struct BMPFILEHEADER {
+  char signature[2];   // String "BM"
+  uint32_t filesize;
+  int32_t reserved;    // Zero
+  uint32_t dataoffset; // Offset to raster data
 
-      uint32_t bihsize;
-    };
+  uint32_t bihsize;
+};
 
 // The length of the bitmap file header as defined in the BMP spec.
 #define BFH_LENGTH 14
 // Internally we store the bitmap file header with an additional 4 bytes which
 // is used to store the bitmap information header size.
 #define BFH_INTERNAL_LENGTH 18
 
 #define OS2_INTERNAL_BIH_LENGTH 8
 #define WIN_V3_INTERNAL_BIH_LENGTH 36
 #define WIN_V5_INTERNAL_BIH_LENGTH 120
 
-#define OS2_BIH_LENGTH 12 // This is the real BIH size (as contained in the bihsize field of BMPFILEHEADER)
-#define WIN_V3_BIH_LENGTH 40 // This is the real BIH size (as contained in the bihsize field of BMPFILEHEADER)
-#define WIN_V5_BIH_LENGTH 124 // This is the real BIH size (as contained in the bihsize field of BMPFILEHEADER)
+#define OS2_BIH_LENGTH 12     // This is the real BIH size (as contained in the
+                              // bihsize field of BMPFILEHEADER)
+#define WIN_V3_BIH_LENGTH 40  // This is the real BIH size (as contained in the
+                              // bihsize field of BMPFILEHEADER)
+#define WIN_V5_BIH_LENGTH 124 // This is the real BIH size (as contained in the
+                              // bihsize field of BMPFILEHEADER)
 
 #define OS2_HEADER_LENGTH (BFH_INTERNAL_LENGTH + OS2_INTERNAL_BIH_LENGTH)
 #define WIN_V3_HEADER_LENGTH (BFH_INTERNAL_LENGTH + WIN_V3_INTERNAL_BIH_LENGTH)
 #define WIN_V5_HEADER_LENGTH (BFH_INTERNAL_LENGTH + WIN_V5_INTERNAL_BIH_LENGTH)
 
 #ifndef LCS_sRGB
 #define LCS_sRGB 0x73524742
 #endif
 
-    struct xyz {
-      int32_t x, y, z;
-    };
+struct xyz {
+  int32_t x, y, z;
+};
 
-    struct xyzTriple {
-      xyz r, g, b;
-    };
+struct xyzTriple {
+  xyz r, g, b;
+};
 
-    struct BITMAPV5HEADER {
-      int32_t width; // Uint16 in OS/2 BMPs
-      int32_t height; // Uint16 in OS/2 BMPs
-      uint16_t planes; // =1
-      uint16_t bpp; // Bits per pixel.
-      // The rest of the header is not available in OS/2 BMP Files
-      uint32_t compression; // 0=no compression 1=8bit RLE 2=4bit RLE
-      uint32_t image_size; // (compressed) image size. Can be 0 if compression==0
-      uint32_t xppm; // Pixels per meter, horizontal
-      uint32_t yppm; // Pixels per meter, vertical
-      uint32_t colors; // Used Colors
-      uint32_t important_colors; // Number of important colors. 0=all
-      uint32_t red_mask;   // Bits used for red component
-      uint32_t green_mask; // Bits used for green component
-      uint32_t blue_mask;  // Bits used for blue component
-      uint32_t alpha_mask; // Bits used for alpha component
-      uint32_t color_space; // 0x73524742=LCS_sRGB ...
-      // These members are unused unless color_space == LCS_CALIBRATED_RGB
-      xyzTriple white_point; // Logical white point
-      uint32_t gamma_red;   // Red gamma component
-      uint32_t gamma_green; // Green gamma component
-      uint32_t gamma_blue;  // Blue gamma component
-      uint32_t intent; // Rendering intent
-      // These members are unused unless color_space == LCS_PROFILE_*
-      uint32_t profile_offset; // Offset to profile data in bytes
-      uint32_t profile_size; // Size of profile data in bytes
-      uint32_t reserved; // =0
-    };
+struct BITMAPV5HEADER {
+  int32_t width;             // Uint16 in OS/2 BMPs
+  int32_t height;            // Uint16 in OS/2 BMPs
+  uint16_t planes;           // =1
+  uint16_t bpp;              // Bits per pixel.
+  // The rest of the header is not available in OS/2 BMP Files
+  uint32_t compression;      // 0=no compression 1=8bit RLE 2=4bit RLE
+  uint32_t image_size;       // (compressed) image size. Can be 0 if
+                             // compression==0
+  uint32_t xppm;             // Pixels per meter, horizontal
+  uint32_t yppm;             // Pixels per meter, vertical
+  uint32_t colors;           // Used Colors
+  uint32_t important_colors; // Number of important colors. 0=all
+  uint32_t red_mask;         // Bits used for red component
+  uint32_t green_mask;       // Bits used for green component
+  uint32_t blue_mask;        // Bits used for blue component
+  uint32_t alpha_mask;       // Bits used for alpha component
+  uint32_t color_space;      // 0x73524742=LCS_sRGB ...
+  // These members are unused unless color_space == LCS_CALIBRATED_RGB
+  xyzTriple white_point;     // Logical white point
+  uint32_t gamma_red;        // Red gamma component
+  uint32_t gamma_green;      // Green gamma component
+  uint32_t gamma_blue;       // Blue gamma component
+  uint32_t intent;           // Rendering intent
+  // These members are unused unless color_space == LCS_PROFILE_*
+  uint32_t profile_offset;   // Offset to profile data in bytes
+  uint32_t profile_size;     // Size of profile data in bytes
+  uint32_t reserved;         // =0
+};
 
-    struct colorTable {
-      uint8_t red;
-      uint8_t green;
-      uint8_t blue;
-    };
+struct colorTable {
+  uint8_t red;
+  uint8_t green;
+  uint8_t blue;
+};
 
-    struct bitFields {
-      uint32_t red;
-      uint32_t green;
-      uint32_t blue;
-      uint8_t redLeftShift;
-      uint8_t redRightShift;
-      uint8_t greenLeftShift;
-      uint8_t greenRightShift;
-      uint8_t blueLeftShift;
-      uint8_t blueRightShift;
-    };
+struct bitFields {
+  uint32_t red;
+  uint32_t green;
+  uint32_t blue;
+  uint8_t redLeftShift;
+  uint8_t redRightShift;
+  uint8_t greenLeftShift;
+  uint8_t greenRightShift;
+  uint8_t blueLeftShift;
+  uint8_t blueRightShift;
+};
 
-  } // namespace image
+} // namespace image
 } // namespace mozilla
 
 #define BITFIELD_LENGTH 12 // Length of the bitfields structure in the bmp file
 #define USE_RGB
 
 // BMPINFOHEADER.compression defines
 #ifndef BI_RGB
 #define BI_RGB 0
@@ -125,14 +129,16 @@ namespace mozilla {
 #define RLE_ESCAPE_EOF   1
 #define RLE_ESCAPE_DELTA 2
 
 /// enums for mState
 enum ERLEState {
   eRLEStateInitial,
   eRLEStateNeedSecondEscapeByte,
   eRLEStateNeedXDelta,
-  eRLEStateNeedYDelta,    ///< mStateData will hold x delta
-  eRLEStateAbsoluteMode,  ///< mStateData will hold count of existing data to read
-  eRLEStateAbsoluteModePadded ///< As above, but another byte of data has to be read as padding
+  eRLEStateNeedYDelta,        ///< mStateData will hold x delta
+  eRLEStateAbsoluteMode,      ///< mStateData will hold count of existing data
+                              ///< to read
+  eRLEStateAbsoluteModePadded ///< As above, but another byte of data has to
+                              ///< be read as padding
 };
 
-#endif
+#endif // mozilla_image_src_BMPFileHeaders_h
--- a/image/src/ICOFileHeaders.h
+++ b/image/src/ICOFileHeaders.h
@@ -1,81 +1,81 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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_IMAGELIB_ICOHEADERS_H_
-#define MOZILLA_IMAGELIB_ICOHEADERS_H_
+#ifndef mozilla_image_src_ICOFileHeaders_h
+#define mozilla_image_src_ICOFileHeaders_h
 
 namespace mozilla {
-  namespace image {
+namespace image {
 
-    #define ICONFILEHEADERSIZE 6
-    #define ICODIRENTRYSIZE 16
-    #define PNGSIGNATURESIZE 8
-    #define BMPFILEHEADERSIZE 14
+#define ICONFILEHEADERSIZE 6
+#define ICODIRENTRYSIZE 16
+#define PNGSIGNATURESIZE 8
+#define BMPFILEHEADERSIZE 14
 
-    /**
-     * The header that comes right at the start of an icon file. (This
-     * corresponds to the Windows ICONDIR structure.)
-     */
-    struct IconFileHeader
-    {
-      /**
-       * Must be set to 0;
-       */
-      uint16_t   mReserved;
-      /**
-       * 1 for icon (.ICO) image (or 2 for cursor (.CUR) image (icon with the
-       * addition of a hotspot), but we don't support cursor).
-       */
-      uint16_t   mType;
-      /**
-       * The number of BMP/PNG images contained in the icon file.
-       */
-      uint16_t   mCount;
-    };
+/**
+ * The header that comes right at the start of an icon file. (This
+ * corresponds to the Windows ICONDIR structure.)
+ */
+struct IconFileHeader
+{
+  /**
+   * Must be set to 0;
+   */
+  uint16_t   mReserved;
+  /**
+   * 1 for icon (.ICO) image (or 2 for cursor (.CUR) image (icon with the
+   * addition of a hotspot), but we don't support cursor).
+   */
+  uint16_t   mType;
+  /**
+   * The number of BMP/PNG images contained in the icon file.
+   */
+  uint16_t   mCount;
+};
 
-    /**
-     * For each BMP/PNG image that the icon file containts there must be a
-     * corresponding icon dir entry. (This corresponds to the Windows
-     * ICONDIRENTRY structure.) These entries are encoded directly after the
-     * IconFileHeader.
-     */
-    struct IconDirEntry
-    {
-      uint8_t   mWidth;
-      uint8_t   mHeight;
-      /**
-       * The number of colors in the color palette of the BMP/PNG that this dir
-       * entry corresponds to, or 0 if the image does not use a color palette.
-       */
-      uint8_t   mColorCount;
-      /**
-       * Should be set to 0.
-       */
-      uint8_t   mReserved;
-      union {
-        uint16_t mPlanes;   // ICO
-        uint16_t mXHotspot; // CUR
-      };
-      union {
-        uint16_t mBitCount; // ICO (bits per pixel)
-        uint16_t mYHotspot; // CUR
-      };
-      /**
-       * "bytes in resource" is the length of the encoded BMP/PNG that this dir
-       * entry corresponds to.
-       */
-      uint32_t  mBytesInRes;
-      /**
-       * The offset of the start of the encoded BMP/PNG that this dir entry
-       * corresponds to (from the start of the icon file).
-       */
-      uint32_t  mImageOffset;
-    };
+/**
+ * For each BMP/PNG image that the icon file contains there must be a
+ * corresponding icon dir entry. (This corresponds to the Windows
+ * ICONDIRENTRY structure.) These entries are encoded directly after the
+ * IconFileHeader.
+ */
+struct IconDirEntry
+{
+  uint8_t   mWidth;
+  uint8_t   mHeight;
+  /**
+   * The number of colors in the color palette of the BMP/PNG that this dir
+   * entry corresponds to, or 0 if the image does not use a color palette.
+   */
+  uint8_t   mColorCount;
+  /**
+   * Should be set to 0.
+   */
+  uint8_t   mReserved;
+  union {
+    uint16_t mPlanes;   // ICO
+    uint16_t mXHotspot; // CUR
+  };
+  union {
+    uint16_t mBitCount; // ICO (bits per pixel)
+    uint16_t mYHotspot; // CUR
+  };
+  /**
+   * "bytes in resource" is the length of the encoded BMP/PNG that this dir
+   * entry corresponds to.
+   */
+  uint32_t  mBytesInRes;
+  /**
+   * The offset of the start of the encoded BMP/PNG that this dir entry
+   * corresponds to (from the start of the icon file).
+   */
+  uint32_t  mImageOffset;
+};
 
 
-  } // namespace image
+} // namespace image
 } // namespace mozilla
 
-#endif
+#endif // mozilla_image_src_ICOFileHeaders_h