changeset 195:3fa7b4f4ab78

2003-6-19 Brian Masney <masneyb@gftp.org> * autogen.sh - updated to hopefully make it more portable across various systems * lib/rfc959.c - change variable type of data_addr_len from size_t to socklen_t (fixed warnings on 64 bit machines) * src/gtk/chmod_dialog.c src/gtk/gftp-gtk.c src/gtk/menu-items.c src/gtk/misc-gtk.c src/gtk/mkdir_dialog.c src/gtk/options_dialog.c src/gtk/rename_dialog.c src/gtk/transfer.c - rather than casting from integer to pointer and vice versa, use GINT_TO_POINTER and GPOINTER_TO_INT. These macros do the exact same thing and I'm still getting compiler warnings on Debian Sparc64 with -m64, but at least I'll be able to fix the define in glib and then these warnings will be fixed then
author masneyb
date Fri, 20 Jun 2003 01:39:44 +0000
parents ab1bf7e5f407
children f1792dd41a0a
files ChangeLog autogen.sh lib/rfc959.c src/gtk/chmod_dialog.c src/gtk/gftp-gtk.c src/gtk/menu-items.c src/gtk/misc-gtk.c src/gtk/mkdir_dialog.c src/gtk/options_dialog.c src/gtk/rename_dialog.c src/gtk/transfer.c
diffstat 11 files changed, 84 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jun 19 16:42:46 2003 +0000
+++ b/ChangeLog	Fri Jun 20 01:39:44 2003 +0000
@@ -1,3 +1,19 @@
+2003-6-19 Brian Masney <masneyb@gftp.org>
+	* autogen.sh - updated to hopefully make it more portable across
+	various systems
+
+	* lib/rfc959.c - change variable type of data_addr_len from size_t
+	to socklen_t (fixed warnings on 64 bit machines)
+
+	* src/gtk/chmod_dialog.c src/gtk/gftp-gtk.c src/gtk/menu-items.c
+	src/gtk/misc-gtk.c src/gtk/mkdir_dialog.c src/gtk/options_dialog.c
+	src/gtk/rename_dialog.c src/gtk/transfer.c - rather than casting
+	from integer to pointer and vice versa, use GINT_TO_POINTER and
+	GPOINTER_TO_INT. These macros do the exact same thing and I'm 
+	still getting compiler warnings on Debian Sparc64 with -m64, but at
+	least I'll be able to fix the define in glib and then these warnings
+	will be fixed then
+
 2003-6-18 Brian Masney <masneyb@gftp.org>
 	* lib/protocols.c - send right parameters to the logging function
 	(from Nam SungHyun <namsh@kldp.org>)
@@ -1036,7 +1052,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.96 2003/06/18 10:17:29 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.97 2003/06/20 01:39:42 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/autogen.sh	Thu Jun 19 16:42:46 2003 +0000
+++ b/autogen.sh	Fri Jun 20 01:39:44 2003 +0000
@@ -9,10 +9,27 @@
 PROJECT=gFTP
 TEST_TYPE=-f
 FILE=lib/gftp.h
+GETTEXTIZE=gettextize
 
 DIE=0
 
