lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TODO #1


From: David Brandon
Subject: Re: TODO #1
Date: Tue, 27 Apr 2004 17:58:58 -0400

On Apr 27, 2004, at 2:55 AM, Han-Wen Nienhuys wrote:

Cool, nice to see! While you're at it, can you double check that
post_incr and incr are used? If not, they can be scrapped wholesale.


Right. Here's the revised diff. It turns out that incr() is being used in one place (lily/box.cc). With this patch I included incr() and other_axis() as inline in the header, so that you can delete axis.cc. Those are the only two functions from axis.cc that were being used, and they're both small enough to be inlined.

David


Index: flower/include/axes.hh
===================================================================
RCS file: /cvsroot/lilypond/lilypond/flower/include/axes.hh,v
retrieving revision 1.12
diff -u -r1.12 axes.hh
--- flower/include/axes.hh      5 Feb 2004 14:55:17 -0000       1.12
+++ flower/include/axes.hh      27 Apr 2004 21:50:11 -0000
@@ -10,26 +10,28 @@
 #ifndef AXES_HH
 #define AXES_HH

+#include <assert.h>
+
 enum Axis {
     X_AXIS =0,
     Y_AXIS =1,
     NO_AXES=2,
 };

-
-class String;
-
-String axis_name_string (Axis);
-
-
-/**
-  the operator ++ for Axis.
- */
-Axis other_axis (Axis);
-Axis post_incr (Axis &);
-Axis incr (Axis &);
-//Axis operator++ (Axis);
-
-
+static inline
+Axis
+incr (Axis &a)
+{
+  assert (a < NO_AXES);
+  a = Axis (int (a) + 1);
+  return a;
+}
+
+static inline
+Axis
+other_axis (Axis a)
+{
+  return a ==  Y_AXIS ? X_AXIS : Y_AXIS;
+}

 #endif // AXES_HH
Index: flower/include/offset.hh
===================================================================
RCS file: /cvsroot/lilypond/lilypond/flower/include/offset.hh,v
retrieving revision 1.9
diff -u -r1.9 offset.hh
--- flower/include/offset.hh    5 Feb 2004 14:55:17 -0000       1.9
+++ flower/include/offset.hh    27 Apr 2004 21:50:11 -0000
@@ -10,6 +10,7 @@
 #include "real.hh"
 #include "axes.hh"
 #include "arithmetic-operator.hh"
+#include "string.hh"

 struct Offset;

Index: lily/box.cc
===================================================================
RCS file: /cvsroot/lilypond/lilypond/lily/box.cc,v
retrieving revision 1.12
diff -u -r1.12 box.cc
--- lily/box.cc 22 Mar 2004 22:33:57 -0000      1.12
+++ lily/box.cc 27 Apr 2004 21:50:11 -0000
@@ -8,6 +8,7 @@

 #include "box.hh"
 #include "array.hh"
+#include "axes.hh"

 void
 Box::translate (Offset o)
Index: lily/include/align-interface.hh
===================================================================
RCS file: /cvsroot/lilypond/lilypond/lily/include/align-interface.hh,v
retrieving revision 1.19
diff -u -r1.19 align-interface.hh
--- lily/include/align-interface.hh     5 Feb 2004 14:55:36 -0000       1.19
+++ lily/include/align-interface.hh     27 Apr 2004 21:50:11 -0000
@@ -10,7 +10,6 @@
 #ifndef ALIGN_INTERFACE_HH
 #define ALIGN_INTERFACE_HH

-#include "axes.hh"
 #include "lily-proto.hh"
 #include "lily-guile.hh"

Index: lily/include/bezier.hh
===================================================================
RCS file: /cvsroot/lilypond/lilypond/lily/include/bezier.hh,v
retrieving revision 1.22
diff -u -r1.22 bezier.hh
--- lily/include/bezier.hh      5 Feb 2004 14:55:37 -0000       1.22
+++ lily/include/bezier.hh      27 Apr 2004 21:50:11 -0000
@@ -11,7 +11,6 @@
 #include "real.hh"
 #include "drul-array.hh"
 #include "interval.hh"
-#include "axes.hh"
 #include "offset.hh"
 #include "array.hh"
 #include "polynomial.hh"
Index: lily/include/box.hh
===================================================================
RCS file: /cvsroot/lilypond/lilypond/lily/include/box.hh,v
retrieving revision 1.9
diff -u -r1.9 box.hh
--- lily/include/box.hh 17 Jan 2004 13:13:03 -0000      1.9
+++ lily/include/box.hh 27 Apr 2004 21:50:11 -0000
@@ -9,8 +9,6 @@
 #include "real.hh"
 #include "interval.hh"
 #include "offset.hh"
-#include "axes.hh"
-

 struct Box
 {
Index: lily/include/stencil.hh
===================================================================
RCS file: /cvsroot/lilypond/lilypond/lily/include/stencil.hh,v
retrieving revision 1.5
diff -u -r1.5 stencil.hh
--- lily/include/stencil.hh     21 Mar 2004 00:01:52 -0000      1.5
+++ lily/include/stencil.hh     27 Apr 2004 21:50:11 -0000
@@ -11,7 +11,6 @@
 #include <stdlib.h>              // size_t
 #include "lily-proto.hh"
 #include "box.hh"
-#include "axes.hh"
 #include "direction.hh"
 #include "lily-guile.hh"
 #include "smobs.hh"
Index: stepmake/stepmake/c++-rules.make
===================================================================
RCS file: /cvsroot/lilypond/lilypond/stepmake/stepmake/c++-rules.make,v
retrieving revision 1.9
diff -u -r1.9 c++-rules.make
--- stepmake/stepmake/c++-rules.make    18 Sep 2003 10:05:05 -0000      1.9
+++ stepmake/stepmake/c++-rules.make    27 Apr 2004 21:50:12 -0000
@@ -26,3 +26,6 @@

 $(outdir)/%.cc: %.ll
        $(FLEX) -Cfe -p -p -o$@ $<
+ifeq ($(shell uname),Darwin)
+ perl -i -pe 's/^class istream;/#include <iostream>;\nusing namespace std;/' $@
+endif
Index: stepmake/stepmake/compile-vars.make
===================================================================
RCS file: /cvsroot/lilypond/lilypond/stepmake/stepmake/compile-vars.make,v
retrieving revision 1.2
diff -u -r1.2 compile-vars.make
--- stepmake/stepmake/compile-vars.make 18 Jul 2002 00:36:15 -0000      1.2
+++ stepmake/stepmake/compile-vars.make 27 Apr 2004 21:50:12 -0000
@@ -3,7 +3,11 @@
ALL_LDFLAGS = $(LDFLAGS) $(ILDFLAGS) $(EXTRA_LDFLAGS) $($(PACKAGE)_LDFLAGS) $(MODULE_LDFLAGS) $(USER_LDFLAGS)

 PIC_FLAGS = -fpic -fPIC
+ifeq ($(shell uname),Darwin)
+SHARED_FLAGS = -bundle -flat_namespace -undefined suppress
+else
 SHARED_FLAGS = -shared
+endif

 o-dep-out = $(outdir)/$(subst .o,.dep,$(notdir $@))#
DO_O_DEP = rm -f $(o-dep-out); DEPENDENCIES_OUTPUT="$(o-dep-out) $(outdir)/$(notdir $@)"


--
David Brandon/address@hidden
"We are number one.  All others are number two or lower."  --The Sphinx





reply via email to

[Prev in Thread] Current Thread [Next in Thread]