[Midnightbsd-cvs] mports [21540] trunk/graphics/libfpx: fix build

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Aug 5 20:54:18 EDT 2016


Revision: 21540
          http://svnweb.midnightbsd.org/mports/?rev=21540
Author:   laffer1
Date:     2016-08-05 20:54:17 -0400 (Fri, 05 Aug 2016)
Log Message:
-----------
fix build

Modified Paths:
--------------
    trunk/graphics/libfpx/Makefile

Added Paths:
-----------
    trunk/graphics/libfpx/files/patch-ebuffer
    trunk/graphics/libfpx/files/patch-null-casts
    trunk/graphics/libfpx/files/patch-unused-padding

Modified: trunk/graphics/libfpx/Makefile
===================================================================
--- trunk/graphics/libfpx/Makefile	2016-08-06 00:51:46 UTC (rev 21539)
+++ trunk/graphics/libfpx/Makefile	2016-08-06 00:54:17 UTC (rev 21540)
@@ -2,6 +2,7 @@
 
 PORTNAME=	libfpx
 DISTVERSION=	1.3.1-4
+PORTREVISION=	1
 CATEGORIES=	graphics
 MASTER_SITES=	http://imagemagick.mirrorcatalogs.com/delegates/	\
 		http://www.imagemagick.org/download/delegates/	\

