From c2ae41abd16aef062fee878160aa18457d2118a7 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Mon, 2 Oct 2017 16:04:37 -0400 Subject: Replace GetWord_LSBFirst with FXWORD_GET_LSBFIRST The existing implementation of a LSB first word method was incorrect, in addition it was implemented to the BMP code, but also used in the GIF code. Thus is should be moved to a common location. Also added in an implementation for FXWORD_GET_MSBFIRST, since the GIF code will need this. BUG=pdfium:914 Change-Id: I0e84813356fbd456b293a190da3c2cde01a6580b Reviewed-on: https://pdfium-review.googlesource.com/15210 Reviewed-by: Tom Sepez Reviewed-by: dsinclair Commit-Queue: Ryan Harrison --- core/fxcrt/fx_system.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/fxcrt') diff --git a/core/fxcrt/fx_system.h b/core/fxcrt/fx_system.h index 8e2957bc98..eb07ebde00 100644 --- a/core/fxcrt/fx_system.h +++ b/core/fxcrt/fx_system.h @@ -199,6 +199,12 @@ wchar_t* FXSYS_wcsupr(wchar_t* str); #define FXSYS_wcsftime wcsftime #endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ +#define FXWORD_GET_LSBFIRST(p) \ + (static_cast((static_cast(p[1]) << 8) | \ + (static_cast(p[0])))) +#define FXWORD_GET_MSBFIRST(p) \ + (static_cast((static_cast(p[0]) << 8) | \ + (static_cast(p[1])))) #define FXDWORD_GET_LSBFIRST(p) \ ((static_cast(p[3]) << 24) | (static_cast(p[2]) << 16) | \ (static_cast(p[1]) << 8) | (static_cast(p[0]))) -- cgit v1.2.3