[Mplayer-dev-eng] mplayer-cvs doesn't compile with gcc-3.0 (debian sid) + patch

p_l at NOSPAM.tfz.net p_l at NOSPAM.tfz.net
Fri Jun 8 00:32:12 CEST 2001


Hi,

I've had a few troubles with compiling mplayer-cvs with
gcc/g++-3.0 (the one shipping with debian unstable aka
gcc version 3.0 20010526 (Debian prerelease) & GNU 
assembler 2.11.90.0.7)


Here is a 2-cent patch for today's cvs.

Fixes :
 - a few cpp warning for "no \n at the e-o-f"
 - a few missing std:: that breaks compilation
 - there's also a patch on main/libac3/mmx/imdct_3dnow.c
   that avoids breaking compilation on a k7 (but i don't
   know if it's correct though it works for me :)



--- patch starts ---
diff -ru main/libac3/decode.c main2/libac3/decode.c
--- main/libac3/decode.c	Wed May 23 10:20:16 2001
+++ main2/libac3/decode.c	Thu Jun  7 19:37:52 2001
@@ -157,21 +157,15 @@
 	imdct_init();
 	sanity_check_init(&syncinfo,&bsi,&audblk);
 	decode_mute();
-	printf("!! libac3: using "
-#ifdef HAVE_SSE
-	       "SSE"
+#if defined(HAVE_SSE)
+	printf("!! libac3: using SSE optimization\n");
+#elif defined(HAVE_3DNOWEX)
+	printf("!! libac3: using 3dNow-dsp! optimization\n");
+#elif defined(HAVE_3DNOW)
+	printf("!! libac3: using 3dNow! optimization\n");
 #else
-#ifdef HAVE_3DNOWEX
-	       "3dNow-dsp!"
-#else
-#ifdef HAVE_3DNOW
-		"3dNow!"
-#else
-		"FPU"
-#endif
-#endif
+	printf("!! libac3: using FPU optimization\n");
 #endif
-		" optimization\n");
 }
 
 static ac3_frame_t ac3_frame;
diff -ru main/libac3/mmx/imdct_3dnow.c main2/libac3/mmx/imdct_3dnow.c
--- main/libac3/mmx/imdct_3dnow.c	Thu May 31 19:58:56 2001
+++ main2/libac3/mmx/imdct_3dnow.c	Thu Jun  7 19:42:12 2001
@@ -125,7 +125,7 @@
 		"movq %%mm0, %0"
 #endif
 		:"=m"(buf[i])
-		:"0"(buf[i]),"m"(xcos1[i]),"m"(xsin1[i])
+		:"m"(buf[i]),"m"(xcos1[i]),"m"(xsin1[i])
 		:"memory");
 /*		ac3_buf[i].re =(tmp_a_r * ac3_xcos1[i])  +  (tmp_a_i  * ac3_xsin1[i]);
 		ac3_buf[i].im =(tmp_a_r * ac3_xsin1[i])  -  (tmp_a_i  * ac3_xcos1[i]);*/
diff -ru main/libvo/osd.h main2/libvo/osd.h
--- main/libvo/osd.h	Sat Jun  2 18:01:58 2001
+++ main2/libvo/osd.h	Thu Jun  7 19:34:13 2001
@@ -14,4 +14,5 @@
 extern void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride);
 extern void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride);
 
