svn commit: r494530 - in head/graphics/libjxr: . files

Mikhail Teterin mi at FreeBSD.org
Sun Mar 3 23:00:40 UTC 2019


Author: mi
Date: Sun Mar  3 23:00:38 2019
New Revision: 494530
URL: https://svnweb.freebsd.org/changeset/ports/494530

Log:
  Fix handling of (some of) the warnings, by fixing them
  at the sources, rather than disabling them on command-line.
  
  The disabling was not working with gcc.
  
  PR:		236018
  Submitted by:	Piotr Kubaj

Added:
  head/graphics/libjxr/files/patch-jxrlib_warnings   (contents, props changed)
Modified:
  head/graphics/libjxr/Makefile
  head/graphics/libjxr/files/BSDmakefile.JxrDecApp
  head/graphics/libjxr/files/BSDmakefile.JxrEncApp
  head/graphics/libjxr/files/BSDmakefile.jxrgluelib
  head/graphics/libjxr/files/BSDmakefile.libjpegxr

Modified: head/graphics/libjxr/Makefile
==============================================================================
--- head/graphics/libjxr/Makefile	Sun Mar  3 22:33:55 2019	(r494529)
+++ head/graphics/libjxr/Makefile	Sun Mar  3 23:00:38 2019	(r494530)
@@ -12,10 +12,6 @@ COMMENT=	Library for JPEG XR, a.k.a. Windows MediaTM P
 
 LICENSE=	BSD2CLAUSE
 
-BROKEN_mips=		fails to compile: cc1: unrecognized command line option "-Wno-extra-tokens"
-BROKEN_mips64=		fails to compile: cc1: unrecognized command line option "-Wno-extra-tokens"
-BROKEN_powerpc64=	fails to compile: cc1: unrecognized command line option "-Wno-extra-tokens"
-
 USES=		dos2unix uidfix
 USE_LDCONFIG=	yes
 MAKEFILE=	BSDmakefile	# created by do-configure

Modified: head/graphics/libjxr/files/BSDmakefile.JxrDecApp
==============================================================================
--- head/graphics/libjxr/files/BSDmakefile.JxrDecApp	Sun Mar  3 22:33:55 2019	(r494529)
+++ head/graphics/libjxr/files/BSDmakefile.JxrDecApp	Sun Mar  3 23:00:38 2019	(r494530)
@@ -5,7 +5,7 @@ MANDIR=	${MANPREFIX}/man/man
 
 CFLAGS=	-I${.CURDIR:H}/jxrgluelib -I${.CURDIR:H}/jxrtestlib
 CFLAGS+=-I${.CURDIR:H}/image/sys -I${.CURDIR:H}/common/include
-CFLAGS+=-Wno-extra-tokens -D__ANSI__ -DDISABLE_PERF_MEASUREMENT
+CFLAGS+=-D__ANSI__ -DDISABLE_PERF_MEASUREMENT
 
 LDADD=	-L${.CURDIR:H}/jxrgluelib -Wl,-rpath-link=${.CURDIR:H}/libjpegxr -ljxrglue
 

Modified: head/graphics/libjxr/files/BSDmakefile.JxrEncApp
==============================================================================
--- head/graphics/libjxr/files/BSDmakefile.JxrEncApp	Sun Mar  3 22:33:55 2019	(r494529)
+++ head/graphics/libjxr/files/BSDmakefile.JxrEncApp	Sun Mar  3 23:00:38 2019	(r494530)
@@ -5,7 +5,7 @@ MANDIR=	${MANPREFIX}/man/man
 
 CFLAGS=	-I${.CURDIR:H}/jxrgluelib -I${.CURDIR:H}/jxrtestlib
 CFLAGS+=-I${.CURDIR:H}/image/sys -I${.CURDIR:H}/common/include
-CFLAGS+=-Wno-extra-tokens -D__ANSI__ -DDISABLE_PERF_MEASUREMENT
+CFLAGS+=-D__ANSI__ -DDISABLE_PERF_MEASUREMENT
 
 LDADD=	-L${.CURDIR:H}/jxrgluelib -Wl,-rpath-link=${.CURDIR:H}/libjpegxr -ljxrglue
 

Modified: head/graphics/libjxr/files/BSDmakefile.jxrgluelib
==============================================================================
--- head/graphics/libjxr/files/BSDmakefile.jxrgluelib	Sun Mar  3 22:33:55 2019	(r494529)
+++ head/graphics/libjxr/files/BSDmakefile.jxrgluelib	Sun Mar  3 23:00:38 2019	(r494530)
@@ -14,7 +14,6 @@ SRCS+=	JXRTest.c JXRTestBmp.c JXRTestHdr.c JXRTestPnm.
 CFLAGS+=	-I. -I${.CURDIR:H}/common/include -I${.CURDIR:H}/image/sys
 CFLAGS+=	-I${.CURDIR:H}/jxrtestlib
 CFLAGS+=	-D__ANSI__ -DDISABLE_PERF_MEASUREMENT
-CFLAGS+=	-Wno-extra-tokens
 
 LDADD=	-L${.CURDIR:H}/libjpegxr -ljpegxr -lm
 

Modified: head/graphics/libjxr/files/BSDmakefile.libjpegxr
==============================================================================
--- head/graphics/libjxr/files/BSDmakefile.libjpegxr	Sun Mar  3 22:33:55 2019	(r494529)
+++ head/graphics/libjxr/files/BSDmakefile.libjpegxr	Sun Mar  3 23:00:38 2019	(r494530)
@@ -16,6 +16,5 @@ SRCS=		encode.c segenc.c strenc.c strFwdTransform.c st
 
 CFLAGS+=	-I. -I${.CURDIR:H}/common/include -I${.CURDIR:H}/image/sys
 CFLAGS+=	-D__ANSI__ -DDISABLE_PERF_MEASUREMENT
-CFLAGS+=	-Wno-extra-tokens
 
 .include <bsd.lib.mk>

Added: head/graphics/libjxr/files/patch-jxrlib_warnings
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/libjxr/files/patch-jxrlib_warnings	Sun Mar  3 23:00:38 2019	(r494530)
@@ -0,0 +1,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)
+ 
+ 


More information about the svn-ports-all mailing list