[XviD-devel] [PATCH] New try at gcc4 warning cleaning + SO symbols visibility

Edouard Gomez ed.gomez at free.fr
Fri May 20 00:51:38 CEST 2005


Hey,

New attempt at pushing my branch changes. I fixed xvid_bench linking
very simply, just link against static lib.

Here are the additional changelog entries that do not concern gcc4
warnings + symbols visibility for SO.

------------------------------8<-----------------------------------
2005-05-18 22:08:12 GMT	                                	patch-22

    Summary:
      No executable shared objects installed
    Revision:
      xvidcore--head--0.0--patch-22

    From ed.gomez:
     * Do not install the lib as executable. It's no use as the SO has no
       main symbol anyway, and the static lib is not runnable anyway.

    modified files:
     build/generic/Makefile


2005-05-18 22:05:09 GMT	                                	patch-21

    Summary:
      Statically link xvid_bench with libxvidcore.a
    Revision:
      xvidcore--head--0.0--patch-21

    Statically link xvid_bench with libxvidcore.a
    

    modified files:
     examples/Makefile


2005-05-18 21:59:27 GMT	                                	patch-20

    Summary:
      New autoconf garbage removal
    Revision:
      xvidcore--head--0.0--patch-20

    New autoconf garbage removal
    

    modified files:
     build/generic/bootstrap.sh


2005-05-18 21:58:16 GMT	                                	patch-19

    Summary:
      Quotes in configure.in
    Revision:
      xvidcore--head--0.0--patch-19

    Quotes in configure.in
    

    modified files:
     build/generic/configure.in
------------------------------8<-----------------------------------

The only chunks that could hurt are the last two ones, the trellis
chunk is 99.99% ok as i tested it in two clips and md5sum matched.

The ME chunk has probably not been tested or has been tested during
first pass when fast ME routines are used instead of usual ones, so
i didn't check for 1:1 compatibility.

So please review these two chunks more than i did, other chunks
should be merged.

The patch inlined:
------------------------------8<-----------------------------------
--- xvidcore.cvshead/build/generic/bootstrap.sh	2005-03-18 17:44:51.000000000 +0100
+++ xvidcore.tlahead/build/generic/bootstrap.sh	2005-05-18 23:58:51.000000000 +0200
@@ -80,3 +80,4 @@
 echo "Removing files that are not needed"
 rm -rf autom4* 1>/dev/null 2>&1 
 rm -rf ltmain.sh 1>/dev/null 2>&1 
+rm -rf *.m4 1>/dev/null 2>&1
\ Pas de fin de ligne à la fin du fichier.
--- xvidcore.cvshead/build/generic/configure.in	2005-05-18 21:08:36.000000000 +0200
+++ xvidcore.tlahead/build/generic/configure.in	2005-05-18 23:56:56.000000000 +0200
@@ -265,7 +265,14 @@
 SPECIFIC_CFLAGS=""
 PRE_SHARED_LIB=""
 case "$target_os" in
-     *bsd*|linux*|irix*|solaris*)
+     linux*|solaris*)
+	AC_MSG_RESULT([ok])
+	STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
+	SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)"
+	SPECIFIC_LDFLAGS="-Wl,-soname,libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR) -shared -Wl,--version-script=libxvidcore.ld -lc -lm"
+	SPECIFIC_CFLAGS="-fPIC"
+	;;
+     *bsd*|irix*)
 	AC_MSG_RESULT([ok])
 	STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
 	SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)"
@@ -588,7 +595,7 @@
 	rm -f gcc-ver
 
 	# GCC 4.x
-	if test $GCC_MAJOR -gt 3 ; then
+	if test "${GCC_MAJOR}" -gt 3 ; then
 		CFLAGS=`echo $CFLAGS | sed s,"-mcpu","-mtune",g`
 		CFLAGS=`echo $CFLAGS | sed s,'-freduce-all-givs','',g`
 		CFLAGS=`echo $CFLAGS | sed s,'-fmove-all-movables','',g`
@@ -597,7 +604,7 @@
 	fi
 
 	# GCC 3.4.x
-	if test $GCC_MAJOR -eq 3 && $GCC_MINOR -gt 3 ; then
+	if test "${GCC_MAJOR}" -eq 3 && test "${GCC_MINOR}" -gt 3 ; then
 		CFLAGS=`echo $CFLAGS | sed s,"-mcpu","-mtune",g`
 	fi
 fi
