OSDN Git Service

TiMidity++-2.8.1
authorMasanao Izumo <mo@goice.co.jp>
Mon, 29 Nov 1999 02:59:44 +0000 (11:59 +0900)
committerMasanao Izumo <mo@goice.co.jp>
Mon, 29 Nov 1999 02:59:44 +0000 (11:59 +0900)
14 files changed:
ChangeLog
NEWS
configs/msc-config.h
configure
configure.in
interface/gtk_c.c
interface/motif_c.c
interface/w32g_i.c
interface/w32g_ini.c
interface/w32g_utl.c
interface/wrdt_wcon.c
interface/xaw_c.c
timidity/playmidi.c
timidity/timidity.c

index dd19f8c..002398c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+1999-11-29  Masanao Izumo <mo@goice.co.jp>
+
+    * Version 2.8.1 released.
+
+1999-11-29  Masanao Izumo <mo@goice.co.jp>
+
+    * timidity/timidity.c,interface/{gtk_c.c,motif_c.c,w32g_i.c,w32g_util.c,
+      w32g_ini.c,wrdt_wcon.c,xaw_c.c}:  Bug fixes about overrunning in strncpy.
+
+1999-11-24  Masanao Izumo <mo@goice.co.jp>
+
+    * configure.in: Fix typoes
+
+1999-11-19  Eric A. Welsh <ewelsh@gpc.wustl.edu>
+
+    * timidity/playmidi.c (reduce_voice_CPU):  Obsoleted.  Use reduce_voice()
+      instead of reduce_voice_CPU().
+
 1999-11-24  Masanao Izumo <mo@goice.co.jp>
 
     * Version 2.8.0 released.
@@ -45,7 +63,7 @@
       wave interpolation in resampling.
        --enable-spline=linear          Linear interpolation (default)
        --enable-spline=cubic           Cubic interpolation
-       --enable-spline=lanrange        Langrange interpolation
+       --enable-spline=lagrange        Lagrange interpolation
        --enable-spline=no              No interplation
 
 1999-11-12  Masanao Izumo <mo@goice.co.jp>
diff --git a/NEWS b/NEWS
index 634a767..2296482 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+11/29, 1999
+    * Version 2.8.1 released.
+
 11/24, 1999
     * Version 2.8.0 released.
     * In GTK, added support for printing the lyrics from .kar files
@@ -13,7 +16,7 @@
     * New configure option to choose wave interpolation in resampling.
        --with-spline=linear    Linear interpolation (default)
        --with-spline=cubic     Cubic interpolation
