From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 7 Oct 2001 21:26:54 +0000 (+0200)
Subject: patch::: 1.5.15.jcn1
X-Git-Tag: release/1.5.16~1
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=107ed06920290e5347bca0e683a75cc7834b1a4a;p=lilypond.git

patch::: 1.5.15.jcn1

1.5.15.jcn1
===========

* Fixes for latest guile cvs.

* Add --enable-optimising flag to configure (Huh?).

* Only inline string utlis when optimising.

* Compile fix.

1.5.15
======
---

diff --git a/CHANGES b/CHANGES
index f2a922ccbd..8f29695d35 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,17 @@
+1.5.15.jcn1
+===========
+
+* Fixes for latest guile cvs.
+
+* Add --enable-optimising flag to configure (Huh?).
+
+* Only inline string utlis when optimising.
+
+* Compile fix.
+
+1.5.15
+======
+
 1.5.14.jcn6
 ===========
 
diff --git a/VERSION b/VERSION
index f5c31f1b08..e5b6a8e318 100644
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
 PATCH_LEVEL=15
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/aclocal.m4 b/aclocal.m4
index 1cf59b1171..3003cbd938 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -31,6 +31,10 @@ AC_DEFUN(AC_STEPMAKE_COMPILE, [
     [  --enable-debugging      compile with debugging info.  Default: on],
     [debug_b=$enableval])
 
+    AC_ARG_ENABLE(optimising,
+    [  --enable-optimising      compile with optimising.  Default: on],
+    [optimise_b=$enableval])
+
     AC_ARG_ENABLE(profiling, 
     [  --enable-profiling      compile with gprof support.  Default: off],
     [profile_b=$enableval])
diff --git a/configure.in b/configure.in
index e0fa5a2f5d..e64d0e859d 100644
--- a/configure.in
+++ b/configure.in
@@ -17,9 +17,6 @@ AC_STEPMAKE_COMPILE
 AC_HAVE_HEADERS(assert.h sys/stat.h)
 AC_HEADER_STAT
 
-DEFINES="$DEFINES -DSTRING_UTILS_INLINED"
-AC_DEFINE(STRINGS_UTILS_INLINED)
-
 AC_STEPMAKE_CXX
 AC_STEPMAKE_GXX
 AC_STEPMAKE_CXXTEMPLATE
@@ -34,6 +31,13 @@ AC_STEPMAKE_GUILE
 AC_STEPMAKE_KPATHSEA
 AC_STEPMAKE_BIBTEX2HTML
 
+
+if test "$optimise_b" = yes; then
+    DEFINES="$DEFINES -DSTRING_UTILS_INLINED"
+    AC_DEFINE(STRINGS_UTILS_INLINED)
+fi
+
+
 dnl should check out -print
 dnl huh?
 dnl AC_CHECK_SEARCH_RESULT($FIND, find, Please use --enable-tex-dir)
diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc
index e613c2041c..f554b13f9d 100644
--- a/lily/lily-guile.cc
+++ b/lily/lily-guile.cc
@@ -11,8 +11,8 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <math.h>		// isinf
-
+#include <math.h>   /* isinf */
+#include <string.h> /* strdup, strchr */
 #include "libc-extension.hh"
 #include "lily-guile.hh"
 #include "main.hh"
@@ -391,7 +391,7 @@ ly_number2string (SCM s)
 
   char str[400];			// ugh.
 
-  if (scm_integer_p (s) == SCM_BOOL_F)
+  if (scm_exact_p (s) == SCM_BOOL_F)
     {
       Real r (gh_scm2double (s));
 
diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc
index 157115741b..4c1f865fd2 100644
--- a/lily/paper-outputter.cc
+++ b/lily/paper-outputter.cc
@@ -172,7 +172,7 @@ Paper_outputter::output_scope (Scope *scope, String prefix)
 	{
 	  output_String_def (prefix + s, ly_scm2string (v));
 	}
-      else if (scm_integer_p (v) == SCM_BOOL_T)
+      else if (scm_exact_p (v) == SCM_BOOL_T)
 	{
 	  output_int_def (prefix + s, gh_scm2int (v));	  
 	}
diff --git a/modules/midi.c b/modules/midi.c
index 1228d1c50f..28216e66b7 100644
--- a/modules/midi.c
+++ b/modules/midi.c
@@ -286,8 +286,8 @@ midi_parse_track (unsigned char **track, unsigned char *track_end)
 #endif
 
   debug_print ("%s", "\n");
-  if (!strcmp (*track, "MTrk"))
-    return midi_error ("parse_track(): MTrk expected");
+  if (strcmp (*track, "MTrk"))
+    return midi_error (__FUNCTION__ ": MTrk expected");
   
   *track += 4;
 
@@ -299,7 +299,8 @@ midi_parse_track (unsigned char **track, unsigned char *track_end)
   debug_print ("track begin: %p\n", track);
   debug_print ("track end: %p\n", track + track_len);
   
-  //assert (track_len <= track_size);
+  if (track_len > track_size)
+    return midi_error (__FUNCTION__ ": track size corrupt");
 
   pytrack = PyList_New (0);
 
@@ -341,7 +342,7 @@ pymidi_parse_track (PyObject *self, PyObject *args)
     return 0;
 
   if (track_size < 0)
-    return midi_error ("negative track size");
+    return midi_error (__FUNCTION__  ": negative track size");
 
   track_end = track + track_size;
   
@@ -364,13 +365,13 @@ midi_parse (unsigned char **midi,unsigned  char *midi_end)
 
   
   if (header_len < 6)
-    return midi_error ("header too short");
+    return midi_error (__FUNCTION__ ": header too short");
     
   format = get_number (midi, *midi + 2, 2);
   tracks = get_number (midi, *midi + 2, 2);
 
   if (tracks > 32)
-    return midi_error ("too many tracks");
+    return midi_error (__FUNCTION__ ": too many tracks");
   
   division = get_number (midi, *midi + 2, 2) * 4;
 
@@ -404,7 +405,7 @@ pymidi_parse (PyObject *self, PyObject *args)
     return 0;
 
   if (strcmp (midi, "MThd"))
-      return midi_error ("MThd expected");
+      return midi_error (__FUNCTION__ ": MThd expected");
   
   midi += 4;
 
diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4
index 1cf59b1171..3003cbd938 100644
--- a/stepmake/aclocal.m4
+++ b/stepmake/aclocal.m4
@@ -31,6 +31,10 @@ AC_DEFUN(AC_STEPMAKE_COMPILE, [
     [  --enable-debugging      compile with debugging info.  Default: on],
     [debug_b=$enableval])
 
+    AC_ARG_ENABLE(optimising,
+    [  --enable-optimising      compile with optimising.  Default: on],
+    [optimise_b=$enableval])
+
     AC_ARG_ENABLE(profiling, 
     [  --enable-profiling      compile with gprof support.  Default: off],
     [profile_b=$enableval])