-#endif
\ No newline at end of file
+#endif
+
diff -ru main/loader/DirectShow/DS_AudioDec.cpp main2/loader/DirectShow/DS_AudioDec.cpp
--- main/loader/DirectShow/DS_AudioDec.cpp	Thu Mar 22 02:55:53 2001
+++ main2/loader/DirectShow/DS_AudioDec.cpp	Thu Jun  7 19:42:12 2001
@@ -68,9 +68,9 @@
 {
 
     m_sVhdr=new char[18+wf->cbSize];
-    memcpy(m_sVhdr, wf, 18+wf->cbSize);
+    std::memcpy(m_sVhdr, wf, 18+wf->cbSize);
     m_sVhdr2=new char[18];
-    memcpy(m_sVhdr2, m_sVhdr, 18);
+    std::memcpy(m_sVhdr2, m_sVhdr, 18);
     WAVEFORMATEX* pWF=(WAVEFORMATEX*)m_sVhdr2;
     pWF->wFormatTag=1;
     pWF->wBitsPerSample=16;
@@ -78,7 +78,7 @@
     pWF->cbSize=0;
     in_fmt=*wf;
 
-    memset(&m_sOurType, 0, sizeof m_sOurType);
+    std::memset(&m_sOurType, 0, sizeof m_sOurType);
     m_sOurType.majortype=MEDIATYPE_Audio;
     m_sOurType.subtype=MEDIASUBTYPE_PCM;
     m_sOurType.subtype.f1=wf->wFormatTag;
@@ -90,7 +90,7 @@
     m_sOurType.cbFormat=18+wf->cbSize;
     m_sOurType.pbFormat=m_sVhdr;
 
-    memset(&m_sDestType, 0, sizeof m_sDestType);
+    std::memset((void*)&m_sDestType, 0, sizeof m_sDestType);
     m_sDestType.majortype=MEDIATYPE_Audio;
     m_sDestType.subtype=MEDIASUBTYPE_PCM;
     m_sDestType.formattype=FORMAT_WaveFormatEx;
@@ -165,7 +165,7 @@
 	}
 	char* ptr;
 	sample->vt->GetPointer(sample, (BYTE **)&ptr);
-	memcpy(ptr, in_data+read, in_fmt.nBlockAlign);
+	std::memcpy(ptr, in_data+read, in_fmt.nBlockAlign);
 	sample->vt->SetActualDataLength(sample, in_fmt.nBlockAlign);
 	sample->vt->SetSyncPoint(sample, true);
 	sample->vt->SetPreroll(sample, 0);
@@ -176,7 +176,7 @@
 	    sample->vt->Release((IUnknown*)sample);
 	    break;
 	}
-	memcpy(out_data+written, frame_pointer, frame_size);
+	std::memcpy(out_data+written, frame_pointer, frame_size);
         sample->vt->Release((IUnknown*)sample);
 	read+=in_fmt.nBlockAlign;
 	written+=frame_size;
diff -ru main/loader/DirectShow/DS_VideoDec.cpp main2/loader/DirectShow/DS_VideoDec.cpp
--- main/loader/DirectShow/DS_VideoDec.cpp	Sun May  6 23:43:45 2001
+++ main2/loader/DirectShow/DS_VideoDec.cpp	Thu Jun  7 19:42:12 2001
@@ -76,10 +76,10 @@
     try
     {
 	m_bh=*format;
-	memset(&m_obh, 0, sizeof(m_obh));
+	std::memset(&m_obh, 0, sizeof(m_obh));
 	m_obh.biSize=sizeof(m_obh);
 
-	memset(&m_sVhdr, 0, sizeof(m_sVhdr));
+	std::memset(&m_sVhdr, 0, sizeof(m_sVhdr));
 	m_sVhdr.bmiHeader=m_bh;
 	m_sVhdr.rcSource.left=m_sVhdr.rcSource.top=0;
 	m_sVhdr.rcSource.right=m_sVhdr.bmiHeader.biWidth;
@@ -101,7 +101,7 @@
 	m_sVhdr2->bmiHeader.biCompression=0;
 	m_sVhdr2->bmiHeader.biBitCount=24;
 
-	memset(&m_sDestType, 0, sizeof(m_sDestType));
+	std::memset(&m_sDestType, 0, sizeof(m_sDestType));
 	m_sDestType.majortype=MEDIATYPE_Video;
 	m_sDestType.subtype=MEDIASUBTYPE_RGB24;
 	m_sDestType.formattype=FORMAT_VideoInfo;
@@ -232,8 +232,8 @@
         //printf("GetPtr...");fflush(stdout);
 	sample->vt->GetPointer(sample, (BYTE **)&ptr);
         //printf("OK!\n");
-	memcpy(ptr, src, size);
-        //printf("memcpy OK!\n");
+	std::memcpy(ptr, src, size);
+        //printf("std::memcpy OK!\n");
 	sample->vt->SetActualDataLength(sample, size);
         //printf("SetActualDataLength OK!\n");
         sample->vt->SetSyncPoint(sample, is_keyframe);
@@ -305,7 +305,7 @@
     }
 
     m_sDestType.lSampleSize=m_obh.biSizeImage;
