From dac2c615940521c24463882e3b5853ab5cf062ee Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Sat, 12 Feb 2011 23:16:45 -0800 Subject: [PATCH 01/15] configure: source conftest.id3 via explicit ./ path I've been getting this error from configure: checking for id3lib version... ./configure: line 11287: .: conftest.id3: file not found strace found it was not looking in ".". The bash man page says about the source command: If filename does not contain a slash, file names in PATH are used to find the directory containing file- name. When bash is not in posix mode, the current directory is searched if no file is found in PATH. Presumably this is what's happening. So include ./ in the filename to source. --- configure | 2 +- configure.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 7b6a177..a2f6aa0 100755 --- a/configure +++ b/configure @@ -11284,7 +11284,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - . conftest.id3 + . ./conftest.id3 echo "${ID3LIB_MAJOR}.${ID3LIB_MINOR}.${ID3LIB_PATCH}" else echo "$as_me: program exited with status $ac_status" >&5 diff --git a/configure.in b/configure.in index 39c4d8c..b2dc32b 100644 --- a/configure.in +++ b/configure.in @@ -110,7 +110,7 @@ main () fclose(output); exit(0); } -], . conftest.id3 +], . ./conftest.id3 echo "${ID3LIB_MAJOR}.${ID3LIB_MINOR}.${ID3LIB_PATCH}", AC_MSG_WARN(could not determine id3lib version),[echo $ac_n "cross compiling; assuming ${ID3LIB_MAJOR}.${ID3LIB_MINOR}.${ID3LIB_PATCH} $ac_c"]) AC_DEFINE_UNQUOTED(ID3LIB_MAJOR, $ID3LIB_MAJOR, [Description]) From 415130ee469c8f55c27ad3572ec7b8574e08a215 Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Mon, 31 Aug 2015 20:45:03 -0700 Subject: [PATCH 02/15] tray.c: include more headers for more prototypes --- po/grip-2.2.pot | 2 +- src/tray.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/po/grip-2.2.pot b/po/grip-2.2.pot index f86bada..75dd0f6 100644 --- a/po/grip-2.2.pot +++ b/po/grip-2.2.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-03 22:20-0800\n" +"POT-Creation-Date: 2015-08-31 20:10-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/src/tray.c b/src/tray.c index 49e802d..ae31925 100644 --- a/src/tray.c +++ b/src/tray.c @@ -22,6 +22,8 @@ #include "tray.h" #include "common.h" +#include "cdplay.h" +#include "rip.h" #include "../pixmaps/rip1.xpm" #include "../pixmaps/menuplay.xpm" #include "../pixmaps/menupause.xpm" From d0e2371cd2ab589a17e54ed95ed7adcd881addaf Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Mon, 31 Aug 2015 20:45:24 -0700 Subject: [PATCH 03/15] tray.c: use g_strdup("") instead of g_strdup_printf("") gcc issues a warning about the latter. --- src/tray.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tray.c b/src/tray.c index ae31925..ab78c15 100644 --- a/src/tray.c +++ b/src/tray.c @@ -84,8 +84,8 @@ void UpdateTray(GripInfo *ginfo) } else if (!ginfo->playing) { if (ginfo->ripping || ginfo->encoding) { TrayGrayMenu(ginfo); - riptext = (ginfo->ripping) ? g_strdup_printf(_("Ripping Track %02d:\t%6.2f%% (%6.2f%% )"), ginfo->rip_track + 1, ginfo->rip_percent * 100, ginfo->rip_tot_percent * 100) : g_strdup_printf(""); - enctext = (ginfo->encoding) ? g_strdup_printf(_("Encoding Track %02d:\t%6.2f%% (%6.2f%% )"), ginfo->mp3_enc_track[0] + 1, ginfo->enc_percent * 100, ginfo->enc_tot_percent * 100) : g_strdup_printf(""); + riptext = (ginfo->ripping) ? g_strdup_printf(_("Ripping Track %02d:\t%6.2f%% (%6.2f%% )"), ginfo->rip_track + 1, ginfo->rip_percent * 100, ginfo->rip_tot_percent * 100) : g_strdup(""); + enctext = (ginfo->encoding) ? g_strdup_printf(_("Encoding Track %02d:\t%6.2f%% (%6.2f%% )"), ginfo->mp3_enc_track[0] + 1, ginfo->enc_percent * 100, ginfo->enc_tot_percent * 100) : g_strdup(""); text = g_strdup_printf(_("%s - %s\n%s%s%s"), artist, title, riptext, (ginfo->ripping && ginfo->encoding) ? "\n" : "", enctext); } else { TrayUnGrayMenu(ginfo); From 56ca2d673714b84ec221ca5872721857ae3de45c Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Mon, 31 Aug 2015 20:49:03 -0700 Subject: [PATCH 04/15] tray.c: fix (gboolean)gpointer cast warning --- src/tray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tray.c b/src/tray.c index ab78c15..521bd73 100644 --- a/src/tray.c +++ b/src/tray.c @@ -131,7 +131,7 @@ void TrayMenuShowPause(GripInfo *ginfo) static void ToggleMenuItemSensitive(GtkWidget *widget, gpointer data) { - gtk_widget_set_sensitive(GTK_WIDGET(widget), (gboolean)data); + gtk_widget_set_sensitive(GTK_WIDGET(widget), (data != NULL)); } void TrayGrayMenu(GripInfo *ginfo) From 1da64a888b714295f162855c72e917db44328e78 Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Mon, 31 Aug 2015 21:06:13 -0700 Subject: [PATCH 05/15] cddev.c: cast g_object_unref to GFunc for g_list_foreach() Seems crazy, but that's what the internet suggests. --- src/cddev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cddev.c b/src/cddev.c index 03b73b2..9e9f3d9 100644 --- a/src/cddev.c +++ b/src/cddev.c @@ -851,7 +851,7 @@ GVolume *GripGetVolumeByPath(gchar *device_name) // Cleanup list = g_list_first(list); - g_list_foreach(list, g_object_unref, NULL); + g_list_foreach(list, (GFunc)g_object_unref, NULL); g_list_free(list); } From 9f7bc6ea370452fbf9f6ccf48672240873fc9e6f Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Mon, 31 Aug 2015 21:07:38 -0700 Subject: [PATCH 06/15] cdplay.c: remove unused variables --- src/cdplay.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/cdplay.c b/src/cdplay.c index 65c40a4..c252bd1 100644 --- a/src/cdplay.c +++ b/src/cdplay.c @@ -145,21 +145,16 @@ void LookupDisc(GripInfo *ginfo,gboolean manual) static void DoLookup(void *data) { GripInfo *ginfo; - gboolean discdb_found=FALSE; ginfo=(GripInfo *)data; if(!DiscDBLookupDisc(ginfo,&(ginfo->dbserver))) { if(*(ginfo->dbserver2.name)) { if(DiscDBLookupDisc(ginfo,&(ginfo->dbserver2))) { - discdb_found=TRUE; ginfo->ask_submit=TRUE; } } } - else { - discdb_found=TRUE; - } if(ginfo->ddata.data_id3genre==-1) ginfo->ddata.data_id3genre=DiscDB2ID3(ginfo->ddata.data_genre); @@ -597,10 +592,8 @@ static void SelectionChanged(GtkTreeSelection *selection,gpointer data) GtkTreeModel *model; int row=-1; GripInfo *ginfo; - GripGUI *uinfo; ginfo=(GripInfo *)data; - uinfo=&(ginfo->gui_info); if(gtk_tree_selection_get_selected(selection,&model,&iter)) { gtk_tree_model_get(model,&iter,TRACKLIST_NUM_COL,&row,-1); From 64982f66f8c96f2a6a295fd96fe5be0364a9ac79 Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Mon, 31 Aug 2015 21:08:15 -0700 Subject: [PATCH 07/15] cdplay: #include tray.h for TrayMenuShowPlay/Pause --- src/cdplay.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cdplay.c b/src/cdplay.c index c252bd1..c8f65ad 100644 --- a/src/cdplay.c +++ b/src/cdplay.c @@ -29,6 +29,7 @@ #include "discedit.h" #include "dialog.h" #include "rip.h" +#include "tray.h" #include "grip_id3.h" static void ShutDownCB(GtkWidget *widget,gpointer data); From abdaf9b1bba8584c87eb5bb3ac1a7423c8cf8f71 Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Mon, 31 Aug 2015 21:11:18 -0700 Subject: [PATCH 08/15] discdb.c: tag StrConvertEncoding()'s to/from params with "const" They are not modified, and this addresses a compiler warning. --- src/discdb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/discdb.c b/src/discdb.c index 2be0d6f..1fe5250 100644 --- a/src/discdb.c +++ b/src/discdb.c @@ -45,10 +45,10 @@ #include "config.h" extern char *Program; -static char *StrConvertEncoding(char *str,char *from,char *to,int max_len); +static char *StrConvertEncoding(char *str,const char *from,const char *to,int max_len); gboolean DiscDBUTF8Validate(const DiscInfo *disc,const DiscData *data); static void DiscDBConvertEncoding(DiscInfo *disc,DiscData *data, - char *from,char *to); + const char *from,const char *to); static int DiscDBSum(int val); static char *DiscDBReadLine(char **dataptr); static GString *DiscDBMakeURI(DiscDBServer *server,DiscDBHello *hello, @@ -496,7 +496,7 @@ static void DiscDBProcessLine(char *inbuffer,DiscData *data, } } -static char *StrConvertEncoding(char *str,char *from,char *to,int max_len) +static char *StrConvertEncoding(char *str,const char *from,const char *to,int max_len) { char *conv_str; gsize rb,wb; @@ -541,7 +541,7 @@ gboolean DiscDBUTF8Validate(const DiscInfo *disc,const DiscData *data) static void DiscDBConvertEncoding(DiscInfo *disc,DiscData *data, - char *from,char *to) + const char *from,const char *to) { int track; From 09da5f84b87ca7ea5d461444c03179d634669260 Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Mon, 31 Aug 2015 21:15:30 -0700 Subject: [PATCH 09/15] grip.c: remove unused variable x --- src/grip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grip.c b/src/grip.c index 629bb1f..8d6fe51 100644 --- a/src/grip.c +++ b/src/grip.c @@ -638,7 +638,7 @@ static void Homepage(void) // Open link in browser. // Plug link into '%s'. cmd = (gchar *)malloc(sizeof(gchar)*(strlen(browser)+strlen(link))); - int x = sprintf(cmd, browser, link); + sprintf(cmd, browser, link); system(cmd); } From 2bc37f932509ead6338ae97a427331ddcb236ee7 Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Mon, 31 Aug 2015 21:18:34 -0700 Subject: [PATCH 10/15] launch.c: add parens to silence compiler warning --- src/launch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/launch.c b/src/launch.c index b60d394..41ffed8 100644 --- a/src/launch.c +++ b/src/launch.c @@ -204,7 +204,7 @@ char *MungeString(char *str,StrTransPrefs *prefs) utf8_char[utf8_char_len]='\0'; filename_char=g_filename_from_utf8(utf8_char,-1,&rb,&wb,NULL); g_free(filename_char); - if (!filename_char || !prefs->allow_high_bits && *c >> 7) { + if (!filename_char || (!prefs->allow_high_bits && *c >> 7)) { if (prefs->escape) { g_snprintf(escape,11,"(%x)",*c); dst=ReallocStrcat(dst,escape); From f90d2c6e0b1a1d189a877968db2d3fba614f1e67 Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Mon, 31 Aug 2015 21:19:28 -0700 Subject: [PATCH 11/15] launch.c: remove allocated but unused (and unfreed) variable str --- src/launch.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/launch.c b/src/launch.c index 41ffed8..eb497b3 100644 --- a/src/launch.c +++ b/src/launch.c @@ -283,14 +283,11 @@ void TranslateAndLaunch(char *cmd,char *(*trans_func)(char,void *,gboolean *), StrTransPrefs *prefs,void (*close_func)(void *), void *close_user_data) { - GString *str; GString *args[100]; char *char_args[21]; int pid; int arg; - str=g_string_new(NULL); - MakeTranslatedArgs(cmd,args,100,trans_func,user_data,do_munge_default,prefs); /* From f19e95f7259163260d1638a3f56c5a09354dde1b Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Mon, 31 Aug 2015 21:20:42 -0700 Subject: [PATCH 12/15] main.c Debug(): add explicit format string to g_printerr() --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 3629b07..6fe3a25 100644 --- a/src/main.c +++ b/src/main.c @@ -140,7 +140,7 @@ void Debug(char *fmt,...) msg=g_strdup_vprintf(fmt,args); if(msg) { - g_printerr(msg); + g_printerr("%s", msg); g_free(msg); } } From d3fb89e164df0fba5bf7490c3d21f046b925f31d Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Sat, 26 Sep 2015 10:47:55 -0700 Subject: [PATCH 13/15] CDPCallback: remove unused variables --- src/cdpar.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/cdpar.c b/src/cdpar.c index a9647b0..0a1b550 100644 --- a/src/cdpar.c +++ b/src/cdpar.c @@ -107,12 +107,10 @@ static void WriteWav(int f,long bytes) static void CDPCallback(long inpos,int function) { - static long c_sector=0,v_sector=0; - static int last=0; + static long c_sector=0; static long lasttime=0; long sector,osector=0; struct timeval thistime; - static char heartbeat=' '; static int overlap=0; static int slevel=0; static int slast=0; @@ -123,15 +121,11 @@ static void CDPCallback(long inpos,int function) sector=inpos/CD_FRAMEWORDS; if(function==-2){ - v_sector=sector; return; } if(function==-1){ - last=8; - heartbeat='*'; slevel=0; - v_sector=sector; } else switch(function){ case PARANOIA_CB_VERIFY: @@ -184,30 +178,8 @@ static void CDPCallback(long inpos,int function) if(lasttime!=test || function==-1 || slast!=slevel){ if(lasttime!=test || function==-1){ - last++; lasttime=test; - if(last>7)last=0; stimeout++; - switch(last){ - case 0: - heartbeat=' '; - break; - case 1:case 7: - heartbeat='.'; - break; - case 2:case 6: - heartbeat='o'; - break; - case 3:case 5: - heartbeat='0'; - break; - case 4: - heartbeat='O'; - break; - } - - if(function==-1) - heartbeat='*'; } if(slast!=slevel){ From 25da3f56c7ad01fe3959c2caf282f8ae4e2067e1 Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Sat, 26 Sep 2015 10:54:54 -0700 Subject: [PATCH 14/15] LoadRipperConfig: return 0 instead of nothing. (The case shouldn't happen anyway.) --- src/gripcfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gripcfg.c b/src/gripcfg.c index ee75104..4f74f6f 100644 --- a/src/gripcfg.c +++ b/src/gripcfg.c @@ -804,7 +804,7 @@ gboolean LoadRipperConfig(GripInfo *ginfo,int ripcfg) }; #ifdef CDPAR - if(ripcfg==0) return; + if(ripcfg==0) return 0; #endif sprintf(buf,"%s/%s-%s",getenv("HOME"),ginfo->config_filename, From 7ce1cd244db470e4b8dfdaa6d33d583f0cb0971a Mon Sep 17 00:00:00 2001 From: Paul Cassella Date: Sat, 26 Sep 2015 10:56:00 -0700 Subject: [PATCH 15/15] gripfg.c: remove unused encoder_cfg_entries --- src/gripcfg.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/gripcfg.c b/src/gripcfg.c index 4f74f6f..da9fb6b 100644 --- a/src/gripcfg.c +++ b/src/gripcfg.c @@ -63,13 +63,6 @@ static MP3Encoder encoder_defaults[]={{"bladeenc","-%b -QUIT %w %m","mp3"}, {"",""} }; -static CFGEntry encoder_cfg_entries[]={ - {"name",CFG_ENTRY_STRING,256,NULL}, - {"cmdline",CFG_ENTRY_STRING,256,NULL}, - {"exe",CFG_ENTRY_STRING,256,NULL}, - {"extension",CFG_ENTRY_STRING,10,NULL} -}; - static void UseProxyChanged(GtkWidget *widget,gpointer data) { GripInfo *ginfo;