--- ./DOC/nt.1 Wed Nov 6 01:49:56 2002 +++ ../d4x-2.4.1/./DOC/nt.1 Sat Mar 22 10:55:28 2003 @@ -1,6 +1,6 @@ .TH NT 1 "March 7th, 2001" .SH NAME -nt - A download manager for X +nt, d4x - A download manager for X .SH SYNOPSYS \fBnt\fP [OPTIONS] ... [URL] .SH DESCRIPTION --- ./main/face/misc.cc Wed Nov 6 01:53:28 2002 +++ ../d4x-2.4.1/./main/face/misc.cc Sat Mar 22 10:55:28 2003 @@ -105,7 +105,7 @@ GtkWidget *my_gtk_entry_new_with_max_length(gint length, int val){ GtkWidget *entry=gtk_entry_new(); gtk_entry_set_max_length (GTK_ENTRY(entry),length); - char tmp[length+2]; + char *tmp = new char[length+2]; g_snprintf(tmp,length+1,"%i",val); gtk_entry_set_text(GTK_ENTRY(entry),tmp); GtkStyle *style = gtk_widget_get_style(entry); @@ -116,6 +116,7 @@ */ int real_size=length*13; gtk_widget_set_size_request(entry,real_size>100?100:real_size,-1); + delete tmp; return(entry); }; @@ -223,7 +224,7 @@ void gtk_tree_model_swap_rows_l(GtkTreeModel *model,GtkTreeIter *a,GtkTreeIter *b){ gint num=gtk_tree_model_get_n_columns(model); - GValue values[num]; + GValue *values = new GValue[num]; gint i; for (i=0;ifinfo.size>0 || temp->Size.curent>0)){ char b[100]; d4x_percent_str(temp->Percent, b, sizeof(b)); - sprintf(data, "%s%(%lli/%lli)",b,temp->Size.curent,temp->finfo.size); + sprintf(data, "%s%%(%lli/%lli)",b,temp->Size.curent,temp->finfo.size); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ProgressOfDownload),temp->Percent/100.0); gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ProgressOfDownload),data); }else{ --- ./main/face/fsface.cc Wed Nov 6 01:53:28 2002 +++ ../d4x-2.4.1/./main/face/fsface.cc Sat Mar 22 10:55:28 2003 @@ -205,7 +205,7 @@ void fs_list_add(GtkTreeView *view,tDownload *what){ char data[10]; if (what->finfo.size>0) - sprintf(data,"%li",what->finfo.size); + sprintf(data,"%lli",what->finfo.size); else sprintf(data,"???"); GtkTreeIter iter; --- ./main/face/prefs.cc Wed Nov 6 01:53:28 2002 +++ ../d4x-2.4.1/./main/face/prefs.cc Sat Mar 22 10:55:28 2003 @@ -666,7 +666,7 @@ D4XPWS.log_fsize=gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY(D4XPWS.log_fsize),9); gtk_widget_set_size_request(D4XPWS.log_fsize,80,-1); - sprintf(temp,"%li",TMPCFG.MAIN_LOG_FILE_LIMIT); + sprintf(temp,"%lli",TMPCFG.MAIN_LOG_FILE_LIMIT); gtk_entry_set_text(GTK_ENTRY(D4XPWS.log_fsize),temp); gtk_box_pack_start(GTK_BOX(prefs_log_mlfbox),D4XPWS.log_fsize,FALSE,FALSE,0); D4XPWS.log_fslabel=gtk_label_new(_("Maximum size for file of main log (in KBytes)")); @@ -1345,7 +1345,7 @@ sscanf(gtk_entry_get_text(GTK_ENTRY(D4XPWS.sleep_entry)),"%u",&TMPCFG.DEFAULT_CFG.time_for_sleep); sscanf(gtk_entry_get_text(GTK_ENTRY(D4XPWS.attempts_entry)),"%u",&TMPCFG.DEFAULT_CFG.number_of_attempts); sscanf(gtk_entry_get_text(GTK_ENTRY(D4XPWS.limits_log)),"%u",&TMPCFG.MAX_LOG_LENGTH); - sscanf(gtk_entry_get_text(GTK_ENTRY(D4XPWS.rollback_entry)),"%u",&TMPCFG.DEFAULT_CFG.rollback); + sscanf(gtk_entry_get_text(GTK_ENTRY(D4XPWS.rollback_entry)),"%lld",&TMPCFG.DEFAULT_CFG.rollback); sscanf(gtk_entry_get_text(GTK_ENTRY(D4XPWS.speed_entry)),"%u",&TMPCFG.DEFAULT_CFG.speed); sscanf(gtk_entry_get_text(GTK_ENTRY(D4XPWS.split_entry)),"%u",&TMPCFG.NUMBER_OF_PARTS); return; @@ -1489,7 +1489,7 @@ }; if (equal(label,_("Main log"))){ sscanf(gtk_entry_get_text(GTK_ENTRY(D4XPWS.log_length)),"%u",&TMPCFG.MAX_MAIN_LOG_LENGTH); - sscanf(gtk_entry_get_text(GTK_ENTRY(D4XPWS.log_fsize)),"%li",&TMPCFG.MAIN_LOG_FILE_LIMIT); + sscanf(gtk_entry_get_text(GTK_ENTRY(D4XPWS.log_fsize)),"%lli",&TMPCFG.MAIN_LOG_FILE_LIMIT); TMPCFG.MAIN_LOG_DETAILED=GTK_TOGGLE_BUTTON(D4XPWS.log_detailed)->active; TMPCFG.APPEND_REWRITE_LOG=GTK_TOGGLE_BUTTON(D4XPWS.log_append)->active; TMPCFG.SAVE_MAIN_LOG=GTK_TOGGLE_BUTTON(D4XPWS.log_save)->active; --- ./main/face/saveload.cc Wed Nov 6 01:53:28 2002 +++ ../d4x-2.4.1/./main/face/saveload.cc Sat Mar 22 10:55:28 2003 @@ -51,7 +51,7 @@ if (thread_for_parse_txt_status()==1){ char text[100]; float p=thread_for_parse_percent(); - sprintf(text,"%p%%",p); + sprintf(text,"%f%%",p); gtk_progress_bar_set_text (GTK_PROGRESS_BAR(pbar),text); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pbar),p); return 1; --- ./main/face/lod.cc Tue Dec 24 22:16:42 2002 +++ ../d4x-2.4.1/./main/face/lod.cc Sat Mar 22 10:55:28 2003 @@ -507,6 +507,7 @@ GtkTreeIter *iter, gpointer data){ d4xQueueView *qv=(d4xQueueView *)data; qv->redraw_pixmap(iter); + return(TRUE); }; void d4xQueueView::redraw_pixmap(GtkTreeIter *iter){ @@ -819,6 +820,7 @@ GtkTreeIter *iter,gpointer data){ d4xQueueView *qv=(d4xQueueView *)data; qv->select_by_wildcard(iter); + return(TRUE); }; static gboolean _real_unselect_by_wildcard_(GtkTreeModel *model,GtkTreePath *path, @@ -825,6 +827,7 @@ GtkTreeIter *iter,gpointer data){ d4xQueueView *qv=(d4xQueueView *)data; qv->unselect_by_wildcard(iter); + return(TRUE); }; void d4xQueueView::real_select(int type,char *w){ @@ -1534,6 +1537,7 @@ GtkTreeIter *iter,gpointer data){ d4xQueueView *qv=(d4xQueueView *)data; qv->invert_sel(iter); + return(TRUE); }; void d4xQueueView::invert_selection(){ --- ./main/socket.cc Wed Nov 6 01:53:28 2002 +++ ../d4x-2.4.1/./main/socket.cc Sat Mar 22 10:55:28 2003 @@ -48,6 +48,8 @@ #if !(defined(BSD) && (BSD >= 199306)) #if (defined(__sparc__) || defined(__mips__)) && !(defined(__linux__)) int tmpr=gethostbyname_r(host,hp,buf,bufsize,rvalbuf); +#elif (defined(__sgi)) && !(defined(__linux__)) + struct hostent *tmpr=gethostbyname_r(host,hp,buf,bufsize,rvalbuf); #else /* (defined(__sparc__) || defined(__mips__)) && !(defined(__linux__)) */ int tmpr=gethostbyname_r(host,hp,buf,bufsize,&hpr,rvalbuf); #endif @@ -86,7 +88,7 @@ temp_variable=0; download_set_block(1); #if !(defined(BSD) && (BSD >= 199306)) -#if (defined(__sparc__) || defined(__mips__)) && !(defined(__linux__)) +#if (defined(__sparc__) || defined(__mips__) || defined(__sgi)) && !(defined(__linux__)) gethostbyname_r(host,&hp,buffer,MAX_LEN,&temp_variable); #else gethostbyname_r(host,&hp,buffer,MAX_LEN,&hpr,&temp_variable); @@ -111,7 +113,7 @@ unsigned int tSocket::get_addr() { unsigned int my_addr=0; -#if defined(__sparc__) && !(defined(__linux__)) +#if (defined(__sparc__) || defined(__sgi)) && !(defined(__linux__)) int len; #else socklen_t len; @@ -236,7 +238,7 @@ int tSocket::accepting(char * host) { DBC_RETVAL_IF_FAIL(host!=NULL,-1); sockaddr_in addr; -#if defined(__sparc__) && !(defined(__linux__)) +#if (defined(__sparc__) || defined(__sgi)) && !(defined(__linux__)) int len=sizeof(addr); #else socklen_t len=sizeof(addr); --- ./main/http.cc Mon Jan 27 00:16:07 2003 +++ ../d4x-2.4.1/./main/http.cc Sat Mar 22 10:55:28 2003 @@ -18,6 +18,11 @@ #include "ntlocale.h" #include "signal.h" +/* On IRIX, strings.h declares index() */ +#if defined(__sgi) +#include +#endif + tHttpClient::tHttpClient():tClient(){ user_agent=NULL; pass_first=0; --- ./main/ftp.cc Wed Nov 6 01:53:28 2002 +++ ../d4x-2.4.1/./main/ftp.cc Sat Mar 22 10:55:28 2003 @@ -413,7 +413,7 @@ TEMP_SIZE=0; if (log) { char *str=rindex(log->body,'('); - if (str) sscanf(str+1,"%li",&TEMP_SIZE); + if (str) sscanf(str+1,"%lli",&TEMP_SIZE); }; TEMP_SIZE+=begin; if (OLD_SIZE && OLD_SIZE>TEMP_SIZE){ --- ./main/fsearch.cc Wed Nov 6 01:53:28 2002 +++ ../d4x-2.4.1/./main/fsearch.cc Sat Mar 22 10:55:28 2003 @@ -9,6 +9,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ +#include "../config.h" #include #include "fsearch.h" #include "dbc.h" --- ./main/speed.cc Thu Mar 28 04:40:39 2002 +++ ../d4x-2.4.1/./main/speed.cc Sat Mar 22 10:55:28 2003 @@ -18,7 +18,7 @@ }; void tSpeed::print() { - printf("%li\n",bytes); + printf("%lli\n",bytes); }; fsize_t tSpeed::init(fsize_t a) { --- ./main/signal.cc Thu Mar 28 04:40:39 2002 +++ ../d4x-2.4.1/./main/signal.cc Sat Mar 22 10:55:28 2003 @@ -116,10 +116,12 @@ #else pthread_mutexattr_t ma; pthread_mutexattr_init(&ma); -#if !defined (__sparc__) && !defined(__mips__) +#if !defined (__sparc__) && !defined(__mips__) && !defined(__sgi) pthread_mutexattr_settype(&ma,MUTEX_TYPE_FAST); #elif defined(__mips__) pthread_mutexattr_settype(&ma,MUTEX_TYPE_NORMAL); +#elif defined(__sgi) + pthread_mutexattr_settype(&ma,PTHREAD_MUTEX_NORMAL); #endif pthread_mutex_init(lock,&ma); pthread_mutexattr_destroy(&ma); --- ./main/client.cc Wed Nov 6 01:53:28 2002 +++ ../d4x-2.4.1/./main/client.cc Mon Mar 24 18:07:59 2003 @@ -10,6 +10,7 @@ */ +#include "../config.h" #include "socket.h" #include "liststr.h" #include "client.h" @@ -21,6 +22,10 @@ #include #include +#if defined(HAVE_ALLOCA) && ! defined(__GNUC__) +#include +#endif + tWriterLoger::tWriterLoger(){}; fsize_t tWriterLoger::shift(fsize_t len){ @@ -404,7 +409,11 @@ DBC_RETVAL_IF_FAIL(list!=NULL,0); int rvalue; +#if defined(HAVE_ALLOCA) && ! defined(__GNUC__) + char *temp = (char *) alloca(maxlen+1); +#else char temp[maxlen+1]; +#endif char *cur=temp; do { *cur=0; @@ -419,7 +428,11 @@ char *tClient::read_string(tSocket *sock,int maxlen) { DBC_RETVAL_IF_FAIL(sock!=NULL,0); +#if defined(HAVE_ALLOCA) && ! defined(__GNUC__) + char *temp = (char *) alloca(maxlen+1); +#else char temp[maxlen+1]; +#endif char *cur=temp; do { *cur=0; @@ -428,7 +441,8 @@ if (err==0 && temp==cur) return NULL; } while(cur-temp0 && read(newfd,&packet,sizeof (packet))>=0){ switch (packet.type){ case PACKET_EXIT_TIME: --- ./main/sndserv.cc Sun Jan 26 23:40:08 2003 +++ ../d4x-2.4.1/./main/sndserv.cc Sat Mar 22 10:55:28 2003 @@ -9,6 +9,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ +#include "../config.h" #include #include #include @@ -150,13 +151,8 @@ if (fread(buf, 1, 4, file) != 4) return 0; - -#if G_BYTE_ORDER == G_LITTLE_ENDIAN + // No need to handle endianisms here, since we are reading by bytes. *len =(buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; -#elif - *len =(buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; -#endif - return 1; }; @@ -164,11 +160,8 @@ unsigned char buf[2]; if (fread(buf, 1, 2, file) != 2) return 0; -#if G_BYTE_ORDER == G_LITTLE_ENDIAN + // No need to handle endianisms here, since we are reading by bytes. *val = (buf[1] << 8) | buf[0]; -#elif - *val = (buf[0] << 8) | buf[1]; -#endif return 1; } @@ -427,9 +420,13 @@ }; d4xAOAudio::~d4xAOAudio(){ - if (snd_device != NULL) + if (snd_device != NULL) { + // Some libao drivers (IRIX, for example) need a small additional time to + // flush the output buffer, otherwise the sound will be prematurely stopped. + sleep(2); ao_close(snd_device); -}; + } +} #endif //D4X_WITH_AO --- ./main/hproxy.cc Thu Jun 6 21:12:37 2002 +++ ../d4x-2.4.1/./main/hproxy.cc Sat Mar 22 10:55:28 2003 @@ -40,7 +40,7 @@ char data[MAX_LEN]; send_request("Accept: */*\r\n"); if (Offset){ - sprintf(data,"%li",Offset); + sprintf(data,"%lli",Offset); send_request("Range: bytes=",data,"-\r\n"); }; --- ./main/nt.cc Mon Dec 16 21:23:42 2002 +++ ../d4x-2.4.1/./main/nt.cc Sat Mar 22 10:55:28 2003 @@ -10,6 +10,7 @@ */ +#include "../config.h" #include #include #include --- ./main/config.cc Wed Nov 6 01:53:28 2002 +++ ../d4x-2.4.1/./main/config.cc Sat Mar 22 10:55:28 2003 @@ -27,6 +27,11 @@ #include "ntlocale.h" #include "srvclt.h" +/* On IRIX, strings.h declares index() */ +#if defined(__sgi) +#include +#endif + void get_size_of_clist(); tOption downloader_parsed_args[]={ --- ./main/cookie.cc Wed Nov 6 01:53:28 2002 +++ ../d4x-2.4.1/./main/cookie.cc Sat Mar 22 10:55:28 2003 @@ -22,6 +22,11 @@ #include #include +/* On IRIX, strings.h declares index() */ +#if defined(__sgi) +#include +#endif + /* determine which cookies file is newer Netscape or Mozilla's one It's allowed to use non reentrant variance of readdir() cos here's first place where readdir() is used --- ./configure Mon Jan 27 00:39:17 2003 +++ ../d4x-2.4.1/./configure Sat Mar 22 11:03:42 2003 @@ -1873,7 +1873,9 @@ ac_pthread_strict_check=no ;; *-irix*) - OS_CXXFLAGS="-fpermissive" + if test "$GCC" = yes; then + OS_CXXFLAGS="-fpermissive" + fi ;; esac @@ -12373,8 +12375,17 @@ LIBS=`echo $LIBS | sed 's/\(-lpthread\)//'` fi +# On IRIX, -lpthread must always be the last library in the list +case "$host" in + *-irix*) + LIBS="`echo $LIBS | sed 's/\(-lpthread\)//'` -lpthread" + ;; + *) + ;; +esac + # Force config.h be included before every module compilation -if test "x$ac_config_headers" != "x"; then +if test "x$ac_config_headers" != "x" -a "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -include \$(CONFIG_HEADER)" fi @@ -13805,7 +13816,11 @@ # Show our configuration # ----------------------------------------------------------------------------- # 1) calculate all what we need to display -cxx_version=`${CXX} --version | head -1` +if test "$GCC" = "yes"; then + cxx_version=`${CXX} --version | head -1` +else + cxx_version="no version info" +fi if test "$enable_esd" = "no"; then esd_spam="disabled" else