-    memcpy(&(m_sVhdr2->bmiHeader), &m_obh, sizeof(m_obh));
+    std::memcpy(&(m_sVhdr2->bmiHeader), &m_obh, sizeof(m_obh));
     m_sVhdr2->bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
     if(m_sVhdr2->bmiHeader.biCompression==3)
         m_sDestType.cbFormat=sizeof(VIDEOINFOHEADER)+12;
@@ -322,7 +322,7 @@
 	    cerr<<"Warning: unsupported bit depth"<<endl;
 
 	m_sDestType.lSampleSize=m_decoder.biSizeImage;
-	memcpy(&(m_sVhdr2->bmiHeader), &m_decoder, sizeof(m_decoder));
+	std::memcpy(&(m_sVhdr2->bmiHeader), &m_decoder, sizeof(m_decoder));
 	m_sVhdr2->bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
 	if(m_sVhdr2->bmiHeader.biCompression==3)
     	    m_sDestType.cbFormat=sizeof(VIDEOINFOHEADER)+12;
@@ -379,15 +379,15 @@
         printf("DivX setting: %s = %d\n",name,value);
 
     	IHidden* hidden=(IHidden*)((int)dsf->m_pFilter+0xb8);
-	if(strcmp(name, "Brightness")==0)
+	if(std::strcmp(name, "Brightness")==0)
 	    return hidden->vt->SetSmth2(hidden, value, 0);
-	if(strcmp(name, "Contrast")==0)
+	if(std::strcmp(name, "Contrast")==0)
 	    return hidden->vt->SetSmth3(hidden, value, 0);
-	if(strcmp(name, "Hue")==0)
+	if(std::strcmp(name, "Hue")==0)
 	    return hidden->vt->SetSmth5(hidden, value, 0);
-	if(strcmp(name, "Saturation")==0)
+	if(std::strcmp(name, "Saturation")==0)
 	    return hidden->vt->SetSmth4(hidden, value, 0);
-	if(strcmp(name, "Quality")==0)
+	if(std::strcmp(name, "Quality")==0)
 	    return hidden->vt->SetSmth(hidden, value, 0);
             
         printf("Invalid setting!\n");
@@ -396,7 +396,7 @@
 
 extern "C" int DS_SetAttr_DivX(char* attribute, int value){
     int result, status, newkey, count;
-        if(strcmp(attribute, "Quality")==0){
+        if(std::strcmp(attribute, "Quality")==0){
 	    char* keyname="SOFTWARE\\Microsoft\\Scrunch";
     	    result=RegCreateKeyExA(HKEY_CURRENT_USER, keyname, 0, 0, 0, 0, 0,	   		&newkey, &status);
             if(result!=0)
@@ -422,10 +422,10 @@
 	}   	
 
         if(
-	(strcmp(attribute, "Saturation")==0) ||
-	(strcmp(attribute, "Hue")==0) ||
-	(strcmp(attribute, "Contrast")==0) ||
-	(strcmp(attribute, "Brightness")==0)
+	(std::strcmp(attribute, "Saturation")==0) ||
+	(std::strcmp(attribute, "Hue")==0) ||
+	(std::strcmp(attribute, "Contrast")==0) ||
+	(std::strcmp(attribute, "Brightness")==0)
 	)
         {
 	    char* keyname="SOFTWARE\\Microsoft\\Scrunch\\Video";
diff -ru main/loader/DirectShow/outputpin.cpp main2/loader/DirectShow/outputpin.cpp
--- main/loader/DirectShow/outputpin.cpp	Sun May  6 23:43:45 2001
+++ main2/loader/DirectShow/outputpin.cpp	Thu Jun  7 19:42:12 2001
@@ -1,3 +1,4 @@
+#include <string.h>
 
 #include <cstdio>
 #include <string>
@@ -72,11 +73,11 @@
     
     if(pcFetched)*pcFetched=1;
     ppMediaTypes[0]=(AM_MEDIA_TYPE *)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
-    memcpy(*ppMediaTypes, &type, sizeof(AM_MEDIA_TYPE));
+    std::memcpy(*ppMediaTypes, &type, sizeof(AM_MEDIA_TYPE));
     if(ppMediaTypes[0]->pbFormat)
     {
 	ppMediaTypes[0]->pbFormat=(char *)CoTaskMemAlloc(ppMediaTypes[0]->cbFormat);
-	memcpy(ppMediaTypes[0]->pbFormat, type.pbFormat, ppMediaTypes[0]->cbFormat);
+	std::memcpy(ppMediaTypes[0]->pbFormat, type.pbFormat, ppMediaTypes[0]->cbFormat);
     }
     if(cMediaTypes==1)return 0;
     return 1;
@@ -162,13 +163,13 @@
 {
     Debug printf("COutputPin::QueryInterface() called\n");
     if(!ppv)return 0x80004003;
-    if(!memcmp(iid, &IID_IUnknown, 16))
+    if(!std::memcmp(iid, &IID_IUnknown, 16))
     {
 	*ppv=(void*)This;
 	This->vt->AddRef(This);
 	return 0;
     }
-    if(!memcmp(iid, &IID_IMemInputPin, 16))
+    if(!std::memcmp(iid, &IID_IMemInputPin, 16))
     {
 	*ppv=(void*)(This+1);
 	This->vt->AddRef(This);
@@ -213,7 +214,7 @@
     if(pmt->cbFormat>0)
     {
 	pmt->pbFormat=CoTaskMemAlloc(pmt->cbFormat);
-	memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat);
+	std::memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat);
     }	
 */
     return E_NOTIMPL;
@@ -260,7 +261,7 @@
     if(pmt->cbFormat>0)
     {
 	pmt->pbFormat=(char *)CoTaskMemAlloc(pmt->cbFormat);
-	memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat);
+	std::memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat);
     }	
     return 0;
 }