--- xvidcore.cvshead/build/generic/Makefile	2005-03-18 17:44:51.000000000 +0100
+++ xvidcore.tlahead/build/generic/Makefile	2005-05-19 00:06:32.000000000 +0200
@@ -129,6 +129,7 @@
 $(SHARED_LIB): $(BUILD_DIR) $(OBJECTS)
 	@echo "  L: $(@F)"
 	@$(INSTALL) -m 644 libxvidcore.def $(BUILD_DIR)/libxvidcore.def
+	@$(INSTALL) -m 644 libxvidcore.ld $(BUILD_DIR)/libxvidcore.ld
 	@cd $(BUILD_DIR) && $(CC) $(LDFLAGS) $(OBJECTS) -o $(PRE_SHARED_LIB) $(SPECIFIC_LDFLAGS)
 
 #-----------------------------------------------------------------------------
@@ -139,9 +140,9 @@
 	@echo "  D: $(libdir)"
 	@$(INSTALL) -d $(DESTDIR)$(libdir)
 	@echo "  I: $(libdir)/$(SHARED_LIB)"
-	@$(INSTALL) -m 755 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(libdir)/$(SHARED_LIB)
+	@$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(libdir)/$(SHARED_LIB)
 	@echo "  I: $(libdir)/$(STATIC_LIB)"
-	@$(INSTALL) -m 755 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB)
+	@$(INSTALL) -m 644 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB)
 	@echo "  D: $(includedir)"
 	@$(INSTALL) -d $(DESTDIR)$(includedir)
 	@echo "  I: $(includedir)/xvid.h"
--- xvidcore.cvshead/examples/Makefile	2005-03-18 17:44:51.000000000 +0100
+++ xvidcore.tlahead/examples/Makefile	2005-05-19 00:03:52.000000000 +0200
@@ -31,7 +31,7 @@
 	$(CC) $(CFLAGS) $(HDIR) -c $<
 
 xvid_bench: xvid_bench.o
-	$(CC) -o $@ $< $(LDFLAGS) 
+	$(CC) -o $@ $< ../build/generic/=build/libxvidcore.a -lc -lm
 
 xvid_bench.o: xvid_bench.c
 	$(CC) $(CFLAGS) $(HDIR) -c $<
--- xvidcore.cvshead/src/bitstream/bitstream.c	2005-05-18 21:08:36.000000000 +0200
+++ xvidcore.tlahead/src/bitstream/bitstream.c	2005-05-18 21:33:10.000000000 +0200
@@ -1259,7 +1259,7 @@
 	BitstreamPadAlways(bs); /* next_start_code(); */
 
 	/* divx5 userdata string */
-#define DIVX5_ID "DivX503b1393"
+#define DIVX5_ID ((char *)"DivX503b1393")
   if ((pParam->global_flags & XVID_GLOBAL_DIVX5_USERDATA)) {
     BitstreamWriteUserData(bs, DIVX5_ID, strlen(DIVX5_ID));
   	if (pParam->max_bframes > 0 && (pParam->global_flags & XVID_GLOBAL_PACKED))
@@ -1395,8 +1395,8 @@
 
 void
 BitstreamWriteUserData(Bitstream * const bs,
-						uint8_t * data,
-						const int length)
+						const char *data,
+						const unsigned int length)
 {
 	int i;
 
--- xvidcore.cvshead/src/bitstream/bitstream.h	2005-05-18 21:08:36.000000000 +0200
+++ xvidcore.tlahead/src/bitstream/bitstream.h	2005-05-18 21:32:03.000000000 +0200
@@ -146,8 +146,9 @@
 							 unsigned int quant);
 
 void BitstreamWriteUserData(Bitstream * const bs,
-							uint8_t * data,
-							const int length);
+							const char *data,
+							const unsigned int length);
+
 void
 BitstreamWriteEndOfSequence(Bitstream * const bs);
 
--- xvidcore.cvshead/src/decoder.c	2005-05-18 21:08:36.000000000 +0200
+++ xvidcore.tlahead/src/decoder.c	2005-05-18 21:21:14.000000000 +0200
@@ -1123,7 +1123,7 @@
 			MACROBLOCK *mb = &dec->mbs[y * dec->mb_width + x];
 			MACROBLOCK *last_mb = &dec->last_mbs[y * dec->mb_width + x];
 			const int fcode_max = (fcode_forward>fcode_backward) ? fcode_forward : fcode_backward;