Added: trunk/graphics/libfpx/files/patch-ebuffer
===================================================================
--- trunk/graphics/libfpx/files/patch-ebuffer	                        (rev 0)
+++ trunk/graphics/libfpx/files/patch-ebuffer	2016-08-06 00:54:17 UTC (rev 21540)
@@ -0,0 +1,126 @@
+This removes unused code from ebuffer -- some of that code never
+worked and now clang-3.8.0 issues a very valid warning about it...
+
+Some of the variables are made static, while I'm here. This code
+was never thread-safe either...
+
+	-mi
+
+--- jpeg/ebuffer.h	2013-09-02 11:45:00.000000000 -0400
++++ jpeg/ebuffer.h	2016-02-18 16:31:36.053668000 -0500
+@@ -22,26 +22,12 @@
+    long int buf_size);
+ JPEGEXPORT
+-void EB_Clear(unsigned char *buf, /* output buffer */
+-   long int buf_size);
+-JPEGEXPORT
+-void EB_Write_Bits_Init(unsigned char *buf, /* compressed bitstream buffer */
+-   long int buf_size);
+-JPEGEXPORT
+-void EB_Write_Bytes(unsigned char *data,
+-   int size);
++void EB_Write_Bytes(const void *data, size_t size);
+ JPEGEXPORT
+ long cEB_Byte_Count(void);
+ 
+ JPEGEXPORT
+-void EB_Copy_To_Memory(unsigned char *buf,
+-   unsigned char *mem,
+-   long int num);
+-JPEGEXPORT
+ void EB_End(long int *bytes);
+ 
+ JPEGEXPORT
+-void EB_Write_Bits_End(long int *bytes);
+-
+-JPEGEXPORT
+ int EB_Write_Bits(int val,
+ int nbits);
+--- jpeg/ebuffer.c	2013-09-02 11:45:00.000000000 -0400
++++ jpeg/ebuffer.c	2016-02-18 16:32:03.964436000 -0500
+@@ -24,9 +24,9 @@
+ 
+ /****************************** GLOBAL VARIABLES **************************/
+-unsigned char *eb_ptr;      /* points to next avaible byte in output buffer */
+-unsigned char eb_byte;      /* current output byte to be inserted into buffer */
+-int eb_nbits;               /* # bits available in *eb_ptr */
+-unsigned char *eb_end_ptr, *eb_start_ptr;
+-long int eb_byte_count;
++static unsigned char *eb_ptr;      /* points to next avaible byte in output buffer */
++static unsigned char eb_byte;      /* current output byte to be inserted into buffer */
++static int eb_nbits;               /* # bits available in *eb_ptr */
++static unsigned char *eb_end_ptr, *eb_start_ptr;
++static long int eb_byte_count;
+ 
+ void EB_Init(unsigned char *buf, /* output buffer */
+@@ -40,31 +40,7 @@
+ }
+ 
+-void EB_Clear(unsigned char *buf, /* output buffer */
+-long int buf_size)
+-{
+-  unsigned char *eb_ptr, *eb_end_ptr;
+-
+-  eb_end_ptr = buf + buf_size;
+-  for (eb_ptr = buf; eb_ptr < eb_end_ptr ;*eb_ptr++ = 0)
+-    eb_byte = 0;
+-  eb_nbits = 8;
+-  eb_byte_count = 0;
+-}
+-
+-void EB_Write_Bits_Init(unsigned char *buf, /* compressed bitstream buffer */
+-long int buf_size)
+-{
+-  eb_ptr = eb_start_ptr = buf;
+-  eb_end_ptr = buf + buf_size;
+-  eb_byte = 0;
+-  eb_nbits = 8;
+-  eb_byte_count = 0;
+-}
+-
+-void EB_Write_Bytes(unsigned char *data,
+-int size)
++void
++EB_Write_Bytes(const void *data, size_t size)
+ {
+-  int i;
+-  unsigned char *ptr;
+ 
+   /* byte-align previous bits if any */
+@@ -74,24 +50,5 @@
+     if (eb_byte == 0xff) *eb_ptr++ = 0x00; /* byte stuffing */
+   }
+-  for (i=0, ptr=data; i < size ;i++) {
+-    *eb_ptr++ = *ptr++;
+-  }
+-}
+-
+-/* calculates the actual number of bytes written into output buffer */
+-long cEB_Byte_Count(void)
+-{
+-  return((long)(eb_ptr - eb_start_ptr));
+-}
+-
+-void EB_Copy_To_Memory(unsigned char *buf,
+-unsigned char *mem,
+-long int num)
+-{
+-  long int i;
+-  unsigned char *mem_ptr,*buf_ptr;
+-
+-  for(i=0,mem_ptr=mem,buf_ptr=buf; i < num ;*mem_ptr++=*buf_ptr++);
+-
++  memcpy(eb_ptr, data, size);
+ }
+ 
+@@ -102,10 +59,4 @@
+ }
+ 
+-/* calculates the actual number of bytes written into output buffer */
+-void EB_Write_Bits_End(long int *bytes)
+-{
+-  *bytes = eb_ptr - eb_start_ptr;
+-}
+-
+ /*
+  * Write 'nbits' bits of 'val' to the output buffer.


Property changes on: trunk/graphics/libfpx/files/patch-ebuffer
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/graphics/libfpx/files/patch-null-casts
===================================================================
--- trunk/graphics/libfpx/files/patch-null-casts	                        (rev 0)
+++ trunk/graphics/libfpx/files/patch-null-casts	2016-08-06 00:54:17 UTC (rev 21540)
@@ -0,0 +1,23 @@
+--- oless/expdf.cxx	2013-09-02 11:47:00.000000000 -0400
++++ oless/expdf.cxx	2014-02-14 14:29:24.000000000 -0500
+@@ -610,5 +610,5 @@
+         olErr(EH_Err, STG_E_INVALIDFUNCTION);
+     olChk(Validate());
+-    if (snbExclude != NULL)
++    if (snbExclude != 0)
+         olErr(EH_Err, STG_E_INVALIDPARAMETER);
+     olChk(OpenEntry(pwcsName, STGTY_STORAGE, grfMode, (void **)&pdfExp));
+@@ -909,5 +909,5 @@
+     sc = OpenStorage(pwcsName, (IStorage*)NULL,
+                      STGM_DIRECT| STGM_READ| STGM_SHARE_EXCLUSIVE,
+-                     (SNBW)NULL, (DWORD)NULL, &pstgsrc);
++                     0, 0, &pstgsrc);
+ 
+     if (SUCCEEDED(sc))
+@@ -951,5 +951,5 @@
+         olChk(OpenStream(pwcsName, (void *)NULL,
+                          STGM_DIRECT | STGM_READ | STGM_SHARE_EXCLUSIVE,
+-                         (DWORD)NULL, &pstmsrc));
++                         0, &pstmsrc));
+ 
+         //  It's a stream


Property changes on: trunk/graphics/libfpx/files/patch-null-casts
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/graphics/libfpx/files/patch-unused-padding
===================================================================
--- trunk/graphics/libfpx/files/patch-unused-padding	                        (rev 0)
+++ trunk/graphics/libfpx/files/patch-unused-padding	2016-08-06 00:54:17 UTC (rev 21540)
@@ -0,0 +1,15 @@
+The padding is important (earlier versions tried to remove it leading to peril),
+but clang++ complains about it. Mark it as __unused to prevent that...
+--- oless/h/dir.hxx	2014-02-12 08:14:24.000000000 -0500
++++ oless/h/dir.hxx	2014-02-14 11:36:59.000000000 -0500
+@@ -142,5 +142,9 @@
+     inline void  SetBitFlags(BYTE bValue, BYTE bMask);
+ 
+-    BYTE  _bpad[CBDIRPAD];  // do not remove, bad things will happen!
++    BYTE  _bpad[CBDIRPAD]	// do not remove, bad things will happen!
++#ifdef __clang__
++	__unused
++#endif
++	;	 
+ };
+ 


Property changes on: trunk/graphics/libfpx/files/patch-unused-padding
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list