-(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+if [ `whereis -b automake-1.4 > /dev/null 2>&1` ] ; then
+	AUTOMAKE=automake-1.4
+	ACLOCAL=aclocal-1.4
+else
+	AUTOMAKE=automake
+	ACLOCAL=aclocal
+fi
+
+if [ `whereis -b autoconf2.13 > /dev/null 2>&1` ] ; then
+	AUTOCONF=autoconf2.13
+	AUTOHEADER=autoheader2.13
+else
+	AUTOCONF=autoconf
+	AUTOHEADER=autoheader
+fi
+
+($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
 	echo
 	echo "You must have autoconf installed to compile $PROJECT."
 	echo "libtool the appropriate package for your distribution,"
@@ -21,7 +38,7 @@
 }
 
 have_automake=false
-if automake --version < /dev/null > /dev/null 2>&1 ; then
+if $AUTOMAKE --version < /dev/null > /dev/null 2>&1 ; then
 	automake_version=`automake --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
 	case $automake_version in
 	   1.2*|1.3*|1.4) 
@@ -39,12 +56,8 @@
 	DIE=1
 fi
 
-have_gettext=false
-if xgettext --version 2>/dev/null | grep 'GNU' > /dev/null ; then 
-        have_gettext=true
-fi
-
-if $have_gettext ; then : ; else
+gettext_version=`$GETTEXTIZE --version 2>/dev/null | grep 'GNU'`
+if [ "x$gettext_version" = "x" ] ; then 
        echo
        echo "GNU gettext must be installed to build GLib from CVS"
        echo "GNU gettext is available from http://www.gnu.org/software/gettext/"
@@ -71,15 +84,29 @@
 *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
 esac
 
-gettextize -f -c --intl
+intl=`$GETTEXTIZE --help 2>/dev/null | grep -- '--intl'`
+if test -z "$intl"; then
+	GETTEXTIZE_FLAGS="-f -c"
+else
+	GETTEXTIZE_FLAGS="-f -c --intl"
+fi
 
-aclocal $ACLOCAL_FLAGS
+echo "$GETTEXTIZE $GETTEXTIZE_FLAGS"
+$GETTEXTIZE $GETTEXTIZE_FLAGS
+
+echo "$ACLOCAL $ACLOCAL_FLAGS"
+$ACLOCAL $ACLOCAL_FLAGS
 
 # optionally feature autoheader
-(autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader
+($AUTOHEADER --version)  < /dev/null > /dev/null 2>&1 && $AUTOHEADER
 
-automake -a -c $am_opt
-autoconf
+AUTOMAKE_FLAGS="-a -c $am_opt"
+echo "$AUTOMAKE $AUTOMAKE_FLAGS"
+$AUTOMAKE $AUTOMAKE_FLAGS
+
+echo $AUTOCONF
+$AUTOCONF
+
 cd $ORIGDIR
 
 if test -z "$AUTOGEN_SUBDIR_MODE"; then
--- a/lib/rfc959.c	Thu Jun 19 16:42:46 2003 +0000
+++ b/lib/rfc959.c	Fri Jun 20 01:39:44 2003 +0000
@@ -574,7 +574,7 @@
   struct sockaddr_in data_addr;
   int i, passive_transfer;
   rfc959_parms * parms;
-  size_t data_addr_len;
+  socklen_t data_addr_len;
   unsigned int temp[6];
   unsigned char ad[6];
 
@@ -722,7 +722,7 @@
   char *pos, resp, buf[64], *command;
   struct sockaddr_in6 data_addr;
   int passive_transfer;
-  size_t data_addr_len;
+  socklen_t data_addr_len;
   rfc959_parms * parms;
   unsigned int port;
 
@@ -897,7 +897,7 @@
 #else
   struct sockaddr_in6 cli_addr;
 #endif
-  size_t cli_addr_len;
+  socklen_t cli_addr_len;
 
   parms = request->protocol_data;
 
--- a/src/gtk/chmod_dialog.c	Thu Jun 19 16:42:46 2003 +0000
+++ b/src/gtk/chmod_dialog.c	Fri Jun 20 01:39:44 2003 +0000
@@ -77,14 +77,14 @@
     use_jmp_environment = 0;
 
   wdata->request->stopable = 0;
-  return ((void *) success);
+  return (GINT_TO_POINTER (success));
 }
 
 
 static void
 dochmod (GtkWidget * widget, gftp_window_data * wdata)
 {
-  int cur;
+  int cur, ret;
 
   mode = 0;
   if (GTK_TOGGLE_BUTTON (suid)->active)
@@ -124,7 +124,8 @@
   if (check_reconnect (wdata) < 0)
     return;
 
-   if ((int) generic_thread (do_chmod_thread, wdata))
+  ret = GPOINTER_TO_INT (generic_thread (do_chmod_thread, wdata));
+  if (ret)
     refresh (wdata);
 }
 
--- a/src/gtk/gftp-gtk.c	Thu Jun 19 16:42:46 2003 +0000
+++ b/src/gtk/gftp-gtk.c	Fri Jun 20 01:39:44 2003 +0000
@@ -909,7 +909,7 @@
     disconnect (current_wdata);
 
   tempwid = gtk_menu_get_active (GTK_MENU (protocol_menu));
-  num = (int) gtk_object_get_user_data (GTK_OBJECT (tempwid));
+  num = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (tempwid)));
   init = gftp_protocols[num].init;
   if (init (current_wdata->request) < 0)
     return;
--- a/src/gtk/menu-items.c	Thu Jun 19 16:42:46 2003 +0000
+++ b/src/gtk/menu-items.c	Fri Jun 20 01:39:44 2003 +0000
@@ -434,7 +434,7 @@
     use_jmp_environment = 0;
 
   wdata->request->stopable = 0;
-  return ((void *) success);
+  return (GINT_TO_POINTER (success));
 }
 
 
@@ -452,7 +452,7 @@
   else
     olddir = NULL;
 
-  ret = (int) generic_thread (do_change_dir_thread, wdata);
+  ret = GPOINTER_TO_INT (generic_thread (do_change_dir_thread, wdata));
 
   if (!GFTP_IS_CONNECTED (wdata->request))
     {
--- a/src/gtk/misc-gtk.c	Thu Jun 19 16:42:46 2003 +0000
+++ b/src/gtk/misc-gtk.c	Fri Jun 20 01:39:44 2003 +0000
@@ -592,7 +592,7 @@
   gftp_file * tempfle;
   int i, newpos;
 
-  newpos = (int) selection->data;
+  newpos = GPOINTER_TO_INT (selection->data);
   i = *curnum - newpos;
 
   if (i < 0)
--- a/src/gtk/mkdir_dialog.c	Thu Jun 19 16:42:46 2003 +0000
+++ b/src/gtk/mkdir_dialog.c	Fri Jun 20 01:39:44 2003 +0000
@@ -62,13 +62,15 @@
     use_jmp_environment = 0;
 
   wdata->request->stopable = 0;
-  return ((void *) success);
+  return (GINT_TO_POINTER (success));
 }
 
 
 static void
 domkdir (gftp_window_data * wdata, gftp_dialog_data * ddata)
 {
+  int ret;
+
   edttext = gtk_entry_get_text (GTK_ENTRY (ddata->edit));
   if (*edttext == '\0')
     {
@@ -80,7 +82,8 @@
   if (check_reconnect (wdata) < 0)
     return;
 
-  if ((int) generic_thread (do_make_dir_thread, wdata))
+  ret = GPOINTER_TO_INT (generic_thread (do_make_dir_thread, wdata));
+  if (ret)
     {
       gftp_delete_cache_entry (wdata->request, NULL, 0);
       refresh (wdata);
--- a/src/gtk/options_dialog.c	Thu Jun 19 16:42:46 2003 +0000
+++ b/src/gtk/options_dialog.c	Fri Jun 20 01:39:44 2003 +0000
@@ -844,7 +844,7 @@
 
   if ((templist = GTK_CLIST (proxy_list)->selection) == NULL)
     return;
-  num = (int) templist->data;
+  num = GPOINTER_TO_INT (templist->data);
   templist = gtk_clist_get_row_data (GTK_CLIST (proxy_list), num);
   new_proxy_hosts = g_list_remove_link (new_proxy_hosts, templist);
   gtk_clist_remove (GTK_CLIST (proxy_list), num);
@@ -864,7 +864,7 @@
       if ((templist = GTK_CLIST (proxy_list)->selection) == NULL)
 	return;
       templist = gtk_clist_get_row_data (GTK_CLIST (proxy_list), 
-                                         (int) templist->data);
+                                         GPOINTER_TO_INT (templist->data));
       hosts = templist->data;
     }
   else
--- a/src/gtk/rename_dialog.c	Thu Jun 19 16:42:46 2003 +0000
+++ b/src/gtk/rename_dialog.c	Fri Jun 20 01:39:44 2003 +0000
@@ -63,13 +63,15 @@
     use_jmp_environment = 0;
 
   wdata->request->stopable = 0;
-  return ((void *) success);
+  return (GINT_TO_POINTER (success));
 }
 
 
 static void
 dorenCB (gftp_window_data * wdata, gftp_dialog_data * ddata)
 {
+  int ret;
+
   edttext = gtk_entry_get_text (GTK_ENTRY (ddata->edit));
   if (*edttext == '\0')
     {
@@ -81,7 +83,8 @@
   if (check_reconnect (wdata) < 0) 
     return;
 
-  if ((int) generic_thread (do_rename_thread, wdata))
+  ret = GPOINTER_TO_INT (generic_thread (do_rename_thread, wdata));
+  if (ret)
     refresh ((gpointer) wdata);
 }
 
--- a/src/gtk/transfer.c	Thu Jun 19 16:42:46 2003 +0000
+++ b/src/gtk/transfer.c	Fri Jun 20 01:39:44 2003 +0000
@@ -292,7 +292,7 @@
   request->stopable = 0;
   if (request->wakeup_main_thread[1] > 0)
     write (request->wakeup_main_thread[1], " ", 1);
-  return ((void *) ret);
+  return (GINT_TO_POINTER (ret));
 }
 
 
@@ -366,7 +366,8 @@
     }
   else
     ret = connect_thread (request);
-  success = (int) ret;
+
+  success = GPOINTER_TO_INT (ret);
   memset (&wdata->tid, 0, sizeof (wdata->tid));
 
   if (!GFTP_IS_CONNECTED (wdata->request))
@@ -537,7 +538,7 @@
     use_jmp_environment = 0;
 
   transfer->fromreq->stopable = 0;
-  return ((void *) success);
+  return (GINT_TO_POINTER (success));
 }