-			uint32_t intra_dc_threshold; /* fake variable */
+			int32_t intra_dc_threshold; /* fake variable */
 
 			if (check_resync_marker(bs, fcode_max  - 1)) {
 				int bound = read_video_packet_header(bs, dec, fcode_max - 1, &quant,
--- xvidcore.cvshead/src/encoder.c	2005-04-03 21:40:52.000000000 +0200
+++ xvidcore.tlahead/src/encoder.c	2005-05-11 23:06:19.000000000 +0200
@@ -114,8 +114,8 @@
 		}
 		
 		div = ((float)*biggest)/((float)65535);
-		*biggest = (int)(((float)*biggest)/div);
-		*other = (int)(((float)*other)/div);
+		*biggest = (unsigned int)(((float)*biggest)/div);
+		*other = (unsigned int)(((float)*other)/div);
 	}
 }
 
@@ -161,7 +161,7 @@
 	pEnc->mbParam.fincr = MAX(create->fincr, 0);
 	pEnc->mbParam.fbase = create->fincr <= 0 ? 25 : create->fbase;
 	if (pEnc->mbParam.fincr>0)
-		simplify_time(&pEnc->mbParam.fincr, &pEnc->mbParam.fbase);
+		simplify_time((int*)&pEnc->mbParam.fincr, (int*)&pEnc->mbParam.fbase);
 
 	/* zones */
 	if(create->num_zones > 0) {
@@ -1155,7 +1155,7 @@
 	type = frame->type;
 	pEnc->current->quant = frame->quant;
 
-	call_plugins(pEnc, pEnc->current, NULL, XVID_PLG_BEFORE, &type, &pEnc->current->quant, stats);
+	call_plugins(pEnc, pEnc->current, NULL, XVID_PLG_BEFORE, &type, (int*)&pEnc->current->quant, stats);
 
 	if (type > 0){ 	/* XVID_TYPE_?VOP */
 		type = type2coding(type);	/* convert XVID_TYPE_?VOP to bitstream coding type */
--- xvidcore.cvshead/src/image/image.c	2005-03-18 17:44:53.000000000 +0100
+++ xvidcore.tlahead/src/image/image.c	2005-05-11 23:06:19.000000000 +0200
@@ -717,7 +717,7 @@
 			 int height,
 			 uint32_t edged_width,
 			 uint8_t * dst[4],
-			 uint32_t dst_stride[4],
+			 int dst_stride[4],
 			 int csp,
 			 int interlacing)
 {
--- xvidcore.cvshead/src/image/image.h	2005-03-18 17:44:53.000000000 +0100
+++ xvidcore.tlahead/src/image/image.h	2005-05-11 23:06:19.000000000 +0200
@@ -108,7 +108,7 @@
 				 int height,
 				 uint32_t edged_width,
 				 uint8_t * dst[4],
-				 uint32_t dst_stride[4],
+				 int dst_stride[4],
 				 int csp,
 				 int interlaced);
 
--- xvidcore.cvshead/build/generic/libxvidcore.ld	2005-05-20 00:32:06.471757096 +0200
+++ xvidcore.tlahead/build/generic/libxvidcore.ld	2005-05-11 23:07:34.000000000 +0200
@@ -0,0 +1,13 @@
+{
+	global:
+		xvid_global; 
+		xvid_decore; 
+		xvid_encore; 
+		xvid_plugin_single;
+		xvid_plugin_2pass1;
+		xvid_plugin_2pass2;
+		xvid_plugin_lumimasking; 
+		xvid_plugin_dump; 
+		xvid_plugin_psnr; 
+	local: *;
+};
--- xvidcore.cvshead/src/motion/estimation_common.c	2005-03-18 17:44:53.000000000 +0100
+++ xvidcore.tlahead/src/motion/estimation_common.c	2005-05-11 23:06:19.000000000 +0200
@@ -389,8 +389,8 @@
 
 	int xo = 2*data->currentMV[0].x, yo = 2*data->currentMV[0].y;
 	
-	data->currentQMV[0].x = v_best.x = xo;
-	data->currentQMV[0].y = v_best.y = yo;
+	data->currentQMV[0].x = v_best.x = v_best2.x = xo;
+	data->currentQMV[0].y = v_best.y = v_best2.y = yo;
 
 	data->qpel_precision = 1;
 
--- xvidcore.cvshead/src/utils/mbtransquant.c	2005-03-18 17:44:54.000000000 +0100
+++ xvidcore.tlahead/src/utils/mbtransquant.c	2005-05-11 23:06:19.000000000 +0200
@@ -774,7 +774,7 @@
 	 * helps. */
 	typedef struct { int16_t Run, Level; } NODE;
 
-	NODE Nodes[65], Last;
+	NODE Nodes[65], Last = { 0, 0};
 	uint32_t Run_Costs0[64+1];
 	uint32_t * const Run_Costs = Run_Costs0 + 1;
 

------------------------------8<-----------------------------------
-- 
Edouard Gomez


More information about the XviD-devel mailing list