Remove |typedef struct| in favor of just |struct|.

Because I saw one in some other code and decided to hunt them all.
These are all defined in C++ context, so no chance of C compatiblity.
Note that such a declaration without a struct tag will bypass the
[chromium-style] out-of-line constructor/destructor warnings, so
add constructors/destructors where required.

Change-Id: Ib821d8bc2f68ccf7028b0f73432e8e7c93a953ba
Reviewed-on: https://pdfium-review.googlesource.com/39851
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index 26dfbc1..8054aa8 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -300,10 +300,10 @@
 };
 
 #if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
-typedef struct {
+struct PDF_FONTDATA {
   bool bFind;
   LOGFONTA lf;
-} PDF_FONTDATA;
+};
 
 static int CALLBACK EnumFontFamExProc(ENUMLOGFONTEXA* lpelfe,
                                       NEWTEXTMETRICEX* lpntme,
diff --git a/core/fxcodec/bmp/fx_bmp.h b/core/fxcodec/bmp/fx_bmp.h
index 76177ff..d013577 100644
--- a/core/fxcodec/bmp/fx_bmp.h
+++ b/core/fxcodec/bmp/fx_bmp.h
@@ -30,21 +30,23 @@
 // Limit width to (MAXINT32 - 31) / 32
 #define BMP_MAX_WIDTH 67108863
 #pragma pack(1)
-typedef struct tagBmpFileHeader {
+struct BmpFileHeader {
   uint16_t bfType;
   uint32_t bfSize;
   uint16_t bfReserved1;
   uint16_t bfReserved2;
   uint32_t bfOffBits;
-} BmpFileHeader;
-typedef struct tagBmpCoreHeader {
+};
+
+struct BmpCoreHeader {
   uint32_t bcSize;
   uint16_t bcWidth;
   uint16_t bcHeight;
   uint16_t bcPlanes;
   uint16_t bcBitCount;
-} BmpCoreHeader;
-typedef struct tagBmpInfoHeader {
+};
+
+struct BmpInfoHeader {
   uint32_t biSize;
   int32_t biWidth;
   int32_t biHeight;
@@ -56,7 +58,7 @@
   int32_t biYPelsPerMeter;
   uint32_t biClrUsed;
   uint32_t biClrImportant;
-} BmpInfoHeader;
+};
 #pragma pack()
 
 #endif  // CORE_FXCODEC_BMP_FX_BMP_H_
diff --git a/core/fxcodec/gif/cfx_gif.cpp b/core/fxcodec/gif/cfx_gif.cpp
index 18d474b..efe4f4b 100644
--- a/core/fxcodec/gif/cfx_gif.cpp
+++ b/core/fxcodec/gif/cfx_gif.cpp
@@ -29,3 +29,7 @@
               "GifApplicationExtension should have a size of 12");
 static_assert(sizeof(CFX_GifPalette) == 3,
               "CFX_GifPalette should have a size of 3");
+
+CFX_GifImage::CFX_GifImage() = default;
+
+CFX_GifImage::~CFX_GifImage() = default;
diff --git a/core/fxcodec/gif/cfx_gif.h b/core/fxcodec/gif/cfx_gif.h
index dd0d719..9ca7211 100644
--- a/core/fxcodec/gif/cfx_gif.h
+++ b/core/fxcodec/gif/cfx_gif.h
@@ -116,7 +116,10 @@
   InsufficientDestSize,  // Only used internally by CGifLZWDecoder::Decode()
 };
 
-typedef struct {
+struct CFX_GifImage {
+  CFX_GifImage();
+  ~CFX_GifImage();
+
   std::unique_ptr<CFX_GifGraphicControlExtension> image_GCE;
   std::vector<CFX_GifPalette> local_palettes;
   std::vector<uint8_t> row_buffer;
@@ -125,6 +128,6 @@
   uint8_t code_exp;
   uint32_t data_pos;
   int32_t row_num;
-} CFX_GifImage;
+};
 
 #endif  // CORE_FXCODEC_GIF_CFX_GIF_H_
diff --git a/core/fxcodec/gif/cfx_lzwdecompressor.h b/core/fxcodec/gif/cfx_lzwdecompressor.h
index f4df065..d3ec588 100644
--- a/core/fxcodec/gif/cfx_lzwdecompressor.h
+++ b/core/fxcodec/gif/cfx_lzwdecompressor.h
@@ -14,10 +14,10 @@
 
 class CFX_LZWDecompressor {
  public:
-  typedef struct {
+  struct CodeEntry {
     uint16_t prefix;
     uint8_t suffix;
-  } CodeEntry;
+  };
 
   // Returns nullptr on error
   static std::unique_ptr<CFX_LZWDecompressor> Create(uint8_t color_exp,
diff --git a/core/fxge/cfx_font.h b/core/fxge/cfx_font.h
index 0d858ea..5bd93ea 100644
--- a/core/fxge/cfx_font.h
+++ b/core/fxge/cfx_font.h
@@ -103,11 +103,11 @@
   static const uint8_t s_WeightPow_11[kWeightPowArraySize];
   static const uint8_t s_WeightPow_SHIFTJIS[kWeightPowArraySize];
 
-  // This struct shoub same as FPDF_CharsetFontMap
-  typedef struct {
+  // This struct should be the same as FPDF_CharsetFontMap.
+  struct CharsetFontMap {
     int charset;           // Character Set Enum value, see FX_CHARSET_XXX.
     const char* fontname;  // Name of default font to use with that charset.
-  } CharsetFontMap;
+  };
 
   /**
    *    Pointer to the default character set to TT Font name map. The
diff --git a/core/fxge/win32/cfx_windowsdib.h b/core/fxge/win32/cfx_windowsdib.h
index 3120b8f..c64fc7d 100644
--- a/core/fxge/win32/cfx_windowsdib.h
+++ b/core/fxge/win32/cfx_windowsdib.h
@@ -17,15 +17,12 @@
 #define WINDIB_OPEN_MEMORY 0x1
 #define WINDIB_OPEN_PATHNAME 0x2
 
-typedef struct WINDIB_Open_Args_ {
+struct WINDIB_Open_Args_ {
   int flags;
-
   const uint8_t* memory_base;
-
   size_t memory_size;
-
   const wchar_t* path_name;
-} WINDIB_Open_Args_;
+};
 
 class CFX_WindowsDIB : public CFX_DIBitmap {
  public: