From ea153a60fa3df3d6a53c07696c04ac6008c86339 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 4 Sep 2016 00:02:52 +0000 Subject: [PATCH] Switch libmve to C++ casts --- d2x-rebirth/libmve/decoder16.cpp | 10 +++++----- d2x-rebirth/libmve/decoder8.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/d2x-rebirth/libmve/decoder16.cpp b/d2x-rebirth/libmve/decoder16.cpp index 0aa0dcc7a..15b765e61 100644 --- a/d2x-rebirth/libmve/decoder16.cpp +++ b/d2x-rebirth/libmve/decoder16.cpp @@ -25,14 +25,14 @@ static void dispatchDecoder16(unsigned short **pFrame, unsigned char codeType, c void decodeFrame16(unsigned char *pFrame, const unsigned char *pMap, int mapRemain, const unsigned char *pData, int dataRemain) { unsigned short offset; - unsigned short *FramePtr = (unsigned short *)pFrame; + auto FramePtr = reinterpret_cast(pFrame); int length; int op; int i, j; int xb, yb; - backBuf1 = (unsigned short *)g_vBackBuf1; - backBuf2 = (unsigned short *)g_vBackBuf2; + backBuf1 = reinterpret_cast(g_vBackBuf1); + backBuf2 = reinterpret_cast(g_vBackBuf2); xb = g_width >> 3; yb = g_height >> 3; @@ -362,8 +362,8 @@ static void dispatchDecoder16(unsigned short **pFrame, unsigned char codeType, c --*pDataRemain; break; case 0x5: - x = (char)*(*pData)++; - y = (char)*(*pData)++; + x = static_cast(*(*pData)++); + y = static_cast(*(*pData)++); copyFrame(*pFrame, *pFrame + (backBuf2 - backBuf1) + x + y*g_width); *pDataRemain -= 2; break; diff --git a/d2x-rebirth/libmve/decoder8.cpp b/d2x-rebirth/libmve/decoder8.cpp index ee0aa13d7..bfa8d86f6 100644 --- a/d2x-rebirth/libmve/decoder8.cpp +++ b/d2x-rebirth/libmve/decoder8.cpp @@ -298,8 +298,8 @@ static void dispatchDecoder(unsigned char **pFrame, unsigned char codeType, cons as a signed 8-bit value, and the second being the y offset as a signed 8-bit value. */ - x = (signed char)*(*pData)++; - y = (signed char)*(*pData)++; + x = static_cast(*(*pData)++); + y = static_cast(*(*pData)++); copyFrame(*pFrame, *pFrame + (g_vBackBuf2 - g_vBackBuf1) + x + y*g_width); *pFrame += 8; *pDataRemain -= 2;