-       --with-spline=lanrange  Langrange interpolation
+       --with-spline=lagrange  Lagrange interpolation
        --with-spline=no        No interplation
     * New command line option `-m N' to specify sustain time (msec).
        -m 1    Effectively behaves as if all sustains are ignored,
index 805931f..b9bfac1 100644 (file)
 #define HAVE_MMSYSTEM_H\r
 \r
 /* In VDS Macro AAA=BBB is not available. */\r
-#define TIMID_VERSION  "2.8.0"\r
+#define TIMID_VERSION  "2.8.1"\r
 #define DEFAULT_PATH   ".\\"\r
 #define AU_W32\r
 #define WINSOCK\r
index 2f93753..2a497cc 100755 (executable)
--- a/configure
+++ b/configure
@@ -110,7 +110,7 @@ ac_help="$ac_help
 ac_help="$ac_help
   --enable-spectrogram    Enable Sound Spectrogram Viewer (default is no)"
 ac_help="$ac_help
-  --enable-spline=[method]  Specify spline method: no|linear|cubic|lanrange
+  --enable-spline=[method]  Specify spline method: no|linear|cubic|lagrange
                                                           (default is linear)"
 ac_help="$ac_help
   --enable-wrd            Enable WRD interface for X      (default is no)"
@@ -884,7 +884,7 @@ fi
 
 PACKAGE=TiMidity++
 
-VERSION=2.8.0
+VERSION=2.8.1
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -7638,7 +7638,7 @@ if test "${enable_spline+set}" = set; then
       xcubic)
        EXTRADEFS="$EXTRADEFS -DCSPLINE_INTERPOLATION"
        ;;
-      xlanrange)
+      xlagrange)
        EXTRADEFS="$EXTRADEFS -DLAGRANGE_INTERPOLATION"
        ;;
       xno)
index 3f42bb4..39bbd3a 100644 (file)
@@ -55,7 +55,7 @@ dnl
 AC_INIT(timidity/timidity.c)
 SHELL=${CONFIG_SHELL-/bin/sh}
 AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE(TiMidity++, 2.8.0, no-define)
+AM_INIT_AUTOMAKE(TiMidity++, 2.8.1, no-define)
 
 dnl To use CONTAINS() macro (See acinclude.m4)
 CONTAINS_INIT
@@ -1223,7 +1223,7 @@ AM_CONDITIONAL(ENABLE_SOUND_SPEC, test "x$enable_spectrogram" = "xyes")
 
 dnl Wave Spline Interpolations
 AC_ARG_ENABLE(spline,
-  [  --enable-spline=[method]  Specify spline method: no|linear|cubic|lanrange
+  [  --enable-spline=[method]  Specify spline method: no|linear|cubic|lagrange
                                                           (default is linear)],
   [ case "x$enableval" in
       xlinear)
@@ -1232,7 +1232,7 @@ AC_ARG_ENABLE(spline,
       xcubic)
        EXTRADEFS="$EXTRADEFS -DCSPLINE_INTERPOLATION"
        ;;
-      xlanrange)
+      xlagrange)
        EXTRADEFS="$EXTRADEFS -DLAGRANGE_INTERPOLATION"
        ;;
       xno)
index 4617507..de9d7df 100644 (file)
@@ -387,14 +387,14 @@ ctl_lyric(int lyricid)
            }
            else
            {
-               strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf));
+               strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf) - 1);
                gtk_pipe_int_write(LYRIC_MESSAGE);
                gtk_pipe_string_write(lyric_buf);
            }
        }
        else
        {
-           strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf));
+           strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf) - 1);
            gtk_pipe_int_write(LYRIC_MESSAGE);
            gtk_pipe_string_write(lyric_buf);
        }
index 84b94d2..d275407 100644 (file)
@@ -184,14 +184,14 @@ static void ctl_lyric(int lyricid)
            }
            else
            {
-               strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf));
+               strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf) - 1);
                m_pipe_int_write(LYRIC_MESSAGE);
                m_pipe_string_write(lyric_buf);
            }
        }
        else
        {
-           strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf));
+           strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf) - 1);
            m_pipe_int_write(LYRIC_MESSAGE);
            m_pipe_string_write(lyric_buf);
        }
index 5c9f6a1..cbb339e 100644 (file)
@@ -3244,7 +3244,7 @@ static void DlgDirOpen(HWND hwnd)
        if(!itemidlist)\r
                return; /* Cancel */\r
        SHGetPathFromIDList(itemidlist, Buffer);\r
-       strncpy(biBuffer, Buffer, sizeof(biBuffer));\r
+       strncpy(biBuffer, Buffer, sizeof(Buffer) - 1);\r
     w32g_lock_open_file = 1;\r
        directory_form(Buffer);\r
     w32g_send_rc(RC_EXT_LOAD_FILE, (int32)Buffer);\r
index 37eb5c8..6ce47ef 100644 (file)
@@ -116,7 +116,7 @@ void LoadIniFile(SETTING_PLAYER *sp,  SETTING_TIMIDITY *st)
     IniGetKeyInt(INI_SEC_TIMIDITY,"opt_channel_pressure",&(st->opt_channel_pressure));\r
     IniGetKeyInt(INI_SEC_TIMIDITY,"opt_trace_text_meta_event",&(st->opt_trace_text_meta_event));\r
     IniGetKeyInt(INI_SEC_TIMIDITY,"opt_overlap_voice_allow",&(st->opt_overlap_voice_allow));\r
-    IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_default_mid",buff,sizeof(buff));\r
+    IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_default_mid",buff,sizeof(buff)-1);\r
     st->opt_default_mid = str2mID(buff);\r
     IniGetKeyInt(INI_SEC_TIMIDITY,"default_tonebank",&(st->default_tonebank));\r
     IniGetKeyInt(INI_SEC_TIMIDITY,"special_tonebank",&(st->special_tonebank));\r
@@ -134,22 +134,22 @@ void LoadIniFile(SETTING_PLAYER *sp,  SETTING_TIMIDITY *st)
     st->spectrogram_update_sec = v_float;\r
 #endif\r
     IniGetKeyIntArray(INI_SEC_TIMIDITY,"default_program",st->default_program,MAX_CHANNELS);\r
-    IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_ctl",st->opt_ctl,sizeof(st->opt_ctl));\r
+    IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_ctl",st->opt_ctl,sizeof(st->opt_ctl)-1);\r
     IniGetKeyInt(INI_SEC_TIMIDITY,"opt_realtime_playing",&(st->opt_realtime_playing));\r
     IniGetKeyInt(INI_SEC_TIMIDITY,"reduce_voice_threshold",&(st->reduce_voice_threshold));\r
-    IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_playmode",st->opt_playmode,sizeof(st->opt_playmode));\r
-    IniGetKeyStringN(INI_SEC_TIMIDITY,"OutputName",st->OutputName,sizeof(st->OutputName));\r
+    IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_playmode",st->opt_playmode,sizeof(st->opt_playmode)-1);\r
+    IniGetKeyStringN(INI_SEC_TIMIDITY,"OutputName",st->OutputName,sizeof(st->OutputName)-1);\r
     IniGetKeyInt(INI_SEC_TIMIDITY,"voices",&(st->voices));\r
     IniGetKeyInt(INI_SEC_TIMIDITY,"auto_reduce_polyphony",&(st->auto_reduce_polyphony));\r
     IniGetKeyInt32(INI_SEC_TIMIDITY,"quietchannels",(int32 *)&(st->quietchannels));\r
-    IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_qsize",st->opt_qsize,sizeof(st->opt_qsize));\r
+    IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_qsize",st->opt_qsize,sizeof(st->opt_qsize)-1);\r
     IniGetKeyInt32(INI_SEC_TIMIDITY,"modify_release",&(st->modify_release));\r
-    IniGetKeyStringN(INI_SEC_TIMIDITY,"allocate_cache_size",buff,sizeof(buff));\r
+    IniGetKeyStringN(INI_SEC_TIMIDITY,"allocate_cache_size",buff,sizeof(buff)-1);\r
     st->allocate_cache_size = str2size(buff);\r
     IniGetKeyInt(INI_SEC_TIMIDITY,"output_rate",&(st->output_rate));\r
-    IniGetKeyStringN(INI_SEC_TIMIDITY,"output_text_code",st->output_text_code,sizeof(st->output_text_code));\r
+    IniGetKeyStringN(INI_SEC_TIMIDITY,"output_text_code",st->output_text_code,sizeof(st->output_text_code)-1);\r
     IniGetKeyInt(INI_SEC_TIMIDITY,"free_instruments_afterwards",&(st->free_instruments_afterwards));\r
-    IniGetKeyStringN(INI_SEC_TIMIDITY,"out_wrd",st->opt_wrd,sizeof(st->opt_wrd));\r
+    IniGetKeyStringN(INI_SEC_TIMIDITY,"out_wrd",st->opt_wrd,sizeof(st->opt_wrd)-1);\r
 #if defined(__W32__) && defined(SMFCONV)\r
     IniGetKeyInt(INI_SEC_TIMIDITY,"opt_rcpcv_dll",&(st->opt_rcpcv_dll));\r
 #endif\r
index 19867ce..ea95d2e 100644 (file)
@@ -563,7 +563,7 @@ SaveSettingTiMidity(SETTING_TIMIDITY *st)
     if(play_mode->encoding & PE_BYTESWAP)\r
        st->opt_playmode[j++] = 'x';\r
     st->opt_playmode[j] = '\0';\r
-    strncpy(st->OutputName,OutputName,sizeof(st->OutputName));\r
+    strncpy(st->OutputName,OutputName,sizeof(st->OutputName)-1);\r
     st->voices = SetValue(voices, 1, MAX_VOICES);\r
        st->auto_reduce_polyphony = auto_reduce_polyphony;\r
     st->quietchannels = quietchannels;\r
@@ -579,11 +579,11 @@ SaveSettingTiMidity(SETTING_TIMIDITY *st)
            st->output_rate = DEFAULT_RATE;\r
     }\r
     st->output_rate = SetValue(st->output_rate,MIN_OUTPUT_RATE,MAX_OUTPUT_RATE);\r
-    strncpy(st->output_text_code,output_text_code,sizeof(st->output_text_code));\r
+    strncpy(st->output_text_code,output_text_code,sizeof(st->output_text_code)-1);\r
     st->free_instruments_afterwards = free_instruments_afterwards;\r
     st->opt_wrd[0] = wrdt->id;\r
     if(wrdt_open_opts)\r
-       strncpy(st->opt_wrd + 1, wrdt_open_opts, sizeof(st->opt_wrd) - 1);\r
+       strncpy(st->opt_wrd + 1, wrdt_open_opts, sizeof(st->opt_wrd) - 2);\r
     else\r
        st->opt_wrd[1] = '\0';\r
 #if defined(__W32__) && defined(SMFCONV)\r
@@ -745,7 +745,7 @@ void w32g_initialize(void)
 int IniVersionCheck(void)\r
 {\r
     char version[INI_MAXLEN];\r
-    if(IniGetKeyStringN(INI_SEC_PLAYER,"IniVersion",version,sizeof(version)) == 0 &&\r
+    if(IniGetKeyStringN(INI_SEC_PLAYER,"IniVersion",version,sizeof(version)-1) == 0 &&\r
        strcmp(version, IniVersion) == 0)\r
        return 1; // UnChanged\r
     return 0;\r
index f4c69c8..436b724 100644 (file)
@@ -757,7 +757,7 @@ static void borlandc_esc(char *str)
        char local[201];
        local[0] = '\033';
        local[1] = '[';
-       strncpy(local+2,str,200-2);
+       strncpy(local+2,str,sizeof(local)-3);
        local[200] = '\0';
        putstring_with_esc(local);
 }
index 3583166..235bd20 100644 (file)
@@ -263,13 +263,13 @@ static void ctl_lyric(int lyricid)
                 else if(lyric[2] == 'T')
                     snprintf(lyric_buf, sizeof(lyric_buf), "Title: %s", lyric + 3);
                 else
-                    strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf));
+                    strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf) - 1);
                 a_pipe_write_msg(lyric_buf);
                 lyric_col = 0;
             }
             else
             {
-                strncpy(lyric_buf + lyric_col, lyric + 1, sizeof(lyric_buf) - lyric_col);
+                strncpy(lyric_buf + lyric_col, lyric + 1, sizeof(lyric_buf) - lyric_col - 1);
                 a_pipe_write_msg(lyric_buf);
                 lyric_col += strlen(lyric + 1);
             }
index 0f0c460..1e4b4dd 100644 (file)
@@ -701,6 +701,11 @@ Instrument *play_midi_load_instrument(int dr, int bk, int prog)
     return ip;
 }
 
+#if 0
+/* reduce_voice_CPU() may not have any speed advantage over reduce_voice().
+ * So this function is not used, now.
+ */
+
 /* The goal of this routine is to free as much CPU as possible without
    loosing too much sound quality.  We would like to know how long a note
    has been playing, but since we usually can't calculate this, we guess at
@@ -928,6 +933,7 @@ static int reduce_voice_CPU(void)
 
     return lowest;
 }
+#endif
 
 /* this reduces voices while maintaining sound quality */
 static int reduce_voice(void)
@@ -3691,14 +3697,7 @@ static int compute_data(int32 count)
                  }
 
                  for(i = 0; i < kill_nv; i++)
-                 {
-                     v = reduce_voice_CPU();
-
-                     /* Tell VOICE_DIE to interface */
-                     voice[v].status = VOICE_DIE;
-                     ctl_note_event(v);
-                     free_voice(v);
-                 }
+                     v = reduce_voice();
 
                  /* lower max # of allowed voices to let the buffer recover */
                  if (auto_reduce_polyphony) {
index a60b7d9..afdefe1 100644 (file)
@@ -2854,7 +2854,7 @@ MAIN_INTERFACE int timidity_pre_load_configuration(void)
     extern char *ConfigFile;
     if(!ConfigFile[0])
        strcpy(ConfigFile, W32G_TIMIDITY_CFG);
-    strncpy(local, ConfigFile, sizeof(local));
+    strncpy(local, ConfigFile, sizeof(local) - 1);
 #else
     /* !IA_W32GUI */
     GetWindowsDirectory(local, 1023 - 13);
@@ -3285,7 +3285,7 @@ int main(int argc, char **argv)
 #ifdef IA_W32GUI
            {
                extern char *ConfigFile;
-               strncpy(config1, ConfigFile, sizeof(config1));
+               strncpy(config1, ConfigFile, sizeof(config1) - 1);
            }
 #else
            /* !IA_W32GUI */