[Pkg-octave-devel] Bug#302688: marked as done (octaviz: FTBFS (amd64/gcc-4.0): cast from 'vtkObjectBase*' to 'unsigned int' loses precision)

Debian Bug Tracking System owner at bugs.debian.org
Sat Oct 15 07:48:15 UTC 2005


Your message dated Sat, 15 Oct 2005 09:31:46 +0200
with message-id <20051015073146.GA28025 at laboiss2>
and subject line octaviz_0.4.0-12 builds fine on all 64 bit arches
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 2 Apr 2005 11:16:44 +0000
>From aj at andaco.de Sat Apr 02 03:16:44 2005
Return-path: <aj at andaco.de>
Received: from c156139.adsl.hansenet.de (localhost.localdomain) [213.39.156.139] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1DHgcN-0000d6-00; Sat, 02 Apr 2005 03:16:43 -0800
Received: from aj by localhost.localdomain with local (Exim 4.50)
	id 1DHgcQ-0007Fy-4x; Sat, 02 Apr 2005 13:16:46 +0200
To: Debian Bug Tracking System <submit at bugs.debian.org>
From: Andreas Jochens <aj at andaco.de>
Subject: octaviz: FTBFS (amd64/gcc-4.0): cast from 'vtkObjectBase*' to 'unsigned int' loses precision
Message-Id: <E1DHgcQ-0007Fy-4x at localhost.localdomain>
Date: Sat, 02 Apr 2005 13:16:46 +0200
Delivered-To: submit at bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Package: octaviz
Version: 0.4.0-10
Severity: normal
Tags: patch

When building 'octaviz' on amd64/unstable with gcc-4.0,
I get the following error:

make[4]: Entering directory `/octaviz-0.4.0/Common'
Building object file octaviz.o...
/octaviz-0.4.0/Common/octaviz.cc: In constructor 'vtk_object::vtk_object(vtkObjectBase*, bool)':
/octaviz-0.4.0/Common/octaviz.cc:117: error: cast from 'vtkObjectBase*' to 'unsigned int' loses precision
/octaviz-0.4.0/Common/octaviz.cc: In copy constructor 'vtk_object::vtk_object(const vtk_object&)':
/octaviz-0.4.0/Common/octaviz.cc:152: error: cast from 'vtkObjectBase*' to 'unsigned int' loses precision
/octaviz-0.4.0/Common/octaviz.cc: In destructor 'virtual vtk_object::~vtk_object()':
/octaviz-0.4.0/Common/octaviz.cc:165: error: cast from 'vtkObjectBase*' to 'unsigned int' loses precision
/octaviz-0.4.0/Common/octaviz.cc: In member function 'virtual unsigned int vtk_object::uint_value(bool, bool) const':
/octaviz-0.4.0/Common/octaviz.cc:183: error: cast from 'vtkObjectBase*' to 'unsigned int' loses precision
make[4]: *** [octaviz.o] Error 1
make[4]: Leaving directory `/octaviz-0.4.0/Common'

With the attached patch 'octaviz' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/octaviz-0.4.0/Common/octaviz.cc ./Common/octaviz.cc
--- ../tmp-orig/octaviz-0.4.0/Common/octaviz.cc	2004-10-24 04:09:13.000000000 +0200
+++ ./Common/octaviz.cc	2005-04-02 07:47:15.000000000 +0200
@@ -114,7 +114,7 @@
 	//std::cout << "Creating.\n" << std::flush;
 	std::map<unsigned int, int>& reference_count = get_reference_map();
 
