Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 May 2011 13:30:54 -0400 (EDT)
From:      Lowell Gilbert <lgfbsd@be-well.ilk.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        danfe@FreeBSD.org
Subject:   ports/157433: [PATCH] un-break audio/rezound for 64 bit
Message-ID:  <20110530173054.E48FE5082B@be-well.ilk.org>
Resent-Message-ID: <201105301800.p4UI0T7E030002@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         157433
>Category:       ports
>Synopsis:       [PATCH] un-break audio/rezound for 64 bit
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 30 18:00:28 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Lowell Gilbert
>Release:        FreeBSD 8.2-STABLE i386
>Organization:
FreeBSD user
>Environment:
System: FreeBSD be-well.ilk.org 8.2-STABLE FreeBSD 8.2-STABLE #10: Fri May 27 09:25:55 EDT 2011 root@lowell-desk.lan:/usr/obj/usr/src/sys/BE-WELL i386


	
>Description:
	

The "rezound" port has been broken for a while on amd64 and sparc64
because of a bunch of "pointer can fit in an integer" assumptions.  I
checked that in each case, the data in the pointer had come from an
integer in the first place, so a quick and easy hack will get it
rolling again.  I didn't try to come up with clean solutions, because
I wasn't sure they would work on other platforms.  For that matter, I
didn't test the sparc64 case.

>How-To-Repeat:

>From port's makefile:

.if ${OSVERSION} >= 700042
.if ${ARCH} == "amd64" || ${ARCH} == "sparc64"
BROKEN=		Does not compile with GCC 4.2
.endif
.endif


>Fix:

--- ./work/rezound-0.12.3beta/src/misc/AThread.h~	2003-07-08 14:31:57.000000000 -0400
+++ ./work/rezound-0.12.3beta/src/misc/AThread.h	2011-05-30 12:39:18.000000000 -0400
@@ -129,17 +129,17 @@
 			thread->running=false;
 		}
 		catch(exception &e)
 		{
 			thread->running=false;
-			fprintf(stderr,"exception was thrown within thread -- ID: 0x%x;\nmessage: %s\naborting\n",(unsigned)thread->threadID,e.what());fflush(stderr);
+			fprintf(stderr,"exception was thrown within thread -- ID: 0x%Lx;\nmessage: %s\naborting\n",(unsigned long)thread->threadID,e.what());fflush(stderr);
 			abort();
 		}
 		catch(...)
 		{
 			thread->running=false;
-			fprintf(stderr,"unhandled exception was thrown within thread -- ID: 0x%x; aborting\n",(unsigned)thread->threadID);fflush(stderr);
+			fprintf(stderr,"unhandled exception was thrown within thread -- ID: 0x%Lx; aborting\n",(unsigned long)thread->threadID);fflush(stderr);
 			abort();
 		}
 		return(NULL);
 	}
 
