From 62a70f90c49cf7714c960186eb063ad55333e6f3 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 21 Mar 2016 15:00:20 -0700 Subject: Remove FX_WORD in favor of uint16_t. It isn't buying us anthing, and it looks strange in a struct when other uint types are already present. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1821043003 . --- core/fxcodec/codec/fx_codec_flate.cpp | 4 ++-- core/fxcodec/codec/fx_codec_tiff.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'core/fxcodec/codec') diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp index 27416f1c67..d4ad241a4d 100644 --- a/core/fxcodec/codec/fx_codec_flate.cpp +++ b/core/fxcodec/codec/fx_codec_flate.cpp @@ -530,7 +530,7 @@ void TIFF_PredictorEncodeLine(uint8_t* dest_buf, } else { for (int i = row_size - BytesPerPixel; i >= BytesPerPixel; i -= BytesPerPixel) { - FX_WORD pixel = (dest_buf[i] << 8) | dest_buf[i + 1]; + uint16_t pixel = (dest_buf[i] << 8) | dest_buf[i + 1]; pixel -= (dest_buf[i - BytesPerPixel] << 8) | dest_buf[i - BytesPerPixel + 1]; dest_buf[i] = pixel >> 8; @@ -587,7 +587,7 @@ void TIFF_PredictLine(uint8_t* dest_buf, int BytesPerPixel = BitsPerComponent * Colors / 8; if (BitsPerComponent == 16) { for (FX_DWORD i = BytesPerPixel; i < row_size; i += 2) { - FX_WORD pixel = + uint16_t pixel = (dest_buf[i - BytesPerPixel] << 8) | dest_buf[i - BytesPerPixel + 1]; pixel += (dest_buf[i] << 8) | dest_buf[i + 1]; dest_buf[i] = pixel >> 8; diff --git a/core/fxcodec/codec/fx_codec_tiff.cpp b/core/fxcodec/codec/fx_codec_tiff.cpp index 0312622fb4..58f08707cb 100644 --- a/core/fxcodec/codec/fx_codec_tiff.cpp +++ b/core/fxcodec/codec/fx_codec_tiff.cpp @@ -285,11 +285,11 @@ FX_BOOL CCodec_TiffContext::LoadFrameInfo(int32_t frame, if (!TIFFSetDirectory(tif_ctx, (uint16)frame)) { return FALSE; } - FX_WORD tif_cs; + uint16_t tif_cs; FX_DWORD tif_icc_size = 0; uint8_t* tif_icc_buf = NULL; - FX_WORD tif_bpc = 0; - FX_WORD tif_cps; + uint16_t tif_bpc = 0; + uint16_t tif_cps; FX_DWORD tif_rps; width = height = comps = 0; TIFFGetField(tif_ctx, TIFFTAG_IMAGEWIDTH, &width); @@ -306,7 +306,7 @@ FX_BOOL CCodec_TiffContext::LoadFrameInfo(int32_t frame, &pAttribute->m_wDPIUnit)) { pAttribute->m_wDPIUnit -= 1; } - Tiff_Exif_GetInfo(tif_ctx, TIFFTAG_ORIENTATION, pAttribute); + Tiff_Exif_GetInfo(tif_ctx, TIFFTAG_ORIENTATION, pAttribute); if (Tiff_Exif_GetInfo(tif_ctx, TIFFTAG_XRESOLUTION, pAttribute)) { void* val = pAttribute->m_Exif[TIFFTAG_XRESOLUTION]; FX_FLOAT fDpi = val ? *reinterpret_cast(val) : 0; @@ -487,7 +487,7 @@ FX_BOOL CCodec_TiffContext::Decode(CFX_DIBitmap* pDIBitmap) { return FALSE; } if (pDIBitmap->GetBPP() == 32) { - FX_WORD rotation = ORIENTATION_TOPLEFT; + uint16_t rotation = ORIENTATION_TOPLEFT; TIFFGetField(tif_ctx, TIFFTAG_ORIENTATION, &rotation); if (TIFFReadRGBAImageOriented(tif_ctx, img_wid, img_hei, (uint32*)pDIBitmap->GetBuffer(), rotation, -- cgit v1.2.3