-	unsigned int key = reinterpret_cast<unsigned int>( pointer );
+	unsigned long key = reinterpret_cast<unsigned long>( pointer );
 	
 	if ( belongs_to_octave ) 
 	{
@@ -149,7 +149,7 @@
 	//std::cout << "Creating copy.\n" << std::flush;
 	std::map<unsigned int, int>& reference_count = get_reference_map();
 
-	unsigned int key = reinterpret_cast<unsigned int>( vtk_pointer );
+	unsigned long key = reinterpret_cast<unsigned long>( vtk_pointer );
 	
 	// If this is a clone than it exists in reference count map
 	if ( reference_count.find(key) == reference_count.end() ) return;
@@ -162,7 +162,7 @@
 { 
 	//std::cout << "Destroying.\n" << std::flush;
 	std::map<unsigned int, int>& reference_count = get_reference_map();
-	unsigned int key = reinterpret_cast<unsigned int>( vtk_pointer );
+	unsigned long key = reinterpret_cast<unsigned long>( vtk_pointer );
 	// Check if the pointer is reference counted.
 	if ( reference_count.find(key) == reference_count.end() ) return;
 	
@@ -180,7 +180,7 @@
 
 unsigned int vtk_object::uint_value (bool req_int, bool frc_str_conv ) const
 {
-	return reinterpret_cast<unsigned int>(vtk_pointer);
+	return reinterpret_cast<unsigned long>(vtk_pointer);
 }
  
 bool vtk_object::is_defined (void) const 
diff -urN ../tmp-orig/octaviz-0.4.0/Common/vtkInitializeInteractor.cc ./Common/vtkInitializeInteractor.cc
--- ../tmp-orig/octaviz-0.4.0/Common/vtkInitializeInteractor.cc	2004-10-24 04:09:13.000000000 +0200
+++ ./Common/vtkInitializeInteractor.cc	2005-04-02 12:25:48.256947614 +0200
@@ -76,7 +76,7 @@
 	vtkXOpenGLRenderWindow* RenderWindow = reinterpret_cast<vtkXOpenGLRenderWindow*>(CurrentInteractor->GetRenderWindow());
 	Widget widg = CurrentInteractor->GetWidget();
 	Atom wm_delete_window = XInternAtom(XtDisplay(widg), "WM_DELETE_WINDOW", False);
-	vtk_delete_window_atoms[wm_delete_window] = reinterpret_cast<unsigned int>(RenderWindow);
+	vtk_delete_window_atoms[wm_delete_window] = reinterpret_cast<unsigned long>(RenderWindow);
     // turn off default delete response
 	XSetWMProtocols(XtDisplay(widg), XtWindow(widg), &wm_delete_window, 1);
   return retval;

---------------------------------------
Received: (at 302688-done) by bugs.debian.org; 15 Oct 2005 07:31:49 +0000
>From laboissiere at cbs.mpg.de Sat Oct 15 00:31:49 2005
Return-path: <laboissiere at cbs.mpg.de>
Received: from kom.mpisoc.mpg.de (kom.mpipf-muenchen.mpg.de) [192.129.1.23] 
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1EQgWD-0004Y8-00; Sat, 15 Oct 2005 00:31:49 -0700
Received: from amalie.intra.mpipf-muenchen.mpg.de ([10.1.1.2])
	by kom.mpipf-muenchen.mpg.de with esmtp (Exim 4.34)
	id 1EQgWC-00006D-QE; Sat, 15 Oct 2005 09:31:48 +0200
Received: from [10.80.1.253] (helo=laboiss2)
	by amalie.intra.mpipf-muenchen.mpg.de with esmtp (Exim 4.05)
	id 1EQgWD-0001PQ-00; Sat, 15 Oct 2005 09:31:49 +0200
Received: from rafael by laboiss2 with local (Exim 3.36 #1 (Debian))
	id 1EQgWB-0007K6-00; Sat, 15 Oct 2005 09:31:47 +0200
Date: Sat, 15 Oct 2005 09:31:46 +0200
From: Rafael Laboissiere <rafael at debian.org>
To: 300576-done at bugs.debian.org, 302688-done at bugs.debian.org
Subject: octaviz_0.4.0-12 builds fine on all 64 bit arches
Message-ID: <20051015073146.GA28025 at laboiss2>
Reply-To: Rafael Laboissiere <rafael at debian.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Organization: Debian GNU/Linux
User-Agent: Mutt/1.5.9i
Delivered-To: 302688-done at bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2005_01_02
X-CrossAssassin-Score: 2

I am hereby closing these bug reports, since octave_0.4.0-12 builds
correctly on all 64-bit architectures (alpha, ia64, and amd64).

Thanks to Andreas Jochens for his patch.

-- 
Rafael



More information about the Pkg-octave-devel mailing list