@@ -378,21 +379,21 @@
 {
     Debug printf("COutputPin::QueryInterface() called\n");
     if(!ppv)return 0x80004003;
-    if(!memcmp(iid, &IID_IUnknown, 16))
+    if(!std::memcmp(iid, &IID_IUnknown, 16))
     {
 	COutputPin* ptr=(COutputPin*)(This-1);
 	*ppv=(void*)ptr;
 	AddRef((IUnknown*)ptr);
 	return 0;
     }
-/*    if(!memcmp(iid, &IID_IPin, 16))
+/*    if(!std::memcmp(iid, &IID_IPin, 16))
     {
 	COutputPin* ptr=(COutputPin*)(This-1);
 	*ppv=(void*)ptr;
 	AddRef((IUnknown*)ptr);
 	return 0;
     }*/
-    if(!memcmp(iid, &IID_IMemInputPin, 16))
+    if(!std::memcmp(iid, &IID_IMemInputPin, 16))
     {
 	*ppv=(void*)This;
 	This->vt->AddRef(This);
@@ -465,7 +466,7 @@
 	return -1;
     int len=pSample->vt->GetActualDataLength(pSample);
     if(len==0)len=pSample->vt->GetSize(pSample);//for iv50
-    //if(me.frame_pointer)memcpy(me.frame_pointer, pointer, len);
+    //if(me.frame_pointer)std::memcpy(me.frame_pointer, pointer, len);
     if(me.frame_pointer)
 	*me.frame_pointer=pointer;
     if(me.frame_size_pointer)*me.frame_size_pointer=len;
diff -ru main/mp3lib/bswap.h main2/mp3lib/bswap.h
--- main/mp3lib/bswap.h	Wed Jun  6 11:33:36 2001
+++ main2/mp3lib/bswap.h	Thu Jun  7 19:35:00 2001
@@ -1,2 +1,3 @@
 /* Let it be for now*/
-#include "../libac3/bswap.h"
\ No newline at end of file
+#include "../libac3/bswap.h"
+
diff -ru main/mp3lib/fastmemcpy.h main2/mp3lib/fastmemcpy.h
--- main/mp3lib/fastmemcpy.h	Thu Jun  7 11:08:32 2001
+++ main2/mp3lib/fastmemcpy.h	Thu Jun  7 19:35:45 2001
@@ -1 +1,2 @@
-#include "../libvo/fastmemcpy.h"
\ No newline at end of file
+#include "../libvo/fastmemcpy.h"
+
--- patch ends ---

--
p_l at tfz dot net

_______________________________________________
Mplayer-dev-eng mailing list
Mplayer-dev-eng at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-dev-eng



More information about the MPlayer-dev-eng mailing list