diff options
author | tg <tg@FreeBSD.org> | 2002-08-15 20:24:15 +0800 |
---|---|---|
committer | tg <tg@FreeBSD.org> | 2002-08-15 20:24:15 +0800 |
commit | 19337816c9574424b88a4a3d067e9905d750798e (patch) | |
tree | affbb8b761179a8ed9fedf8aac9cfc31fe39582f /audio | |
parent | 47f1d7ae2d4b6d50fda64f9dff7550285a326ed3 (diff) | |
download | freebsd-ports-gnome-19337816c9574424b88a4a3d067e9905d750798e.tar.gz freebsd-ports-gnome-19337816c9574424b88a4a3d067e9905d750798e.tar.zst freebsd-ports-gnome-19337816c9574424b88a4a3d067e9905d750798e.zip |
Use 32 bit unsigned types to be able to work on longer files.
Reviewed by: Yoichi Imai <yoichi@silver-forest.com> (author)
Approved by: Steve Coltrin <spcoltri@omcl.org> (maintainer)
Diffstat (limited to 'audio')
-rw-r--r-- | audio/gnowavcut/Makefile | 1 | ||||
-rw-r--r-- | audio/gnowavcut/files/patch-src:main.h | 20 | ||||
-rw-r--r-- | audio/gnowavcut/files/patch-src:split.c | 69 | ||||
-rw-r--r-- | audio/gnowavcut/files/patch-src:split.h | 13 | ||||
-rw-r--r-- | audio/gnowavcut/files/patch-src:timelist.c | 20 | ||||
-rw-r--r-- | audio/gnowavcut/files/patch-src:utils.c | 61 |
6 files changed, 184 insertions, 0 deletions
diff --git a/audio/gnowavcut/Makefile b/audio/gnowavcut/Makefile index 7be60d677f3f..f7e44608f284 100644 --- a/audio/gnowavcut/Makefile +++ b/audio/gnowavcut/Makefile @@ -7,6 +7,7 @@ PORTNAME= gnowavcut PORTVERSION= 0.0.7 +PORTREVISION= 1 CATEGORIES= audio gnome MASTER_SITES= http://gnowavcut.good-day.net/src/ diff --git a/audio/gnowavcut/files/patch-src:main.h b/audio/gnowavcut/files/patch-src:main.h new file mode 100644 index 000000000000..eef6902e127e --- /dev/null +++ b/audio/gnowavcut/files/patch-src:main.h @@ -0,0 +1,20 @@ +--- src/main.h~ Sat Jun 2 12:15:39 2001 ++++ src/main.h Tue Apr 23 21:16:13 2002 +@@ -30,7 +30,7 @@ + + typedef struct _WaveInfo { + char id_riff[4]; +- int riff_size; ++ guint32 riff_size; + char type_riff[4]; + char id_fmt[4]; + int fmt_size; +@@ -41,7 +41,7 @@ + short int size_per_sample; + short int bits_per_sample; + char id_data[4]; +- int data_size; ++ guint32 data_size; + } WaveInfo; + + typedef struct _Buttons { diff --git a/audio/gnowavcut/files/patch-src:split.c b/audio/gnowavcut/files/patch-src:split.c new file mode 100644 index 000000000000..206cb27a2d51 --- /dev/null +++ b/audio/gnowavcut/files/patch-src:split.c @@ -0,0 +1,69 @@ +--- src/split.c~ Mon Aug 20 17:34:37 2001 ++++ src/split.c Wed Apr 24 09:59:58 2002 +@@ -42,17 +42,17 @@ + static void split_dialog_clicked_cb(GtkWidget *widget, gint button_number, gpointer data); + static void split_create_dialog(SplitDialog *sdialog); + static void split_write(SplitDialog *sdialog); +-static void split_set_wave_header(WaveInfo *dest_info, WaveInfo *base_info, int data_size); ++static void split_set_wave_header(WaveInfo *dest_info, WaveInfo *base_info, guint32 data_size); + static SplitStatus split_write_loop(SplitDialog *sdialog); + static void split_update_progress_all(SplitDialog *sdialog, int file_num); +-static void split_update_progress_file(SplitDialog *sdialog, int start, int end, int cur); ++static void split_update_progress_file(SplitDialog *sdialog, guint32 start, guint32 end, guint32 cur); + static SplitStatus split_write_wave(SplitDialog *sdialog, gchar *base_file_name, int old_fd, WaveInfo *wi, TimeData *time); + static SplitStatus split_write_wave_with_filtering(SplitDialog *sdialog, gchar *base_file_name, int old_fd, WaveInfo *wi, TimeData *time_data); + static void split_start(GnoWavCut *gnowavcut, gboolean use_filter); +-static void split_update_progress_file(SplitDialog *sdialog, int start, int end, int cur) ++static void split_update_progress_file(SplitDialog *sdialog, guint32 start, guint32 end, guint32 cur) + { + gchar *label_text; +- int total_size, now_size; ++ guint32 total_size, now_size; + gfloat total_mbyte, now_mbyte; + gfloat ratio; + +@@ -105,7 +105,7 @@ + + g_free(file_text); + } +-static void split_set_wave_header(WaveInfo *dest_info, WaveInfo *base_info, int data_size) ++static void split_set_wave_header(WaveInfo *dest_info, WaveInfo *base_info, guint32 data_size) + { + strncpy(dest_info->id_riff, "RIFF", 4); + +@@ -133,7 +133,7 @@ + gchar *file_name; + int new_fd; + WORD buf[BUFFER]; +- int now_point, len; ++ guint32 now_point, len; + + file_name = g_strdup_printf("%s.%s", base_file_name, WAVE_FILE_SUFFIX); + new_fd = open(file_name, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +@@ -189,7 +189,7 @@ + gchar *file_name; + int new_fd; + WORD buf[BUFFER]; +- int now_point, len; ++ guint32 now_point, len; + + int pipe_fd[2]; + int pid; +@@ -277,7 +277,7 @@ + int old_fd; + GSList *timelist, *cur; + WaveInfo wi; +- int data_size; ++ guint32 data_size; + int file_num; + gchar *base_file_name; + TimeData *time_data; +@@ -430,7 +430,7 @@ + static gboolean split_create_list(GnoWavCut *gnowavcut, SplitDialog *sdialog) + { + gchar *s_start, *s_end; +- int start, end, i; ++ guint32 start, end, i; + TimeData *time_data; + GtkWidget *clist; + diff --git a/audio/gnowavcut/files/patch-src:split.h b/audio/gnowavcut/files/patch-src:split.h new file mode 100644 index 000000000000..386c6b439757 --- /dev/null +++ b/audio/gnowavcut/files/patch-src:split.h @@ -0,0 +1,13 @@ +--- src/split.h~ Mon Aug 20 13:39:26 2001 ++++ src/split.h Wed Apr 24 09:53:38 2002 +@@ -26,8 +26,8 @@ + } SplitStatus; + + typedef struct _TimeData { +- int start; +- int end; ++ guint32 start; ++ guint32 end; + } TimeData; + + typedef struct _SplitDialog { diff --git a/audio/gnowavcut/files/patch-src:timelist.c b/audio/gnowavcut/files/patch-src:timelist.c new file mode 100644 index 000000000000..2cfc2ba21b12 --- /dev/null +++ b/audio/gnowavcut/files/patch-src:timelist.c @@ -0,0 +1,20 @@ +--- src/timelist.c~ Sat Jan 20 17:09:59 2001 ++++ src/timelist.c Tue Apr 23 21:39:09 2002 +@@ -87,7 +87,7 @@ + void timelist_end_cb(GtkWidget *widget, gpointer data) + { + GnoWavCut *gnowavcut; +- int wave_end; ++ guint32 wave_end; + gchar *tmp; + + gnowavcut = (GnoWavCut *)data; +@@ -150,7 +150,7 @@ + GnoWavCut *gnowavcut; + gchar *clist_item[2]; + gchar *tmp; +- int start, end; ++ guint32 start, end; + + gnowavcut = (GnoWavCut *)data; + diff --git a/audio/gnowavcut/files/patch-src:utils.c b/audio/gnowavcut/files/patch-src:utils.c new file mode 100644 index 000000000000..76035708f791 --- /dev/null +++ b/audio/gnowavcut/files/patch-src:utils.c @@ -0,0 +1,61 @@ +--- src/utils.c~ Mon Aug 20 17:22:14 2001 ++++ src/utils.c Tue Apr 23 21:36:11 2002 +@@ -41,7 +41,7 @@ + gtk_widget_show(gnome_message_box_new(msg, GNOME_MESSAGE_BOX_WARNING, GNOME_STOCK_BUTTON_OK, + NULL)); + } +-gchar *utils_get_time_from_seconds(int in_sec) ++gchar *utils_get_time_from_seconds(guint32 in_sec) + { + int sec; + int min; +@@ -54,12 +54,12 @@ + + return time; + } +-gchar *utils_get_mini_time_from_cur(WaveInfo *wave_info, int cur) ++gchar *utils_get_mini_time_from_cur(WaveInfo *wave_info, guint32 cur) + { +- int i, j; +- int micro; +- int sec; +- int min; ++ guint32 i, j; ++ guint32 micro; ++ guint32 sec; ++ guint32 min; + gchar *time; + + i = (cur - WAVE_HEADER_SIZE) / wave_info->size_per_sec; +@@ -75,16 +75,16 @@ + return time; + } + +-gboolean utils_get_cur_from_mini_time(WaveInfo *wave_info, gchar *time_in, int *cur_out) ++gboolean utils_get_cur_from_mini_time(WaveInfo *wave_info, gchar *time_in, guint32 *cur_out) + { +- int cur; ++ guint32 cur; + gchar *s_sec; + gchar *s_msec; + gchar *endptr; + gchar *time; +- long l_min; +- long l_sec; +- long l_msec; ++ guint32 l_min; ++ guint32 l_sec; ++ guint32 l_msec; + + if(cur_out != NULL) + *cur_out = 0; +@@ -99,7 +99,8 @@ + g_free(time); + return FALSE; + } +- if(l_min > INT_MAX / 61 / wave_info->size_per_sec || l_min < 0) { ++ /* Should be G_UINT32MAX (or similar), but glib doesn't provide that. */ ++ if(l_min > UINT_MAX / 61 / wave_info->size_per_sec || l_min < 0) { + g_warning(_("get_cur_from_mini_time error, min is too large or too small.\n")); + g_free(time); + return FALSE; |