Bug#297862: xlogmaster: FTBFS (amd64/gcc-4.0): cast from 'void**' to 'int' loses precision
Package: xlogmaster
Severity: normal
Tags: patch
When building 'xlogmaster' on amd64 with gcc-4.0,
I get the following error:
c++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -DXLM_HOME=\"/etc/xlogmaster\" -DXLM_DB=\"/etc/xlogmaster/database\" -DXLM_USER_DB=\".xlm-db\" -DXLM_LIB=\"/etc/xlogmaster\" -I../import -c xlogmaster.cc
In file included from /usr/lib/gcc/x86_64-linux/4.0.0/../../../../include/c++/4.0.0/backward/fstream.h:31,
from sysinc.H:23,
from xlogmaster.cc:36:
/usr/lib/gcc/x86_64-linux/4.0.0/../../../../include/c++/4.0.0/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
xlogmaster.cc: In function 'void button_pressed(GtkWidget*, void**)':
xlogmaster.cc:439: error: cast from 'void**' to 'int' loses precision
make[3]: *** [xlogmaster.o] Error 1
make[3]: Leaving directory `/xlogmaster-1.6.0/src'
With the attached patch 'xlogmaster' can be compiled
on amd64 using gcc-4.0.
Regards
Andreas Jochens
diff -urN ../tmp-orig/xlogmaster-1.6.0/src/alert.cc ./src/alert.cc
--- ../tmp-orig/xlogmaster-1.6.0/src/alert.cc 1999-03-31 18:00:29.000000000 +0200
+++ ./src/alert.cc 2005-03-03 11:28:10.000000000 +0100
@@ -103,7 +103,7 @@
int
alert_interrupt(gpointer data)
{
- int nr = (int) data;
+ long nr = (long) data;
entry[nr]->fade += entry[nr]->fadestep;
if ( entry[nr]->fade > fade_base )
{
diff -urN ../tmp-orig/xlogmaster-1.6.0/src/customize.cc ./src/customize.cc
--- ../tmp-orig/xlogmaster-1.6.0/src/customize.cc 1999-03-31 18:00:29.000000000 +0200
+++ ./src/customize.cc 2005-03-03 11:29:19.000000000 +0100
@@ -1849,7 +1849,7 @@
gint default_class0_filter = NO_FILTER;
if ( data != NULL )
- default_class0_filter = (gint) data;
+ default_class0_filter = (long) data;
/* block handlers */
block_filter_handlers = TRUE;
diff -urN ../tmp-orig/xlogmaster-1.6.0/src/output.cc ./src/output.cc
--- ../tmp-orig/xlogmaster-1.6.0/src/output.cc 2005-03-03 11:33:14.551469576 +0100
+++ ./src/output.cc 2005-03-03 11:32:48.780443860 +0100
@@ -189,7 +189,7 @@
gint
pipe_magic_interrupt(gpointer data)
{
- gint i = (gint) data;
+ long i = (long) data;
/* are we locked out ? */
if ( entry[i]->pipe_lock == TRUE )
diff -urN ../tmp-orig/xlogmaster-1.6.0/src/watchdog.cc ./src/watchdog.cc
--- ../tmp-orig/xlogmaster-1.6.0/src/watchdog.cc 2005-03-03 11:33:14.552469383 +0100
+++ ./src/watchdog.cc 2005-03-03 11:32:23.995227864 +0100
@@ -755,7 +755,7 @@
gint
watchdog_tail_interrupt(gpointer data)
{
- gint i = (gint) data;
+ long i = (long) data;
if ( entry[i]->active == FALSE ) return TRUE;
if ( entry[i]->fd == -1 )
@@ -895,7 +895,7 @@
gint
watchdog_run_interrupt(gpointer data)
{
- int i = (int) data;
+ long i = (long) data;
if ( entry[i]->active == FALSE ) return TRUE;
if ( entry[i]->fd == -1 )
@@ -1006,7 +1006,7 @@
gint
watchdog_run_restart_interrupt(gpointer data)
{
- gint i = (gint) data;
+ long i = (long) data;
/* first remove this interrupt */
gtk_timeout_remove(entry[i]->tag);
@@ -1038,7 +1038,7 @@
gint
watchdog_cat_interrupt(gpointer data)
{
- int i = (int) data;
+ long i = (long) data;
if ( entry[i]->active == FALSE ) return TRUE;
/* we need to open it every time anew for CAT */
@@ -1584,7 +1584,7 @@
gint
tail_interrupt(gpointer data)
{
- gint i = (gint) data;
+ long i = (long) data;
if ( entry[i]->active == FALSE ) return TRUE;
/*
@@ -1696,7 +1696,7 @@
gint
cat_interrupt(gpointer data)
{
- gint i = (gint) data;
+ long i = (long) data;
if ( entry[i]->active == FALSE ) return TRUE;
entry[i]->fd = open(entry[i]->filename, O_RDONLY);
@@ -1725,7 +1725,7 @@
gint
run_interrupt(gpointer data)
{
- gint i = (gint) data;
+ long i = (long) data;
if ( entry[i]->active == FALSE ) return TRUE;
long got = read_from_filedescriptor(i);
@@ -1787,7 +1787,7 @@
gint
run_restart_interrupt(gpointer data)
{
- gint i = (gint) data;
+ long i = (long) data;
/* first remove this interrupt */
gtk_timeout_remove(entry[i]->tag);
diff -urN ../tmp-orig/xlogmaster-1.6.0/src/xlogmaster.cc ./src/xlogmaster.cc
--- ../tmp-orig/xlogmaster-1.6.0/src/xlogmaster.cc 2005-03-03 11:33:14.553469190 +0100
+++ ./src/xlogmaster.cc 2005-03-03 11:27:40.000000000 +0100
@@ -436,7 +436,7 @@
button_pressed(GtkWidget *, gpointer *data)
{
if ( display_logs == DISABLED ) return;
- int pressed = (int) data; // Which button has been pressed ?
+ long pressed = (long) data; // Which button has been pressed ?
deactivate(); // deactivate old "Log" object
active = pressed; // set new one
activate(); // and activate it
Reply to: