summaryrefslogtreecommitdiff
path: root/graphics/libjxr/files/patch-jxrlib_warnings
blob: 28b42db20a0659886f1bc1e98d8d78dff03276cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
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)