--- ./work/rezound-0.12.3beta/src/frontend_fox/CMainWindow.cpp~	2007-01-13 18:48:07.000000000 -0500
+++ ./work/rezound-0.12.3beta/src/frontend_fox/CMainWindow.cpp	2011-05-30 12:58:16.000000000 -0400
@@ -436,11 +436,11 @@
 
 }
 
 long CMainWindow::onSoundListChange(FXObject *sender,FXSelector sel,void *ptr)
 {
-	FXint index=(FXint)ptr;
+  FXint index=(unsigned long)(ptr);
 
 	if(index>=0 && index<soundList->getNumItems())
 	{
 		((CSoundWindow *)soundList->getItemData(index))->setActiveState(true);
 
@@ -1851,17 +1851,17 @@
 
 	FXint pos=shuttleDial->getValue();
 
 	if(pos==0 && FXSELID(sel)==ID_SHUTTLE_BACKWARD)
 	{
-		if((unsigned)ptr > 1/*came from keyboard event*/) enableAutoRepeat(getApp()->getDisplay(),false); // QQQ
+		if((unsigned long)ptr > 1/*came from keyboard event*/) enableAutoRepeat(getApp()->getDisplay(),false); // QQQ
 		shuttleDial->setValue(pos-inc);
 		onShuttleChange(sender,sel,ptr);
 	}
 	else if(pos==0 && FXSELID(sel)==ID_SHUTTLE_FORWARD)
 	{
-		if((unsigned)ptr > 1/*came from keyboard event*/) enableAutoRepeat(getApp()->getDisplay(),false); // QQQ
+		if((unsigned long)ptr > 1/*came from keyboard event*/) enableAutoRepeat(getApp()->getDisplay(),false); // QQQ
 		shuttleDial->setValue(pos+inc);
 		onShuttleChange(sender,sel,ptr);
 	}
 	else if(pos!=0 && FXSELID(sel)==ID_SHUTTLE_INCREASE_RATE)
 	{
--- ./work/rezound-0.12.3beta/src/frontend_fox/CPasteChannelsDialog.cpp~	2005-02-09 03:17:36.000000000 -0500
+++ ./work/rezound-0.12.3beta/src/frontend_fox/CPasteChannelsDialog.cpp	2011-05-30 12:59:33.000000000 -0400
@@ -204,11 +204,11 @@
 
 	if(execute(PLACEMENT_CURSOR))
 	{
 		pasteChannels.clear();
 
-		actionParameters->setValue<unsigned>(_("MixMethod"),(unsigned)(mixTypeComboBox->getItemData(mixTypeComboBox->getCurrentItem())));
+		actionParameters->setValue<unsigned>(_("MixMethod"),(unsigned long)(mixTypeComboBox->getItemData(mixTypeComboBox->getCurrentItem())));
 		
 		if(repeatTypeComboBox->getCurrentItem()==0)
 		{ // repeating it a given number of times
 			actionParameters->setValue<double>(_("Repeat Count"),repeatCountSlider->getValue());
 		}
--- ./work/rezound-0.12.3beta/src/frontend_fox/COggDialog.cpp~	2004-02-11 00:11:17.000000000 -0500
+++ ./work/rezound-0.12.3beta/src/frontend_fox/COggDialog.cpp	2011-05-30 13:00:21.000000000 -0400
@@ -134,11 +134,11 @@
 		setEnable(t->childAtIndex(i),enabled);
 }
 
 long COggDialog::onRadioButton(FXObject *sender,FXSelector sel,void *ptr)
 {
-	if((int)ptr==0) // only act when ptr==1 when it's getting checked
+	if((long int)ptr==0) // only act when ptr==1 when it's getting checked
 		return 1;
 
 	// turn off all buttons
 	CBRButton->setCheck(FALSE);
 	setEnable((FXWindow *)CBRFrame,false);
--- ./work/rezound-0.12.3beta/src/frontend_fox/CMp3Dialog.cpp~	2004-06-18 23:53:18.000000000 -0400
+++ ./work/rezound-0.12.3beta/src/frontend_fox/CMp3Dialog.cpp	2011-05-30 13:00:56.000000000 -0400
@@ -168,11 +168,11 @@
 		setEnable(t->childAtIndex(i),enabled);
 }
 
 long CMp3Dialog::onRadioButton(FXObject *sender,FXSelector sel,void *ptr)
 {
-	if((int)ptr==0) // only act when ptr==1 when it's getting checked
+	if((long int)ptr==0) // only act when ptr==1 when it's getting checked
 		return 1;
 
 	// turn off all buttons
 	CBRButton->setCheck(FALSE);
 	setEnable((FXWindow *)CBRFrame,false);
--- ./Makefile~	2010-06-06 16:43:39.000000000 -0400
+++ ./Makefile	2011-05-30 12:27:03.000000000 -0400
@@ -37,11 +37,11 @@
 
 .include <bsd.port.pre.mk>
 
 .if ${OSVERSION} >= 700042
 .if ${ARCH} == "amd64" || ${ARCH} == "sparc64"
-BROKEN=		Does not compile with GCC 4.2
+#BROKEN=		Does not compile with GCC 4.2
 .endif
 .endif
 
 .if defined(WITH_LARGEFILE)
 CONFIGURE_ARGS+=	--enable-largefile



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110530173054.E48FE5082B>