_BIG__ENDIAN__ should be spelled _BIG__ENDIAN_ (one _ too much). PR: 238502 Approved by: mi@ALDAN.algebra.com (maintainer), mat (mentor) Differential Revision: https://reviews.freebsd.org/D20620
175 lines
5.4 KiB
Text
175 lines
5.4 KiB
Text
Largely from https://archive.codeplex.com/?p=jxrlib (issue
|
|
https://archive.codeplex.com/projects/jxrlib/issues/13/1483483).
|
|
|
|
-mi
|
|
|
|
--- image/sys/strcodec.c 2013-03-20 19:16:21.000000000 +0100
|
|
+++ image/sys/strcodec.c 2015-09-03 10:30:31.018971760 +0200
|
|
@@ -668,9 +668,7 @@ ERR detach_SB(SimpleBitIO* pSB)
|
|
// WinCE ARM and Desktop x86
|
|
#else
|
|
// other platform
|
|
-#ifdef _BIG__ENDIAN_
|
|
-#define _byteswap_ulong(x) (x)
|
|
-#else // _BIG__ENDIAN_
|
|
+#ifndef _BIG__ENDIAN_
|
|
U32 _byteswap_ulong(U32 bits)
|
|
{
|
|
U32 r = (bits & 0xffu) << 24;
|
|
--- image/sys/strcodec.h 2013-03-21 19:22:34.000000000 +0100
|
|
+++ image/sys/strcodec.h 2015-09-03 10:30:31.019971779 +0200
|
|
@@ -64,7 +64,7 @@
|
|
|
|
#ifndef UNREFERENCED_PARAMETER
|
|
#define UNREFERENCED_PARAMETER(P) { (P) = (P); }
|
|
-#endif UNREFERENCED_PARAMETER
|
|
+#endif // UNREFERENCED_PARAMETER
|
|
|
|
#ifdef UNDER_CE
|
|
#define PLATFORM_WCE
|
|
@@ -673,6 +673,16 @@ void flushToByte(BitIOInfo* pIO);
|
|
pIO->cBitsUsed &= 16 - 1;\
|
|
pIO->uiAccumulator = LOAD16(pIO->pbCurrent) << pIO->cBitsUsed;\
|
|
return 0;
|
|
-// pIO->uiAccumulator = LOAD16(pIO->pbCurrent) & ((U32)(-1) >> pIO->cBitsUsed);\
|
|
|
|
void OutputPerfTimerReport(CWMImageStrCodec *pState);
|
|
+
|
|
+#if (defined(WIN32) && !defined(UNDER_CE)) || (defined(UNDER_CE) && defined(_ARM_))
|
|
+// WinCE ARM and Desktop x86
|
|
+#else
|
|
+// other platform
|
|
+#ifdef _BIG__ENDIAN_
|
|
+#define _byteswap_ulong(x) (x)
|
|
+#else // _BIG__ENDIAN_
|
|
+U32 _byteswap_ulong(U32 bits);
|
|
+#endif // _BIG__ENDIAN_
|
|
+#endif
|
|
\ No newline at end of file
|
|
--- jxrencoderdecoder/JxrDecApp.c 2013-05-08 18:45:08.000000000 +0200
|
|
+++ jxrencoderdecoder/JxrDecApp.c 2015-09-03 10:30:31.019971779 +0200
|
|
@@ -423,7 +423,7 @@ ERR WmpDecAppCreateEncoderFromExt(
|
|
Call(GetTestEncodeIID(szExt, &pIID));
|
|
|
|
// Create encoder
|
|
- Call(PKTestFactory_CreateCodec(pIID, ppIE));
|
|
+ Call(PKTestFactory_CreateCodec(pIID, (void**)ppIE));
|
|
|
|
Cleanup:
|
|
return err;
|
|
--- jxrgluelib/JXRGlueJxr.c 2013-03-20 20:01:13.000000000 +0100
|
|
+++ jxrgluelib/JXRGlueJxr.c 2015-09-03 10:30:31.021971818 +0200
|
|
@@ -28,6 +28,7 @@
|
|
//*@@@---@@@@******************************************************************
|
|
#include <limits.h>
|
|
#include <JXRGlue.h>
|
|
+#include <wchar.h>
|
|
|
|
|
|
static const char szHDPhotoFormat[] = "<dc:format>image/vnd.ms-photo</dc:format>";
|
|
--- jxrtestlib/JXRTest.c 2013-03-19 20:06:18.000000000 +0100
|
|
+++ jxrtestlib/JXRTest.c 2015-09-03 10:30:31.022971837 +0200
|
|
@@ -198,7 +198,7 @@ ERR PKTestFactory_CreateDecoderFromFile(
|
|
ERR err = WMP_errSuccess;
|
|
|
|
char *pExt = NULL;
|
|
- PKIID* pIID = NULL;
|
|
+ const PKIID* pIID = NULL;
|
|
|
|
struct WMPStream* pStream = NULL;
|
|
PKImageDecode* pDecoder = NULL;
|
|
@@ -214,7 +214,7 @@ ERR PKTestFactory_CreateDecoderFromFile(
|
|
Call(CreateWS_File(&pStream, szFilename, "rb"));
|
|
|
|
// Create decoder
|
|
- Call(PKTestFactory_CreateCodec(pIID, ppDecoder));
|
|
+ Call(PKTestFactory_CreateCodec(pIID, (void**)ppDecoder));
|
|
pDecoder = *ppDecoder;
|
|
|
|
// attach stream to decoder
|
|
@@ -232,7 +232,7 @@ ERR PKCreateTestFactory(PKCodecFactory**
|
|
|
|
UNREFERENCED_PARAMETER( uVersion );
|
|
|
|
- Call(PKAlloc(ppCFactory, sizeof(**ppCFactory)));
|
|
+ Call(PKAlloc((void**)ppCFactory, sizeof(**ppCFactory)));
|
|
pCFactory = *ppCFactory;
|
|
|
|
pCFactory->CreateCodec = PKTestFactory_CreateCodec;
|
|
@@ -287,7 +287,7 @@ ERR PKTestDecode_Release(
|
|
|
|
pID->fStreamOwner && pID->pStream->Close(&pID->pStream);
|
|
|
|
- return PKFree(ppID);
|
|
+ return PKFree((void**)ppID);
|
|
}
|
|
|
|
ERR PKTestDecode_Create(
|
|
@@ -296,7 +296,7 @@ ERR PKTestDecode_Create(
|
|
ERR err = WMP_errSuccess;
|
|
PKTestDecode* pID = NULL;
|
|
|
|
- Call(PKAlloc(ppID, sizeof(**ppID)));
|
|
+ Call(PKAlloc((void**)ppID, sizeof(**ppID)));
|
|
|
|
pID = *ppID;
|
|
pID->Initialize = PKTestDecode_Initialize;
|
|
--- jxrtestlib/JXRTestHdr.c 2013-03-20 17:40:08.000000000 +0100
|
|
+++ jxrtestlib/JXRTestHdr.c 2015-09-03 10:30:31.022971837 +0200
|
|
@@ -27,7 +27,7 @@
|
|
//*@@@---@@@@******************************************************************
|
|
#ifndef ANSI
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
-#endif ANSI
|
|
+#endif // ANSI
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
--- jxrtestlib/JXRTestPnm.c 2013-03-19 22:43:44.000000000 +0100
|
|
+++ jxrtestlib/JXRTestPnm.c 2015-09-03 10:30:31.023971856 +0200
|
|
@@ -27,7 +27,7 @@
|
|
//*@@@---@@@@******************************************************************
|
|
#ifndef ANSI
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
-#endif ANSI
|
|
+#endif // ANSI
|
|
|
|
#include <stdlib.h>
|
|
|
|
--- jxrtestlib/JXRTestTif.c 2013-03-19 20:17:12.000000000 +0100
|
|
+++ jxrtestlib/JXRTestTif.c 2015-09-03 10:30:31.023971856 +0200
|
|
@@ -909,8 +909,8 @@ ERR PKImageDecode_Release_TIF(PKTestDeco
|
|
|
|
PKTestDecode *pID = *ppID;
|
|
|
|
- Call(WMPFree(&pID->EXT.TIF.uStripOffsets));
|
|
- Call(WMPFree(&pID->EXT.TIF.uStripByteCounts));
|
|
+ Call(WMPFree((void**)&pID->EXT.TIF.uStripOffsets));
|
|
+ Call(WMPFree((void**)&pID->EXT.TIF.uStripByteCounts));
|
|
|
|
Call(PKTestDecode_Release(ppID));
|
|
|
|
--- image/sys/windowsmediaphoto.h 2019-03-03 17:25:20.300250000 -0500
|
|
+++ image/sys/windowsmediaphoto.h 2019-03-03 17:43:28.765568000 -0500
|
|
@@ -259,17 +259,15 @@
|
|
|
|
#define Call(exp) \
|
|
- if (Failed(err = (exp))) \
|
|
+ do if (Failed(err = (exp))) \
|
|
{ \
|
|
Report(err, #exp, __FILE__, (long)__LINE__); \
|
|
goto Cleanup; \
|
|
- } \
|
|
- else err = err
|
|
+ } while(0)
|
|
|
|
#define CallIgnoreError(errTmp, exp) \
|
|
- if (Failed(errTmp = (exp))) \
|
|
+ do if (Failed(errTmp = (exp))) \
|
|
{ \
|
|
Report(errTmp, #exp, __FILE__, (long)__LINE__); \
|
|
- } \
|
|
- else errTmp = errTmp
|
|
+ } while (0)
|
|
|
|
|