]> git.donarmstrong.com Git - lilypond.git/commitdiff
fix brown paper bag design: calling conventions are platform dependent.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 27 Jan 2007 02:41:57 +0000 (03:41 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 27 Jan 2007 02:41:57 +0000 (03:41 +0100)
48 files changed:
lily/all-font-metrics-scheme.cc
lily/axis-group-interface-scheme.cc
lily/book-scheme.cc
lily/context-scheme.cc
lily/dimensions-scheme.cc
lily/dispatcher-scheme.cc
lily/duration-scheme.cc
lily/engraver.cc
lily/font-config-scheme.cc
lily/font-metric-scheme.cc
lily/general-scheme.cc
lily/global-context-scheme.cc
lily/grob-array-scheme.cc
lily/grob-interface-scheme.cc
lily/grob-property.cc
lily/grob-scheme.cc
lily/include/lily-guile-macros.hh
lily/input-scheme.cc
lily/item-scheme.cc
lily/lily-guile.cc
lily/lily-lexer-scheme.cc
lily/lily-parser-scheme.cc
lily/moment-scheme.cc
lily/music-function-scheme.cc
lily/music-scheme.cc
lily/note-head-scheme.cc
lily/open-type-font-scheme.cc
lily/output-def-scheme.cc
lily/pango-select-scheme.cc
lily/paper-book-scheme.cc
lily/paper-outputter-scheme.cc
lily/paper-score-scheme.cc
lily/performance-scheme.cc
lily/pfb-scheme.cc
lily/pitch-scheme.cc
lily/prob-scheme.cc
lily/program-option-scheme.cc
lily/scale.cc
lily/scheme-listener-scheme.cc
lily/score-scheme.cc
lily/simple-spacer-scheme.cc
lily/spanner-scheme.cc
lily/staff-symbol-referencer-scheme.cc
lily/stencil-scheme.cc
lily/stream-event-scheme.cc
lily/text-interface.cc
lily/translator-scheme.cc
lily/ttf.cc

index 178331006687d9814b9915925d617ba2ed4dfad6..c74f9596b43ff3b2a9549631215384c7f91da9f6 100644 (file)
@@ -26,8 +26,7 @@ LY_DEFINE (ly_font_load, "ly:font-load", 1, 0, 0,
           (SCM name),
           "Load the font @var{name}. ")
 {
-  LY_FUNC_NOTE_FIRST_ARG(name);
-  LY_ASSERT_TYPE(scm_is_string,1);
+  LY_ASSERT_TYPE(scm_is_string, name, 1);
   
   Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name));
 
index 9a7c30cc8abbc7628490843321375d7a89537c81..11306233be02fb1e07f2be1b6f52a9427d8a1c78 100644 (file)
@@ -19,9 +19,8 @@ LY_DEFINE (ly_relative_group_extent, "ly:relative-group-extent",
   Grob_array *ga = unsmob_grob_array (elements);
 
   SCM_ASSERT_TYPE (ga || scm_is_pair (elements), elements, SCM_ARG1, __FUNCTION__, "list or Grob_array");
-  LY_FUNC_NOTE_FIRST_ARG(elements);
-  LY_ASSERT_SMOB(Grob, 2);
-  LY_ASSERT_TYPE(is_axis, 3);
+  LY_ASSERT_SMOB(Grob, common, 2);
+  LY_ASSERT_TYPE(is_axis, axis, 3);
 
   vector<Grob*> elts;
   if (!ga)
index 1bf602907a68f7a31c520f8411756d31258f0555..516ad6fbe40f2705e235826ec84f4b5de2dbafdc 100644 (file)
@@ -19,7 +19,7 @@ LY_DEFINE (ly_make_book, "ly:make-book",
           "containing @code{\\scores}.")
 {
   Output_def *odef = unsmob_output_def (paper);
-  LY_ASSERT_FIRST_SMOB (Output_def, paper)
+  LY_ASSERT_SMOB (Output_def, paper, 1);
 
   Book *book = new Book;
   book->paper_ = odef;
@@ -46,10 +46,9 @@ LY_DEFINE (ly_book_process, "ly:book-process",
 {
   Book *book = unsmob_book (book_smob);
 
-  LY_FUNC_NOTE_FIRST_ARG(book_smob);
-  LY_ASSERT_SMOB(Book,1);
-  LY_ASSERT_SMOB(Output_def, 2);
-  LY_ASSERT_SMOB(Output_def, 3);
+  LY_ASSERT_SMOB(Book, book_smob, 1);
+  LY_ASSERT_SMOB(Output_def, default_paper, 2);
+  LY_ASSERT_SMOB(Output_def, default_layout, 3);
 
   Paper_book *pb = book->process (unsmob_output_def (default_paper),
                                  unsmob_output_def (default_layout));
@@ -73,13 +72,12 @@ LY_DEFINE (ly_book_process_to_systems, "ly:book-process-to-systems",
           "a string (for file based outputs) or a socket (for network based "
           "output).")
 {
-  LY_ASSERT_FIRST_SMOB (Book, book_smob);
+  LY_ASSERT_SMOB (Book, book_smob, 1);
+  LY_ASSERT_SMOB(Output_def, default_paper, 2);
+  LY_ASSERT_SMOB(Output_def, default_layout, 3);
 
   Book *book = unsmob_book (book_smob); 
 
-  LY_ASSERT_SMOB(Output_def, 2);
-  LY_ASSERT_SMOB(Output_def, 3);
-
   Paper_book *pb = book->process (unsmob_output_def (default_paper),
                                  unsmob_output_def (default_layout));
   if (pb)
index 5ea55dc2bf60358366afb16a4c3dd196dc33e7f6..30a876f36d3fbc44f89b64e3bd04109447d460c3 100644 (file)
@@ -19,7 +19,7 @@ LY_DEFINE (ly_context_id, "ly:context-id",
 {
   Context *tr = unsmob_context (context);
 
-  LY_ASSERT_FIRST_SMOB (Context, context);
+  LY_ASSERT_SMOB (Context, context, 1);
 
   return ly_string2scm (tr->id_string ());
 }
@@ -30,7 +30,7 @@ LY_DEFINE (ly_context_name, "ly:context-name",
           "i.e. for @code{\\context Voice = one .. } "
           "return the symbol @code{Voice}.")
 {
-  LY_ASSERT_FIRST_SMOB (Context, context);
+  LY_ASSERT_SMOB (Context, context, 1);
 
   Context *tr = unsmob_context (context);
 
@@ -44,8 +44,8 @@ LY_DEFINE (ly_context_grob_definition, "ly:context-grob-definition",
 {
   Context *tr = unsmob_context (context);
   
-  LY_ASSERT_FIRST_SMOB (Context, context);
-  LY_ASSERT_TYPE(ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol, name, 2);
 
   return updated_grob_properties (tr, name);
 }
@@ -59,9 +59,9 @@ LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property",
 {
   Context *tg = unsmob_context (context);
 
-  LY_ASSERT_FIRST_SMOB (Context, context);
-  LY_ASSERT_TYPE(ly_is_symbol, 2);
-  LY_ASSERT_TYPE(ly_is_symbol, 3);
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol, grob, 2);
+  LY_ASSERT_TYPE(ly_is_symbol, eltprop, 3);
 
   execute_pushpop_property (tg, grob, eltprop, val);
 
@@ -72,8 +72,8 @@ LY_DEFINE (ly_context_property, "ly:context-property",
           2, 0, 0, (SCM c, SCM name),
           "Return the value of @var{name} from context @var{c}")
 {
-  LY_ASSERT_FIRST_SMOB (Context, c);
-  LY_ASSERT_TYPE(ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Context, c, 1);
+  LY_ASSERT_TYPE(ly_is_symbol, name, 2);
 
   Context *t = unsmob_context (c);
   return t->internal_get_property (name);
@@ -84,8 +84,8 @@ LY_DEFINE (ly_context_set_property_x, "ly:context-set-property!",
           "Set value of property @var{name} in context @var{context} "
           "to @var{val}.")
 {
-  LY_ASSERT_FIRST_SMOB (Context, context);
-  LY_ASSERT_TYPE(ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol, name, 2);
 
   Context *tr = unsmob_context (context);
 
@@ -99,8 +99,8 @@ LY_DEFINE (ly_context_property_where_defined, "ly:context-property-where-defined
           "Return the context above @var{context} "
           "where @var{name} is defined.")
 {
-  LY_ASSERT_FIRST_SMOB (Context, context);
-  LY_ASSERT_TYPE(ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol,name, 2);
   
   Context *tr = unsmob_context (context);
 
@@ -116,8 +116,8 @@ LY_DEFINE (ly_context_unset_property, "ly:context-unset-property", 2, 0, 0,
           (SCM context, SCM name),
           "Unset value of property @var{name} in context @var{context}.")
 {
-  LY_ASSERT_FIRST_SMOB (Context, context);
-  LY_ASSERT_TYPE(ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol,name, 2);
   Context *tr = unsmob_context (context);
   
   tr->unset_property (name);
@@ -128,7 +128,7 @@ LY_DEFINE (ly_context_parent, "ly:context-parent",
           1, 0, 0, (SCM context),
           "Return the parent of @var{context}, @code{#f} if none.")
 {
-  LY_ASSERT_FIRST_SMOB (Context, context);
+  LY_ASSERT_SMOB (Context, context, 1);
   Context *tr = unsmob_context (context);
 
   tr = tr->get_parent_context ();
@@ -144,8 +144,8 @@ LY_DEFINE (ly_context_find, "ly:context-find",
           "Find a parent of @var{context} that has name or alias @var{name}. "
           "Return @code{#f} if not found.")
 {
-  LY_ASSERT_FIRST_SMOB (Context, context);
-  LY_ASSERT_TYPE(ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE(ly_is_symbol,name, 2);
   Context *tr = unsmob_context (context);
 
   while (tr)
@@ -162,7 +162,7 @@ LY_DEFINE (ly_context_now, "ly:context-now",
           1, 0, 0, (SCM context),
           "Return now-moment of context CONTEXT")
 {
-  LY_ASSERT_FIRST_SMOB (Context, context);
+  LY_ASSERT_SMOB (Context, context, 1);
   Context *ctx = unsmob_context (context);
   return ctx->now_mom ().smobbed_copy ();
 }
@@ -171,7 +171,7 @@ LY_DEFINE (ly_context_event_source, "ly:context-event-source",
            1, 0, 0, (SCM context),
            "Return event-source of context CONTEXT")
 {
-  LY_ASSERT_FIRST_SMOB (Context, context);
+  LY_ASSERT_SMOB (Context, context, 1);
   Context *ctx = unsmob_context (context);
   return ctx->event_source ()->self_scm ();
 }
@@ -181,7 +181,7 @@ LY_DEFINE (ly_context_events_below, "ly:context-events-below",
            "Return a stream-distributor that distributes all events\n"
            " from @var{context} and all its subcontexts.")
 {
-  LY_ASSERT_FIRST_SMOB (Context, context);
+  LY_ASSERT_SMOB (Context, context, 1);
   Context *ctx = unsmob_context (context);
   return ctx->events_below ()->self_scm ();
 }
index a7b6a394f39d01fce1dbf7b090465bf3463b1b9c..4025b4078a5d24be0d19db771153e42c2f8e987e 100644 (file)
@@ -14,7 +14,7 @@ LY_DEFINE (ly_pt, "ly:pt",
           1, 0, 0, (SCM num),
           "@var{num} printer points")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_number, num);
+  LY_ASSERT_TYPE (scm_is_number, num, 1);
   return scm_from_double (point_constant
                          * scm_to_double (num));
 }
@@ -23,7 +23,7 @@ LY_DEFINE (ly_cm, "ly:cm",
           1, 0, 0, (SCM num),
           "@var{num} cm")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_number, num);
+  LY_ASSERT_TYPE (scm_is_number, num, 1);
   return scm_from_double (cm_constant
                          * scm_to_double (num));
 }
@@ -32,7 +32,7 @@ LY_DEFINE (ly_inch, "ly:inch",
           1, 0, 0, (SCM num),
           "@var{num} inches")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_number, num);
+  LY_ASSERT_TYPE (scm_is_number, num, 1);
   return scm_from_double (inch_constant
                          * scm_to_double (num));
 }
@@ -41,7 +41,7 @@ LY_DEFINE (ly_mm, "ly:mm",
           1, 0, 0, (SCM num),
           "@var{num} mm")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_number, num);
+  LY_ASSERT_TYPE (scm_is_number, num, 1);
   return scm_from_double (mm_constant
                          * scm_to_double (num));
 }
@@ -50,7 +50,7 @@ LY_DEFINE (ly_bp, "ly:bp",
           1, 0, 0, (SCM num),
           "@var{num} bigpoints (1/72th inch)")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_number, num);
+  LY_ASSERT_TYPE (scm_is_number, num, 1);
   return scm_from_double (bigpoint_constant
                          * scm_to_double (num));
 }
index 7940fb14a502bf9e75249cf654d05ea8b988b967..00c52aca59b3a2989ac71b2e80f4291176376cb2 100644 (file)
@@ -22,8 +22,8 @@ LY_DEFINE (ly_connect_dispatchers, "ly:connect-dispatchers",
   Dispatcher *t = unsmob_dispatcher (to);
   Dispatcher *f = unsmob_dispatcher (from);
   
-  LY_ASSERT_FIRST_SMOB(Dispatcher, to); 
-  LY_ASSERT_SMOB(Dispatcher, 2); 
+  LY_ASSERT_SMOB (Dispatcher, to, 1); 
+  LY_ASSERT_SMOB(Dispatcher, from,  2); 
 
   t->register_as_listener (f);
 
@@ -38,8 +38,8 @@ LY_DEFINE (ly_add_listener, "ly:add-listener",
   Listener *l = unsmob_listener (list);
   Dispatcher *d = unsmob_dispatcher (disp);
 
-  LY_ASSERT_FIRST_SMOB(Listener, list); 
-  LY_ASSERT_SMOB(Dispatcher, 2); 
+  LY_ASSERT_SMOB (Listener, list, 1); 
+  LY_ASSERT_SMOB(Dispatcher, disp, 2); 
   
   for (int arg = SCM_ARG3; scm_is_pair (cl); cl = scm_cdr (cl), arg++)
     {
@@ -59,9 +59,9 @@ LY_DEFINE (ly_broadcast, "ly:broadcast",
   Dispatcher *d = unsmob_dispatcher (disp);
   Stream_event *e = unsmob_stream_event (ev);
  
-  LY_ASSERT_FIRST_SMOB(Dispatcher, disp);
+  LY_ASSERT_SMOB (Dispatcher, disp, 1);
 
-  LY_ASSERT_SMOB(Stream_event, 2); 
+  LY_ASSERT_SMOB(Stream_event, ev, 2); 
   d->broadcast (e);
   return SCM_UNDEFINED;
 }
index f52f9d8807e35c03ca3b27ec96f61b201ccf5eb9..11e6b58d0d5be3619db549045015bf1fbbc921bb 100644 (file)
@@ -27,8 +27,8 @@ LY_DEFINE (ly_duration_less_p, "ly:duration<?",
           2, 0, 0, (SCM p1, SCM p2),
           "Is @var{p1} shorter than @var{p2}?")
 {
-  LY_ASSERT_FIRST_SMOB(Duration, p1);
-  LY_ASSERT_SMOB(Duration, 2);
+  LY_ASSERT_SMOB(Duration, p1, 1);
+  LY_ASSERT_SMOB(Duration, p2, 2);
 
   Duration *a = unsmob_duration (p1);
   Duration *b = unsmob_duration (p2);
@@ -53,19 +53,19 @@ LY_DEFINE (ly_make_duration, "ly:make-duration",
           "(whole, half, quarter, etc.) and a number of augmentation\n"
           "dots. \n")
 {
-  LY_ASSERT_FIRST_TYPE (scm_is_integer, length);
+  LY_ASSERT_TYPE (scm_is_integer, length, 1);
 
   int dots = 0;
   if (dotcount != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE (scm_is_integer, 2);
+      LY_ASSERT_TYPE (scm_is_integer, dotcount,2);
       dots = scm_to_int (dotcount);
     }
 
   bool compress = false;
   if (num != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE (scm_is_number, 3);
+      LY_ASSERT_TYPE (scm_is_number,num, 3);
       compress = true;
     }
   else
@@ -73,7 +73,7 @@ LY_DEFINE (ly_make_duration, "ly:make-duration",
 
   if (den != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE (scm_is_number, 4);
+      LY_ASSERT_TYPE (scm_is_number,den, 4);
       compress = true;
     }
   else
@@ -90,7 +90,7 @@ LY_DEFINE (ly_duration_log, "ly:duration-log",
           1, 0, 0, (SCM dur),
           "Extract the duration log from @var{dur}")
 {
-  LY_ASSERT_FIRST_SMOB (Duration, dur);
+  LY_ASSERT_SMOB (Duration, dur, 1);
   return scm_from_int (unsmob_duration (dur)->duration_log ());
 }
 
@@ -98,7 +98,7 @@ LY_DEFINE (ly_duration_dot_count, "ly:duration-dot-count",
           1, 0, 0, (SCM dur),
           "Extract the dot count from @var{dur}")
 {
-  LY_ASSERT_FIRST_SMOB(Duration, dur);
+  LY_ASSERT_SMOB (Duration, dur, 1);
   return scm_from_int (unsmob_duration (dur)->dot_count ());
 }
 
@@ -106,7 +106,7 @@ LY_DEFINE (ly_intlog2, "ly:intlog2",
           1, 0, 0, (SCM d),
           "The 2-logarithm of 1/@var{d}.")
 {
-  LY_ASSERT_FIRST_TYPE (scm_is_number, d);
+  LY_ASSERT_TYPE (scm_is_number, d, 1);
   int log = intlog2 (scm_to_int (d));
   return scm_from_int (log);
 }
@@ -115,7 +115,7 @@ LY_DEFINE (ly_duration_length, "ly:duration-length",
           1, 0, 0, (SCM dur),
           "The length of the duration as a Moment.")
 {
-  LY_ASSERT_FIRST_SMOB(Duration, dur);
+  LY_ASSERT_SMOB (Duration, dur, 1);
   return Moment (unsmob_duration (dur)->get_length ()).smobbed_copy ();
 }
 
@@ -123,7 +123,7 @@ LY_DEFINE (ly_duration_2_string, "ly:duration->string",
           1, 0, 0, (SCM dur),
           "Convert @var{dur} to string.")
 {
-  LY_ASSERT_FIRST_SMOB(Duration, dur);
+  LY_ASSERT_SMOB (Duration, dur, 1);
   return ly_string2scm (unsmob_duration (dur)->to_string ());
 }
 
@@ -131,7 +131,7 @@ LY_DEFINE (ly_duration_factor, "ly:duration-factor",
           1, 0, 0, (SCM dur),
           "Extract the compression factor from @var{dur}. Return as a pair.")
 {
-  LY_ASSERT_FIRST_SMOB(Duration, dur);
+  LY_ASSERT_SMOB (Duration, dur, 1);
   Rational r = unsmob_duration (dur)->factor ();
   return scm_cons (scm_from_int (r.num ()), scm_from_int (r.den ()));
 }
index 29f4b2f198be88d1ede0408fc7ee47f512281c4b..84780dd0a2fc489997560a472ab67db2bb18fab3 100644 (file)
@@ -96,7 +96,7 @@ LY_DEFINE (ly_set_grob_creation_callback, "ly:set-grob-creation-callback",
           "the grob to be created and the corresponding line number in the "
           "C++ source file.")
 {
-  LY_ASSERT_FIRST_TYPE (ly_is_procedure, cb);
+  LY_ASSERT_TYPE (ly_is_procedure, cb, 1);
 
   creation_callback = cb;
 
index ddcbd201978bf54c0c439438584090086624b206..5fa68f862c094f697b7a29cd031c245830901482 100644 (file)
@@ -89,7 +89,7 @@ LY_DEFINE (ly_font_config_get_font_file, "ly:font-config-get-font-file", 1, 0, 0
           (SCM name),
           "Get the file for font @var{name}")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, name);
+  LY_ASSERT_TYPE (scm_is_string, name, 1);
   
   FcPattern*pat = FcPatternCreate ();
   FcValue val;
index 96b79def6d75438cdef58878cbb0d6ddf6fbdd3b..a1e18da2c24e120efabdaa078d1916d18440ecf4 100644 (file)
@@ -20,8 +20,8 @@ LY_DEFINE (ly_font_get_glyph, "ly:font-get-glyph",
           "is not available, return @code{#f}.")
 {
   Font_metric *fm = unsmob_metrics (font);
-  LY_ASSERT_FIRST_SMOB (Font_metric, font);
-  LY_ASSERT_TYPE(scm_is_string, 2);
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_string,name, 2);
 
   Stencil m = fm->find_by_name (ly_scm2string (name));
 
@@ -36,8 +36,8 @@ LY_DEFINE (ly_get_glyph, "ly:get-glyph",
           "in @var{font}.")
 {
   Font_metric *fm = unsmob_metrics (font);
-  LY_ASSERT_FIRST_SMOB (Font_metric, font);
-  LY_ASSERT_TYPE(scm_is_number, 2);
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_number, index,2);
 
   return fm->get_ascii_char_stencil (scm_to_int (index)).smobbed_copy ();
 }
@@ -48,8 +48,8 @@ LY_DEFINE (ly_font_glyph_name_to_index, "ly:font-glyph-name-to-index",
           "Return the index for @var{name} in @var{font}.")
 {
   Font_metric *fm = unsmob_metrics (font);
-  LY_ASSERT_FIRST_SMOB (Font_metric, font);
-  LY_ASSERT_TYPE(scm_is_string, 2);
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_string,name, 2);
 
   return scm_from_int (fm->name_to_index (ly_scm2string (name)));
 }
@@ -60,8 +60,8 @@ LY_DEFINE (ly_font_index_to_charcode, "ly:font-index-to-charcode",
           "Return the character code for @var{index} @var{font}.")
 {
   Font_metric *fm = unsmob_metrics (font);
-  LY_ASSERT_FIRST_SMOB (Font_metric, font);
-  LY_ASSERT_TYPE(scm_is_integer, 2);
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_integer,index, 2);
 
   return scm_from_unsigned_integer (fm->index_to_charcode (scm_to_int (index)));
 }
@@ -72,8 +72,8 @@ LY_DEFINE (ly_font_glyph_name_to_charcode, "ly:font-glyph-name-to-charcode",
           "Return the character code for glyph @var{name} in @var{font}.")
 {
   Font_metric *fm = unsmob_metrics (font);
-  LY_ASSERT_FIRST_SMOB (Font_metric, font);
-  LY_ASSERT_TYPE(scm_is_string, 2);
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_string,name, 2);
 
   return scm_from_unsigned_integer (fm->index_to_charcode (fm->name_to_index (ly_scm2string (name))));
 }
@@ -89,8 +89,8 @@ LY_DEFINE (ly_text_dimension, "ly:text-dimension",
   Modified_font_metric *fm = dynamic_cast<Modified_font_metric *>
     (unsmob_metrics (font));
 
-  LY_ASSERT_FIRST_SMOB (Font_metric, font);
-  LY_ASSERT_TYPE(scm_is_string, 2);
+  LY_ASSERT_SMOB (Font_metric, font, 1);
+  LY_ASSERT_TYPE(scm_is_string,text, 2);
   Stencil stc (fm->text_stencil (ly_scm2string (text)));
   return scm_cons (ly_interval2scm (stc.extent (X_AXIS)),
                   ly_interval2scm (stc.extent (Y_AXIS)));
@@ -106,7 +106,7 @@ LY_DEFINE (ly_font_file_name, "ly:font-file-name",
           "Given the font metric @var{font}, "
           "return the corresponding file name.")
 {
-  LY_ASSERT_FIRST_SMOB (Font_metric, font);
+  LY_ASSERT_SMOB (Font_metric, font, 1);
 
   Font_metric *fm = unsmob_metrics (font);
   SCM name = fm->font_file_name ();
@@ -120,7 +120,7 @@ LY_DEFINE (ly_font_name, "ly:font-name",
           "Given the font metric @var{font}, "
           "return the corresponding name.")
 {
-  LY_ASSERT_FIRST_SMOB (Font_metric, font);
+  LY_ASSERT_SMOB (Font_metric, font, 1);
   Font_metric *fm = unsmob_metrics (font);
 
   return ly_string2scm (fm->font_name ());
@@ -131,7 +131,7 @@ LY_DEFINE (ly_font_magnification, "ly:font-magnification", 1, 0, 0,
           "Given the font metric @var{font}, return the "
           "magnification, relative to the current output-scale.")
 {
-  LY_ASSERT_FIRST_SMOB (Font_metric, font);
+  LY_ASSERT_SMOB (Font_metric, font, 1);
 
   Font_metric *fm = unsmob_metrics (font);
   return scm_cdr (fm->description_);
@@ -142,7 +142,7 @@ LY_DEFINE (ly_font_design_size, "ly:font-design-size", 1, 0, 0,
           "Given the font metric @var{font}, return the "
           "design size, relative to the current output-scale.")
 {
-  LY_ASSERT_FIRST_SMOB (Font_metric, font);
+  LY_ASSERT_SMOB (Font_metric, font, 1);
 
   Font_metric *fm = unsmob_metrics (font);
   return scm_from_double (fm->design_size ());
index b12e2664e649cd0338349757fe49e7c785ce9c4c..7f741d059cf2289d85772fa2f07c6cf1e3514a50 100644 (file)
@@ -32,7 +32,7 @@ LY_DEFINE (ly_find_file, "ly:find-file",
           "Return the absolute file name of @var{name}, "
           "or @code{#f} if not found.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, name);
+  LY_ASSERT_TYPE (scm_is_string, name, 1);
 
   string nm = ly_scm2string (name);
   string file_name = global_path.find (nm);
@@ -51,11 +51,11 @@ LY_DEFINE (ly_gulp_file, "ly:gulp-file",
           "Read the file @var{name}, and return its contents in a string.  "
           "The file is looked up using the search path. ")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, name);
+  LY_ASSERT_TYPE (scm_is_string, name, 1);
   int sz = INT_MAX;
   if (size != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(scm_is_number, 2);
+      LY_ASSERT_TYPE(scm_is_number,size, 2);
       sz = scm_to_int (size);
     }
   
@@ -68,7 +68,7 @@ LY_DEFINE (ly_error, "ly:error",
           "Scheme callable function to issue the error @code{msg}. "
           "The error is formatted with @code{format} and @code{rest}.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
   str = scm_simple_format (SCM_BOOL_F, str, rest);
   error (ly_scm2string (str));
   return SCM_UNSPECIFIED;
@@ -79,7 +79,7 @@ LY_DEFINE (ly_message, "ly:message",
           "Scheme callable function to issue the message @code{msg}. "
           "The message is formatted with @code{format} and @code{rest}.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
   str = scm_simple_format (SCM_BOOL_F, str, rest);
   message (ly_scm2string (str));
   return SCM_UNSPECIFIED;
@@ -90,7 +90,7 @@ LY_DEFINE (ly_progress, "ly:progress",
           "Scheme callable function to print progress @code{str}. "
           "The message is formatted with @code{format} and @code{rest}.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
   str = scm_simple_format (SCM_BOOL_F, str, rest);
   progress_indication (ly_scm2string (str));
   return SCM_UNSPECIFIED;
@@ -101,7 +101,7 @@ LY_DEFINE (ly_programming_error, "ly:programming-error",
           "Scheme callable function to issue the warning @code{msg}. "
           "The message is formatted with @code{format} and @code{rest}.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
   str = scm_simple_format (SCM_BOOL_F, str, rest);
   programming_error (ly_scm2string (str));
   return SCM_UNSPECIFIED;
@@ -112,7 +112,7 @@ LY_DEFINE (ly_warning, "ly:warning",
           "Scheme callable function to issue the warning @code{str}. "
           "The message is formatted with @code{format} and @code{rest}.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
   str = scm_simple_format (SCM_BOOL_F, str, rest);
   warning (ly_scm2string (str));
   return SCM_UNSPECIFIED;
@@ -152,9 +152,9 @@ LY_DEFINE (ly_string_substitute, "ly:string-substitute",
           3, 0, 0, (SCM a, SCM b, SCM s),
           "Replace @var{a} by @var{b} in @var{s}.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, s);
-  LY_ASSERT_TYPE(scm_is_string, 2);
-  LY_ASSERT_TYPE(scm_is_string, 3);
+  LY_ASSERT_TYPE (scm_is_string, s, 1);
+  LY_ASSERT_TYPE(scm_is_string,b, 2);
+  LY_ASSERT_TYPE(scm_is_string,s, 3);
 
   string ss = ly_scm2string (s);
   replace_all (ss, string (scm_i_string_chars (a)),
@@ -166,7 +166,7 @@ LY_DEFINE (ly_number_2_string, "ly:number->string",
           1, 0, 0, (SCM s),
           "Convert @var{num} to a string without generating many decimals.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_number, s);
+  LY_ASSERT_TYPE (scm_is_number, s, 1);
 
   char str[400];                       // ugh.
 
@@ -224,7 +224,7 @@ LY_DEFINE (ly_gettext, "ly:gettext",
           1, 0, 0, (SCM string),
           "Gettext wrapper.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, string);
+  LY_ASSERT_TYPE (scm_is_string, string, 1);
   return ly_string2scm (_ (scm_i_string_chars (string)));
 }
 
@@ -256,7 +256,7 @@ LY_DEFINE (ly_wide_char_2_utf_8, "ly:wide-char->utf-8",
 {
   char buf[5];
 
-  LY_ASSERT_FIRST_TYPE(scm_is_integer, wc);
+  LY_ASSERT_TYPE (scm_is_integer, wc, 1);
   unsigned wide_char = (unsigned) scm_to_int (wc);
   char *p = buf;
 
@@ -314,7 +314,7 @@ LY_DEFINE (ly_stderr_redirect, "ly:stderr-redirect",
           1, 1, 0, (SCM file_name, SCM mode),
           "Redirect stderr to FILE-NAME, opened with MODE.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, file_name);
+  LY_ASSERT_TYPE (scm_is_string, file_name, 1);
 
   string m = "w";
   if (mode != SCM_UNDEFINED && scm_string_p (mode))
@@ -346,7 +346,7 @@ LY_DEFINE (ly_camel_case_2_lisp_identifier, "ly:camel-case->lisp-identifier",
           1, 0, 0, (SCM name_sym),
           "Convert FooBar_Bla to foo-bar-bla style symbol.")
 {
-  LY_ASSERT_FIRST_TYPE(ly_is_symbol, name_sym);
+  LY_ASSERT_TYPE (ly_is_symbol, name_sym, 1);
   
   /*
     TODO: should use strings instead?
@@ -362,7 +362,7 @@ LY_DEFINE (ly_expand_environment, "ly:expand-environment",
           1, 0, 0, (SCM str),
           "Expand $VAR and $@{VAR@} in @var{str}.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
 
   return ly_string2scm (expand_environment_variables (ly_scm2string (str)));
 }
@@ -372,7 +372,7 @@ LY_DEFINE (ly_truncate_list_x, "ly:truncate-list!",
           2, 0, 0, (SCM lst, SCM i),
           "Take at most the first @var{i} of list @var{lst}")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_integer, i);
+  LY_ASSERT_TYPE (scm_is_integer, i, 1);
 
   int k = scm_to_int (i);
   if (k == 0)
@@ -427,7 +427,7 @@ LY_DEFINE (ly_format, "ly:format",
           1, 0, 1, (SCM str, SCM rest),
           "LilyPond specific format, supporting ~a ~[0-9]f.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
 
   string format = ly_scm2string (str);
   vector<string> results;
index 72693421253114368a4a7cc87c23d3793370004a..c888487776684bc24ed9a26109d3e6f64a3c0f66 100644 (file)
@@ -24,7 +24,7 @@ LY_DEFINE (ly_format_output, "ly:format-output",
 {
   Global_context *g = dynamic_cast<Global_context *> (unsmob_context (context));
   
-  LY_ASSERT_FIRST_TYPE (unsmob_global_context, context)
+  LY_ASSERT_TYPE (unsmob_global_context, context, 1)
 
   SCM output = g->get_output ();
   progress_indication ("\n");
@@ -41,7 +41,7 @@ LY_DEFINE (ly_make_global_translator, "ly:make-global-translator",
           "@var{global}. The translator group is returned.")
 {
   Global_context *g = dynamic_cast<Global_context *> (unsmob_context (global));
-  LY_ASSERT_FIRST_TYPE (unsmob_global_context, global)
+  LY_ASSERT_TYPE (unsmob_global_context, global, 1)
 
   Translator_group *tg = new Translator_group ();
   tg->connect_to_context (g);
@@ -57,7 +57,7 @@ LY_DEFINE (ly_make_global_context, "ly:make-global-context",
           "The context is returned.\n"
           )
 {
-  LY_ASSERT_FIRST_SMOB (Output_def, output_def);
+  LY_ASSERT_SMOB (Output_def, output_def, 1);
   Output_def *odef = unsmob_output_def (output_def); 
 
   Global_context *glob = new Global_context (odef);
@@ -77,8 +77,8 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression",
           "global context @var{ctx}. The context is returned in its\n"
           "final state.\n")
 {
-  LY_ASSERT_FIRST_SMOB (Music, mus);
-  LY_ASSERT_TYPE (unsmob_global_context, 2);
+  LY_ASSERT_SMOB (Music, mus, 1);
+  LY_ASSERT_TYPE (unsmob_global_context,ctx, 2);
 
   Music *music = unsmob_music (mus);
   if (!music
@@ -130,8 +130,8 @@ LY_DEFINE (ly_run_translator, "ly:run-translator",
           "Optionally, this routine takes an Object-key to\n"
           "to uniquely identify the Score block containing it.\n")
 {
-  LY_ASSERT_FIRST_SMOB (Music, mus);
-  LY_ASSERT_SMOB (Output_def, 2);
+  LY_ASSERT_SMOB (Music, mus, 1);
+  LY_ASSERT_SMOB (Output_def, output_def, 2);
 
   SCM glob = ly_make_global_context (output_def);
   ly_make_global_translator (glob);
index 4a521a9958943eaf197781eee478b9308b573946..b74b10fc51aab43d39907c8ab8455c49c2f34cfe 100644 (file)
@@ -15,7 +15,7 @@ LY_DEFINE (ly_grob_array_length, "ly:grob-array-length",
           (SCM grob_arr),
           "Return the grob_array length.")
 {
-  LY_ASSERT_FIRST_SMOB (Grob_array, grob_arr);
+  LY_ASSERT_SMOB (Grob_array, grob_arr, 1);
 
   Grob_array *me = unsmob_grob_array (grob_arr);
   return  scm_from_int (me->size ());
@@ -28,8 +28,8 @@ LY_DEFINE (ly_grob_array_ref, "ly:grob-array-ref",
           "Retrieve the @code{index} element of @code{grob-arr}.")
 {
   Grob_array *me = unsmob_grob_array (grob_arr);
-  LY_ASSERT_FIRST_SMOB (Grob_array, grob_arr);
-  LY_ASSERT_TYPE(scm_is_integer, 2);
+  LY_ASSERT_SMOB (Grob_array, grob_arr, 1);
+  LY_ASSERT_TYPE(scm_is_integer,index, 2);
 
   vsize i = scm_to_unsigned (index);
   if (i == VPOS || i >= me->size ())
index 504087d59b8b5157a25aa23bfa773724cc9e6294..a174d264532d4c3747bbe6d108ae3af6db960b61 100644 (file)
@@ -15,9 +15,9 @@ LY_DEFINE (ly_add_interface, "ly:add-interface",
           3, 0, 0, (SCM a, SCM b, SCM c),
           "Add an interface description.")
 {
-  LY_ASSERT_FIRST_TYPE (ly_is_symbol, a);
-  LY_ASSERT_TYPE(scm_is_string, 2);
-  LY_ASSERT_TYPE(ly_is_list, 3);
+  LY_ASSERT_TYPE (ly_is_symbol, a, 1);
+  LY_ASSERT_TYPE(scm_is_string,b, 2);
+  LY_ASSERT_TYPE(ly_is_list,c, 3);
   if (!all_ifaces)
     {
       SCM tab = scm_c_make_hash_table (59);
index c3596fb0efb4fa70b1fd9986b8ee171f426f043d..1a9c61dccc603c299c3ab3e15c6ec453e144bc5d 100644 (file)
@@ -32,7 +32,7 @@ LY_DEFINE (ly_set_grob_modification_callback, "ly:set-grob-modification-callback
           "which the modification was requested, the property to be changed and "
           "the new value for the property.")
 {
-  LY_ASSERT_FIRST_TYPE(ly_is_procedure, cb);
+  LY_ASSERT_TYPE (ly_is_procedure, cb, 1);
 
   modification_callback = cb;
   return SCM_UNSPECIFIED;
index e9720ea986f0b1c69c363f265e22bd2bd935f657..a76797a8d2a3741de885f9b782ec5cfafe71bf8f 100644 (file)
@@ -21,8 +21,8 @@ LY_DEFINE (ly_grob_property_data, "ly:grob-property-data",
 {
   Grob *sc = unsmob_grob (grob);
 
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
-  LY_ASSERT_TYPE (ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
 
   return sc->get_property_data (sym);
 }
@@ -33,8 +33,8 @@ LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!",
 {
   Grob *sc = unsmob_grob (grob);
  
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
-  LY_ASSERT_TYPE (ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
 
   if (!ly_is_procedure (val)
       && !type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
@@ -53,8 +53,8 @@ LY_DEFINE (ly_grob_property, "ly:grob-property",
 {
   Grob *sc = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
-  LY_ASSERT_TYPE (ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
   if (deflt == SCM_UNDEFINED)
     deflt = SCM_EOL;
 
@@ -72,7 +72,7 @@ LY_DEFINE (ly_grob_interfaces, "ly:grob-interfaces",
 {
   Grob *sc = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   return sc->interfaces ();
 }
@@ -86,8 +86,8 @@ LY_DEFINE (ly_grob_object, "ly:grob-object",
 {
   Grob *sc = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
-  LY_ASSERT_TYPE (ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
 
   return sc->internal_get_object (sym);
 }
@@ -102,7 +102,7 @@ LY_DEFINE (ly_grob_layout, "ly:grob-layout",
 {
   Grob *sc = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   return sc->layout ()->self_scm ();
 }
@@ -115,7 +115,7 @@ LY_DEFINE (ly_grob_alist_chain, "ly:grob-alist-chain",
 {
   Grob *sc = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   if (global == SCM_UNDEFINED)
     {
@@ -136,9 +136,9 @@ LY_DEFINE (ly_grob_extent, "ly:grob-extent",
   Grob *ref = unsmob_grob (refp);
   
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
-  LY_ASSERT_SMOB(Grob, 2);
-  LY_ASSERT_TYPE(is_axis, 3);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_SMOB(Grob, refp, 2);
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Axis a = Axis (scm_to_int (axis));
 
@@ -160,9 +160,9 @@ LY_DEFINE (ly_grob_robust_relative_extent, "ly:grob-robust-relative-extent",
   Grob *ref = unsmob_grob (refp);
   
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
-  LY_ASSERT_SMOB(Grob, 2);
-  LY_ASSERT_TYPE(is_axis, 3);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_SMOB(Grob, refp, 2);
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Axis a = Axis (scm_to_int (axis));
     
@@ -184,9 +184,9 @@ LY_DEFINE (ly_grob_relative_coordinate, "ly:grob-relative-coordinate",
   Grob *ref = unsmob_grob (refp);
   
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
-  LY_ASSERT_SMOB(Grob, 2);
-  LY_ASSERT_TYPE(is_axis, 3);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_SMOB(Grob,refp, 2);
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Axis a = Axis (scm_to_int (axis));
 
@@ -208,8 +208,8 @@ LY_DEFINE (ly_grob_parent, "ly:grob-parent",
 {
   Grob *sc = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
-  LY_ASSERT_TYPE(is_axis, 2);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE(is_axis,axis, 2);
 
   Grob *par = sc->get_parent (Axis (scm_to_int (axis)));
   return par ? par->self_scm () : SCM_EOL;
@@ -221,7 +221,7 @@ LY_DEFINE (ly_grob_properties, "ly:grob-properties",
 {
   Grob *g = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   /* FIXME: uhg? copy/read only? */
   return g->mutable_property_alist_;
@@ -233,7 +233,7 @@ LY_DEFINE (ly_grob_basic_properties, "ly:grob-basic-properties",
 {
   Grob *g = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   /* FIXME: uhg? copy/read only? */
   return g->immutable_property_alist_;
@@ -245,7 +245,7 @@ LY_DEFINE (ly_grob_system, "ly:grob-system",
 {
   Grob *me = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   if (System *g = me->get_system ())
     return g->self_scm ();
@@ -259,7 +259,7 @@ LY_DEFINE (ly_grob_original, "ly:grob-original",
 {
   Grob *me = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
+  LY_ASSERT_SMOB (Grob, grob, 1);
   return me->original () ? me->original ()->self_scm () : me->self_scm ();
 }
 
@@ -270,7 +270,7 @@ LY_DEFINE (ly_grob_suicide_x, "ly:grob-suicide!",
 {
   Grob *me = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   me->suicide ();
   return SCM_UNSPECIFIED;
@@ -282,9 +282,9 @@ LY_DEFINE (ly_grob_translate_axis_x, "ly:grob-translate-axis!",
 {
   Grob *me = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
-  LY_ASSERT_TYPE(scm_is_number, 2);
-  LY_ASSERT_TYPE(is_axis, 3);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE(scm_is_number,d, 2);
+  LY_ASSERT_TYPE(is_axis,a, 3);
 
   me->translate_axis (scm_to_double (d), Axis (scm_to_int (a)));
   return SCM_UNSPECIFIED;
@@ -296,7 +296,7 @@ LY_DEFINE (ly_grob_default_font, "ly:grob-default-font",
 {
   Grob *gr = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
+  LY_ASSERT_SMOB (Grob, grob, 1);
 
   return Font_interface::get_default_font (gr)->self_scm ();
 }
@@ -315,12 +315,12 @@ LY_DEFINE (ly_grob_common_refpoint, "ly:grob-common-refpoint",
   
   Grob *gr = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
-  LY_ASSERT_SMOB(Grob, 2);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_SMOB(Grob,other, 2);
 
   Grob *o = unsmob_grob (other);
 
-  LY_ASSERT_TYPE(is_axis, 3);
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Grob *refp = gr->common_refpoint (o,  Axis (scm_to_int (axis)));
   return refp ? refp->self_scm () : SCM_BOOL_F;
@@ -334,11 +334,11 @@ LY_DEFINE (ly_grob_common_refpoint_of_array, "ly:grob-common-refpoint-of-array",
 {
   Grob *gr = unsmob_grob (grob);
    
-  LY_ASSERT_FIRST_SMOB(Grob, grob);
-  LY_ASSERT_SMOB(Grob_array, 2);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_SMOB(Grob_array,others, 2);
 
   Grob_array *ga = unsmob_grob_array (others);
-  LY_ASSERT_TYPE(is_axis, 3);
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Grob *refp = common_refpoint_of_array (ga->array (), gr, Axis (scm_to_int (axis)));
   return refp ? refp->self_scm () : SCM_BOOL_F;
index aaa883ed15665e496f38900e9e06a6bd9345097a..6b0a60a2f041271bded2b8d938afb3acaeacc7c7 100644 (file)
@@ -201,30 +201,19 @@ void ly_check_name (string cxx, string fname);
 #endif
 
 
-extern int function_argument_direction;
 
-#define LY_FUNC_NOTE_FIRST_ARG(a)  \
-  SCM *first_arg_ptr = &a;
-
-#define LY_ASSERT_TYPE(pred, number) \
+#define LY_ASSERT_TYPE(pred, var, number)                                      \
   {                                                                    \
-    if (!pred (first_arg_ptr[(number-1)*function_argument_direction]))         \
+    if (!pred (var)) \
       {                                                                        \
        scm_wrong_type_arg_msg(mangle_cxx_identifier (__FUNCTION__).c_str(), \
-                              number, first_arg_ptr[(number-1)*function_argument_direction], \
+                              number, var, \
                               predicate_to_typename ((void*) &pred).c_str()); \
       }                                                                        \
   }
 
-#define LY_ASSERT_SMOB(klass, number) LY_ASSERT_TYPE(klass::unsmob, number)
-
-
-#define LY_ASSERT_FIRST_TYPE(pred, var)                                \
-  LY_FUNC_NOTE_FIRST_ARG(var);                                 \
-  LY_ASSERT_TYPE(pred, 1);
+#define LY_ASSERT_SMOB(klass, var, number) LY_ASSERT_TYPE(klass::unsmob, var, number)
 
-#define LY_ASSERT_FIRST_SMOB(klass, var)                        \
-  LY_ASSERT_FIRST_TYPE(klass::unsmob, var)
 
 
 #endif /* LILY_GUILE_MACROS_HH */
index 4f27b57e50a127e406f5fa6f6cd4bfbf1df6ea4e..e3d0312642fd8488b75db27dfcfea9f467dba3f9 100644 (file)
@@ -24,8 +24,8 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM
 {
   Input *ip = unsmob_input (sip);
 
-  LY_ASSERT_FIRST_TYPE (unsmob_input, sip);
-  LY_ASSERT_TYPE(scm_is_string, 2);
+  LY_ASSERT_TYPE (unsmob_input, sip, 1);
+  LY_ASSERT_TYPE(scm_is_string, msg,2);
 
   msg = scm_simple_format (SCM_BOOL_F, msg, rest);
 
@@ -41,7 +41,7 @@ LY_DEFINE (ly_input_file_line_char_column,
           1, 0, 0, (SCM sip),
           "Return input location in @var{sip} as (file-name line char column).")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_input, sip);
+  LY_ASSERT_TYPE (unsmob_input, sip, 1);
   Input *ip = unsmob_input (sip);
 
   int l = 0;
@@ -61,7 +61,7 @@ LY_DEFINE (ly_input_both_locations,
           "(file-name first-line first-column last-line last-column).")
 {
   
-  LY_ASSERT_FIRST_TYPE (unsmob_input, sip);
+  LY_ASSERT_TYPE (unsmob_input, sip, 1);
   Input *ip = unsmob_input (sip);
   
   return scm_list_5 (ly_string2scm (ip->file_string ()),
index bbb595d10e889f41b00295b3ee4a2a0cb6aa4b22..426d9532a6ebeb3fcee8cc145d01aec3b68a71dc 100644 (file)
@@ -24,7 +24,7 @@ LY_DEFINE (ly_item_break_dir, "ly:item-break-dir",
           "The break status dir of item @var{it}. @code{-1} is end of "
           "line, @code{0} unbroken, and @code{1} begin of line.")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_item, it);
+  LY_ASSERT_TYPE (unsmob_item, it, 1);
   Item *me = unsmob_item (it);
   return scm_from_int (me->break_status_dir ());
 }
index 1f67c0043310d32c2d0abe57e42ece5b7a53e119..370dba2998e932f32b63520c3413da7d2b7af41d 100644 (file)
@@ -126,7 +126,7 @@ ly_string2scm (string const &str)
 char *
 ly_scm2newstr (SCM str, size_t *lenp)
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+  LY_ASSERT_TYPE (scm_is_string, str, 1);
 
   size_t len = scm_i_string_length (str);
   if (char *new_str = (char *) malloc ((len + 1) * sizeof (char)))
index 62c2959791ddb1c77c943c0bf9384b0637eca22d..a0501e9eab0df06692df8d1ee0138b6341530934 100644 (file)
@@ -13,7 +13,7 @@ LY_DEFINE(ly_lexer_keywords, "ly:lexer-keywords",
          1, 0, 0, (SCM lexer),
          "Return a list of (KEY . CODE) pairs, signifying the lilypond reserved words list.")
 {
-  LY_ASSERT_FIRST_SMOB(Lily_lexer, lexer);
+  LY_ASSERT_SMOB (Lily_lexer, lexer, 1);
 
   Lily_lexer * lex = Lily_lexer::unsmob (lexer);
   return lex->keyword_list ();
index 45c61898f23277fd453d3cfcca69c2107823a951..4e22461638f6354289208371c8f009f673f8be1d 100644 (file)
@@ -36,7 +36,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
           "Parse a single @code{.ly} file.  "
           "Upon failure, throw @code{ly-file-failed} key.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, name);
+  LY_ASSERT_TYPE (scm_is_string, name, 1);
   string file = ly_scm2string (name);
   char const *extensions[] = {"ly", "", 0};
 
@@ -160,7 +160,7 @@ LY_DEFINE (ly_parser_clone, "ly:parser-clone",
           1, 0, 0, (SCM parser_smob),
           "Return a clone of @var{parser-smob}.")
 {
-  LY_ASSERT_FIRST_SMOB (Lily_parser, parser_smob);
+  LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
   Lily_parser *clone = new Lily_parser (*parser);
 
@@ -172,10 +172,10 @@ LY_DEFINE (ly_parser_define_x, "ly:parser-define!",
           "Bind @var{symbol} to @var{val} in @var{parser-smob}'s module.")
 {
   
-  LY_ASSERT_FIRST_SMOB (Lily_parser, parser_smob);
+  LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
 
-  LY_ASSERT_TYPE (ly_is_symbol, 2);
+  LY_ASSERT_TYPE (ly_is_symbol,symbol, 2);
     
   parser->lexer_->set_identifier (scm_symbol_to_string (symbol), val);
   return SCM_UNSPECIFIED;
@@ -186,11 +186,11 @@ LY_DEFINE (ly_parser_lookup, "ly:parser-lookup",
           "Lookup @var{symbol} in @var{parser-smob}'s module.  "
           "Undefined is '().")
 {
-  LY_ASSERT_FIRST_SMOB (Lily_parser, parser_smob);
+  LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
 
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
  
-  LY_ASSERT_TYPE (ly_is_symbol, 2);
+  LY_ASSERT_TYPE (ly_is_symbol,symbol, 2);
 
   SCM val = parser->lexer_->lookup_identifier (ly_scm2string (scm_symbol_to_string (symbol)));
   if (val != SCM_UNDEFINED)
@@ -204,9 +204,9 @@ LY_DEFINE (ly_parser_parse_string, "ly:parser-parse-string",
           "Parse the string @code{ly-code} with @code{parser-smob}."
           "Upon failure, throw @code{ly-file-failed} key.")
 {
-  LY_ASSERT_FIRST_SMOB (Lily_parser, parser_smob);
+  LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
   Lily_parser *parser = unsmob_lily_parser (parser_smob); 
-  LY_ASSERT_TYPE(scm_is_string, 2);
+  LY_ASSERT_TYPE(scm_is_string,ly_code, 2);
 
   parser->parse_string (ly_scm2string (ly_code));
 
@@ -219,7 +219,7 @@ LY_DEFINE (ly_parser_set_note_names, "ly:parser-set-note-names",
           "@var{names} is an alist of symbols.  "
           "This only has effect if the current mode is notes.")
 {
-  LY_ASSERT_FIRST_SMOB (Lily_parser, parser);
+  LY_ASSERT_SMOB (Lily_parser, parser, 1);
   Lily_parser *p = unsmob_lily_parser (parser);
 
   if (p->lexer_->is_note_state ())
@@ -235,7 +235,7 @@ LY_DEFINE (ly_parser_output_name, "ly:parser-output-name",
           1, 0, 0, (SCM parser),
           "Return the base name of the output file.")
 {
-  LY_ASSERT_FIRST_SMOB (Lily_parser, parser);
+  LY_ASSERT_SMOB (Lily_parser, parser, 1);
   Lily_parser *p = unsmob_lily_parser (parser);
 
   return ly_string2scm (p->output_basename_);
@@ -245,10 +245,10 @@ LY_DEFINE (ly_parser_error, "ly:parser-error",
           2, 1, 0, (SCM parser, SCM msg, SCM input),
           "Display an error message, and make the parser fail")
 {
-  LY_ASSERT_FIRST_SMOB (Lily_parser, parser);
+  LY_ASSERT_SMOB (Lily_parser, parser, 1);
   Lily_parser *p = unsmob_lily_parser (parser);
   
-  LY_ASSERT_TYPE(scm_is_string, 2);
+  LY_ASSERT_TYPE(scm_is_string,msg, 2);
   string s = ly_scm2string (msg);
   
   Input *i = unsmob_input (input);
@@ -264,7 +264,7 @@ LY_DEFINE (ly_parser_clear_error, "ly:parser-clear-error",
           1, 0, 0, (SCM parser),
           "Clear the error flag for the parser.")
 {
-  LY_ASSERT_FIRST_SMOB (Lily_parser, parser);
+  LY_ASSERT_SMOB (Lily_parser, parser, 1);
   Lily_parser *p = unsmob_lily_parser (parser);
   
 
@@ -278,7 +278,7 @@ LY_DEFINE (ly_parser_has_error_p, "ly:parser-has-error?",
           1, 0, 0, (SCM parser),
           "Does @var{parser} have an error flag?")
 {
-  LY_ASSERT_FIRST_SMOB (Lily_parser, parser);
+  LY_ASSERT_SMOB (Lily_parser, parser, 1);
   Lily_parser *p = unsmob_lily_parser (parser);
 
   return scm_from_bool (p->error_level_ || p->lexer_->error_level_);
index 20253ae2025f2f5e4a9de76fe99972e6787338ce..16839f81bb568449ed83b7247584a0e1596123c3 100644 (file)
@@ -21,20 +21,20 @@ LY_DEFINE (ly_make_moment, "ly:make-moment",
           "notes, and @var{g} the timing for grace notes.  "
           "In absence of grace notes, @var{g} is zero.\n")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_integer, n);
-  LY_ASSERT_TYPE(scm_is_integer, 2);
+  LY_ASSERT_TYPE (scm_is_integer, n, 1);
+  LY_ASSERT_TYPE(scm_is_integer,d, 2);
 
   int grace_num = 0;
   if (gn != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(scm_is_integer, 3);
+      LY_ASSERT_TYPE(scm_is_integer,gn, 3);
       grace_num = scm_to_int (gn);
     }
 
   int grace_den = 1;
   if (gd != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(scm_is_integer, 4);
+      LY_ASSERT_TYPE(scm_is_integer,gd, 4);
       grace_den = scm_to_int (gd);
     }
 
@@ -46,8 +46,8 @@ LY_DEFINE (ly_moment_sub, "ly:moment-sub",
           2, 0, 0, (SCM a, SCM b),
           "Subtract two moments.")
 {
-  LY_ASSERT_FIRST_SMOB (Moment, a); 
-  LY_ASSERT_SMOB (Moment, 2);
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB (Moment,b, 2);
   
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
@@ -59,8 +59,8 @@ LY_DEFINE (ly_moment_add, "ly:moment-add",
           2, 0, 0, (SCM a, SCM b),
           "Add two moments.")
 {
-  LY_ASSERT_FIRST_SMOB(Moment, a); 
-  LY_ASSERT_SMOB(Moment, 2); 
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB(Moment,b, 2); 
 
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
@@ -72,8 +72,8 @@ LY_DEFINE (ly_moment_mul, "ly:moment-mul",
           2, 0, 0, (SCM a, SCM b),
           "Multiply two moments.")
 {
-  LY_ASSERT_FIRST_SMOB(Moment, a); 
-  LY_ASSERT_SMOB(Moment, 2); 
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB(Moment, b, 2); 
 
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
@@ -84,8 +84,8 @@ LY_DEFINE (ly_moment_div, "ly:moment-div",
           2, 0, 0, (SCM a, SCM b),
           "Divide two moments.")
 {
-  LY_ASSERT_FIRST_SMOB(Moment, a); 
-  LY_ASSERT_SMOB(Moment, 2); 
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB(Moment, b, 2); 
 
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
@@ -97,8 +97,8 @@ LY_DEFINE (ly_moment_mod, "ly:moment-mod",
           2, 0, 0, (SCM a, SCM b),
           "Modulo of two moments.")
 {
-  LY_ASSERT_FIRST_SMOB(Moment, a); 
-  LY_ASSERT_SMOB(Moment, 2); 
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB(Moment, b, 2); 
   
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
@@ -109,7 +109,7 @@ LY_DEFINE (ly_moment_grace_numerator, "ly:moment-grace-numerator",
           1, 0, 0, (SCM mom),
           "Extract numerator from grace timing.")
 {
-  LY_ASSERT_FIRST_SMOB (Moment, mom);
+  LY_ASSERT_SMOB (Moment, mom, 1);
 
   Moment *ma = unsmob_moment (mom);
 
@@ -120,7 +120,7 @@ LY_DEFINE (ly_moment_grace_denominator, "ly:moment-grace-denominator",
           1, 0, 0, (SCM mom),
           "Extract denominator from grace timing.")
 {
-  LY_ASSERT_FIRST_SMOB (Moment, mom);
+  LY_ASSERT_SMOB (Moment, mom, 1);
   Moment *ma = unsmob_moment (mom);
 
   return scm_from_int (ma->grace_part_.denominator ());
@@ -129,7 +129,7 @@ LY_DEFINE (ly_moment_main_numerator, "ly:moment-main-numerator",
           1, 0, 0, (SCM mom),
           "Extract numerator from main timing.")
 {
-  LY_ASSERT_FIRST_SMOB (Moment, mom);
+  LY_ASSERT_SMOB (Moment, mom, 1);
   Moment *ma = unsmob_moment (mom);
 
   return scm_from_int (ma->main_part_.numerator ());
@@ -139,7 +139,7 @@ LY_DEFINE (ly_moment_main_denominator, "ly:moment-main-denominator",
           1, 0, 0, (SCM mom),
           "Extract denominator from main timing.")
 {
-  LY_ASSERT_FIRST_SMOB (Moment, mom);
+  LY_ASSERT_SMOB (Moment, mom, 1);
   Moment *ma = unsmob_moment (mom);
 
   return scm_from_int (ma->main_part_.denominator ());
@@ -149,8 +149,8 @@ LY_DEFINE (ly_moment_less_p, "ly:moment<?",
           2, 0, 0, (SCM a, SCM b),
           "Compare two moments.")
 {
-  LY_ASSERT_FIRST_SMOB(Moment, a); 
-  LY_ASSERT_SMOB (Moment, 2); 
+  LY_ASSERT_SMOB (Moment, a, 1); 
+  LY_ASSERT_SMOB (Moment, b, 2); 
   
   Moment *ma = unsmob_moment (a);
   Moment *mb = unsmob_moment (b);
index e18a233d4b9835d7c0a21575d50c78811d6d366b..828929994a93515b22840709f5a5efdcda65d28c 100644 (file)
@@ -11,7 +11,7 @@ LY_DEFINE (ly_music_function_extract, "ly:music-function-extract", 1, 0, 0,
           (SCM x),
           "Return the Scheme function inside @var{x}")
 {
-  LY_ASSERT_FIRST_TYPE(is_music_function, x);
+  LY_ASSERT_TYPE (is_music_function, x, 1);
   
   return SCM_CELL_OBJECT_1(x);
 }
@@ -23,7 +23,7 @@ LY_DEFINE (ly_make_music_function, "ly:make-music-function", 2, 0, 0,
           "Its arguments. @code{signature} is a list containing either "
           "@code{ly:music?} predicates or other type predicates.")
 {
-  LY_ASSERT_FIRST_TYPE(ly_is_procedure, func);
+  LY_ASSERT_TYPE (ly_is_procedure, func, 1);
   return  make_music_function (signature, func);
 }
 
index ca152ef812d03c388ae74390e3103869bf4bcd5f..1e08ba26ef0d42956f5a6975c83857d9df2f9794 100644 (file)
@@ -15,7 +15,7 @@ LY_DEFINE (ly_music_length, "ly:music-length",
           1, 0, 0, (SCM mus),
           "Get the length of music expression @var{mus}, and return as a @code{Moment} object.")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
   Music *sc = unsmob_music (mus);
   return sc->get_length ().smobbed_copy ();
 }
@@ -25,7 +25,7 @@ LY_DEFINE (ly_music_property,
           "Get the property @var{sym} of music expression @var{mus}.\n"
           "If @var{sym} is undefined, return @code{'()}.\n")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
   return ly_prob_property (mus,sym,dfault);
 }
 
@@ -33,7 +33,7 @@ LY_DEFINE (ly_music_set_property_x, "ly:music-set-property!",
           3, 0, 0, (SCM mus, SCM sym, SCM val),
           "Set property @var{sym} in music expression @var{mus} to @var{val}.")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
 
   return ly_prob_set_property_x (mus, sym, val);
 }
@@ -68,7 +68,7 @@ LY_DEFINE (ly_music_mutable_properties, "ly:music-mutable-properties",
           "they are constant and initialized by the "
           "@code{make-music} function.\n")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
   Music *m = unsmob_music (mus);
   return m->get_property_alist (true);
 }
@@ -110,8 +110,8 @@ LY_DEFINE (ly_music_transpose, "ly:music-transpose",
           "Transpose @var{m} such that central C is mapped to @var{p}. "
           "Return @var{m}.")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_music, m);
-  LY_ASSERT_SMOB (Pitch, 2);
+  LY_ASSERT_TYPE (unsmob_music, m, 1);
+  LY_ASSERT_SMOB (Pitch, p, 2);
 
   Music *sc = unsmob_music (m);
   Pitch *sp = unsmob_pitch (p);
@@ -128,8 +128,8 @@ LY_DEFINE (ly_music_compress, "ly:music-compress",
           2, 0, 0, (SCM m, SCM factor),
           "Compress music object @var{m} by moment @var{factor}.")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_music, m);
-  LY_ASSERT_TYPE(unsmob_moment, 2);
+  LY_ASSERT_TYPE (unsmob_music, m, 1);
+  LY_ASSERT_TYPE(unsmob_moment,factor, 2);
 
   Music *sc = unsmob_music (m);
   sc->compress (*unsmob_moment (factor));
@@ -140,7 +140,7 @@ LY_DEFINE (ly_music_duration_length, "ly:music-duration-length", 1, 0, 0,
           (SCM mus),
           "Extract the duration field from @var{mus}, and return the length.")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
   Music *m = unsmob_music (mus);
 
   Duration *d = unsmob_duration (m->get_property ("duration"));
@@ -157,8 +157,8 @@ LY_DEFINE (ly_music_duration_compress, "ly:music-duration-compress", 2, 0, 0,
           (SCM mus, SCM fact),
           "Compress @var{mus} by factor @var{fact}, which is a @code{Moment}.")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
-  LY_ASSERT_SMOB (Moment, 2);
+  LY_ASSERT_TYPE (unsmob_music, mus, 1);
+  LY_ASSERT_SMOB (Moment, fact, 2);
   
   Music *m = unsmob_music (mus);
   Moment *f = unsmob_moment (fact);
index afd814705dd1fd3aa5ffe6d423bd79b0eeef1926..57919802694ae70582e83e21bf0ffa0106149746 100644 (file)
@@ -16,9 +16,9 @@ LY_DEFINE(ly_note_head__stem_attachment, "ly:note-head::stem-attachment",
          "Get attachment in @var{font-metric} for attaching a stem to notehead "
          "@var{glyph-name}.")
 {
-  LY_ASSERT_FIRST_SMOB (Font_metric, font_metric);
+  LY_ASSERT_SMOB (Font_metric, font_metric, 1);
   Font_metric *fm = unsmob_metrics (font_metric);
-  LY_ASSERT_TYPE(scm_is_string, 2);
+  LY_ASSERT_TYPE(scm_is_string,glyph_name, 2);
   
   return ly_offset2scm (Note_head::get_stem_attachment (fm, ly_scm2string (glyph_name)));
 }
index 139150a7ccbf4230d0c84154c8975193d7d9b259..64b140f07e021b10cfc15f1e1390c2d936c63e28 100644 (file)
@@ -14,7 +14,7 @@ LY_DEFINE (ly_font_sub_fonts, "ly:font-sub-fonts", 1, 0, 0,
           "Given the font metric @var{font} of an OpenType font, return the "
           "names of the subfonts within @var{font}.")
 {
-  LY_ASSERT_FIRST_SMOB (Font_metric, font);
+  LY_ASSERT_SMOB (Font_metric, font, 1);
   Font_metric *fm = unsmob_metrics (font);
   return fm->sub_fonts ();
 }
@@ -28,9 +28,8 @@ LY_DEFINE (ly_otf_font_glyph_info, "ly:otf-font-glyph-info", 2, 0, 0,
     = dynamic_cast<Modified_font_metric *> (unsmob_metrics (font));
   Open_type_font *otf = dynamic_cast<Open_type_font *> (fm->original_font ());
 
-  LY_FUNC_NOTE_FIRST_ARG (font);
   SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OTF font-metric");
-  LY_ASSERT_TYPE(scm_is_string, 2);
+  LY_ASSERT_TYPE(scm_is_string, glyph, 2);
 
   SCM sym = scm_string_to_symbol (glyph);
   return scm_hashq_ref (otf->get_char_table (), sym, SCM_EOL);
@@ -48,8 +47,7 @@ LY_DEFINE (ly_otf_font_table_data, "ly:otf-font-table-data", 2, 0, 0,
     : dynamic_cast<Open_type_font *> (unsmob_metrics (font));
 
   SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "Open type font");
-  LY_FUNC_NOTE_FIRST_ARG (font);
-  LY_ASSERT_TYPE (scm_is_string, 2);
+  LY_ASSERT_TYPE (scm_is_string, tag, 2);
 
   char ctag [5] = "    ";
 
index 7e2c1cc4f47e9a9a296bd19b4641418b4b2ee46a..ea216a371fc3ae5ad63d36a31e1f2ef06f8e2564 100644 (file)
@@ -19,9 +19,9 @@ LY_DEFINE (ly_output_def_lookup, "ly:output-def-lookup",
           "Lookup @var{sym} in the Output_def @var{pap}. "
           "Return the value or @var{def} (which defaults to  @code{'()}) if undefined.")
 {
-  LY_ASSERT_FIRST_SMOB (Output_def, pap);
+  LY_ASSERT_SMOB (Output_def, pap, 1);
   Output_def *op = unsmob_output_def (pap);
-  LY_ASSERT_TYPE (ly_is_symbol, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
 
   SCM answer = op->lookup_variable (sym);
   if (answer == SCM_UNDEFINED)
@@ -39,7 +39,7 @@ LY_DEFINE (ly_output_def_scope, "ly:output-def-scope",
           1, 0, 0, (SCM def),
           "Get the variable scope inside @var{def}.")
 {
-  LY_ASSERT_FIRST_SMOB (Output_def, def);
+  LY_ASSERT_SMOB (Output_def, def, 1);
   Output_def *op = unsmob_output_def (def);
   return op->scope_;
 }
@@ -48,7 +48,7 @@ LY_DEFINE (ly_output_def_parent, "ly:output-def-parent",
           1, 0, 0, (SCM def),
           "Get the parent output-def of @var{def}.")
 {
-  LY_ASSERT_FIRST_SMOB (Output_def, def);
+  LY_ASSERT_SMOB (Output_def, def, 1);
   Output_def *op = unsmob_output_def (def);
   return op->parent_ ? op->parent_->self_scm () : SCM_EOL;
 }
@@ -57,7 +57,7 @@ LY_DEFINE (ly_output_def_clone, "ly:output-def-clone",
           1, 0, 0, (SCM def),
           "Clone @var{def}.")
 {
-  LY_ASSERT_FIRST_SMOB (Output_def, def);
+  LY_ASSERT_SMOB (Output_def, def, 1);
   Output_def *op = unsmob_output_def (def);
 
   Output_def *clone = op->clone ();
@@ -93,7 +93,7 @@ LY_DEFINE (ly_paper_outputscale, "ly:paper-outputscale",
           1, 0, 0, (SCM bp),
           "Get output-scale for BP.")
 {
-  LY_ASSERT_FIRST_SMOB (Output_def, bp);
+  LY_ASSERT_SMOB (Output_def, bp, 1);
   Output_def *b = unsmob_output_def (bp);
   return scm_from_double (output_scale (b));
 }
@@ -114,7 +114,7 @@ LY_DEFINE (ly_paper_get_font, "ly:paper-get-font", 2, 0, 0,
           "(An alist chain is a list of alists, "
           "containing grob properties).\n")
 {
-  LY_ASSERT_FIRST_SMOB (Output_def, paper_smob);
+  LY_ASSERT_SMOB (Output_def, paper_smob, 1);
 
   Output_def *paper = unsmob_output_def (paper_smob);
   Font_metric *fm = select_font (paper, chain);
@@ -126,7 +126,7 @@ LY_DEFINE (ly_paper_get_number, "ly:paper-get-number", 2, 0, 0,
           "Return the layout variable @var{name}.")
 {
  
-  LY_ASSERT_FIRST_SMOB (Output_def, layout_smob);
+  LY_ASSERT_SMOB (Output_def, layout_smob, 1);
   Output_def *layout = unsmob_output_def (layout_smob);
   return scm_from_double (layout->get_dimension (name));
 }
@@ -136,7 +136,7 @@ LY_DEFINE (ly_paper_fonts, "ly:paper-fonts",
           (SCM bp),
           "Return fonts from the @code{\\paper} block @var{bp}.")
 {
-  LY_ASSERT_FIRST_SMOB (Output_def, bp);
+  LY_ASSERT_SMOB (Output_def, bp, 1);
   Output_def *b = unsmob_output_def (bp);
 
   SCM tab1 = b->lookup_variable (ly_symbol2scm ("scaled-fonts"));
index 6889ab0f0eb3115ad8c28b8d28264685de80bdb3..613cd01caeba114b232959665260e724639aab59 100644 (file)
@@ -15,7 +15,7 @@ LY_DEFINE (ly_make_pango_description_string, "ly:make-pango-description-string",
           2, 0, 0, (SCM chain, SCM size),
           "Make a PangoFontDescription string for the property alist @var{chain} at size @var{size}.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_number, size);
+  LY_ASSERT_TYPE (scm_is_number, size, 1);
   PangoFontDescription *pfd = properties_to_pango_description (chain, scm_to_double (size));
   char *str = pango_font_description_to_string (pfd);
 
index f78c022502855ebd0c9aa80c17e28614a0a274d0..94bb17f05e0f3626f25e451f99372aa88f316b95 100644 (file)
@@ -14,7 +14,7 @@ LY_DEFINE (ly_paper_book_pages, "ly:paper-book-pages",
           1, 0, 0, (SCM pb),
           "Return pages in book PB.")
 {
-  LY_ASSERT_FIRST_SMOB (Paper_book, pb);
+  LY_ASSERT_SMOB (Paper_book, pb, 1);
   return unsmob_paper_book (pb)->pages ();
 }
 
@@ -22,7 +22,7 @@ LY_DEFINE (ly_paper_book_scopes, "ly:paper-book-scopes",
           1, 0, 0, (SCM book),
           "Return pages in layout book @var{book}.")
 {
-  LY_ASSERT_FIRST_SMOB (Paper_book, book);
+  LY_ASSERT_SMOB (Paper_book, book, 1);
   Paper_book *pb = unsmob_paper_book (book);
 
   SCM scopes = SCM_EOL;
@@ -36,7 +36,7 @@ LY_DEFINE (ly_paper_book_performances, "ly:paper-book-performances",
           1, 0, 0, (SCM paper_book),
           "Return performances in book @var{paper-book}.")
 {
-  LY_ASSERT_FIRST_SMOB (Paper_book, paper_book);
+  LY_ASSERT_SMOB (Paper_book, paper_book, 1);
   return unsmob_paper_book (paper_book)->performances ();
 }
 
@@ -44,7 +44,7 @@ LY_DEFINE (ly_paper_book_systems, "ly:paper-book-systems",
           1, 0, 0, (SCM pb),
           "Return systems in book PB.")
 {
-  LY_ASSERT_FIRST_SMOB (Paper_book, pb);
+  LY_ASSERT_SMOB (Paper_book, pb, 1);
   return unsmob_paper_book (pb)->systems ();
 }
 
@@ -52,7 +52,7 @@ LY_DEFINE (ly_paper_book_paper, "ly:paper-book-paper",
           1, 0, 0, (SCM pb),
           "Return pages in book PB.")
 {
-  LY_ASSERT_FIRST_SMOB (Paper_book, pb);
+  LY_ASSERT_SMOB (Paper_book, pb, 1);
   Paper_book *pbook = unsmob_paper_book (pb);
   return pbook->paper_->self_scm ();
 }
index 36c77a43f266ffa0942276ac1a34e580122b9cee..3c00d79308e40ec3f010349dd7da8d21ee968069 100644 (file)
@@ -17,8 +17,8 @@ LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter",
           "Create an outputter that evaluates within "
           "@code{output-}@var{format}, writing to  @var{port}.")
 {
-  LY_ASSERT_FIRST_TYPE(ly_is_port, port);
-  LY_ASSERT_TYPE (scm_is_string, 2);
+  LY_ASSERT_TYPE (ly_is_port, port, 1);
+  LY_ASSERT_TYPE (scm_is_string, format, 2);
 
   string f = ly_scm2string (format);
 
@@ -44,8 +44,8 @@ LY_DEFINE (ly_outputter_dump_stencil, "ly:outputter-dump-stencil",
           "Dump stencil @var{expr} onto @var{outputter}.")
 {
   
-  LY_ASSERT_FIRST_SMOB (Paper_outputter, outputter);
-  LY_ASSERT_SMOB(Stencil, 2);
+  LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
+  LY_ASSERT_SMOB(Stencil, stencil, 2);
 
   Paper_outputter *po = unsmob_outputter (outputter);
   Stencil *st = unsmob_stencil (stencil);
@@ -58,8 +58,8 @@ LY_DEFINE (ly_outputter_dump_string, "ly:outputter-dump-string",
           2, 0, 0, (SCM outputter, SCM str),
           "Dump @var{str} onto @var{outputter}.")
 {
-  LY_ASSERT_FIRST_SMOB (Paper_outputter, outputter);
-  LY_ASSERT_TYPE(scm_is_string, 2);
+  LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
+  LY_ASSERT_TYPE(scm_is_string, str, 2);
 
   Paper_outputter *po = unsmob_outputter (outputter);
 
@@ -70,7 +70,7 @@ LY_DEFINE (ly_outputter_port, "ly:outputter-port",
           1, 0, 0, (SCM outputter),
           "Return output port for @var{outputter}.")
 {
-  LY_ASSERT_FIRST_SMOB (Paper_outputter, outputter);
+  LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
   Paper_outputter *po = unsmob_outputter (outputter);
 
   return po->file ();
@@ -80,7 +80,7 @@ LY_DEFINE (ly_outputter_close, "ly:outputter-close",
           1, 0, 0, (SCM outputter),
           "Close port of @var{outputter}.")
 {
-  LY_ASSERT_FIRST_SMOB (Paper_outputter, outputter);
+  LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
   Paper_outputter *po = unsmob_outputter (outputter);
 
   po->close ();
@@ -91,7 +91,7 @@ LY_DEFINE (ly_outputter_output_scheme, "ly:outputter-output-scheme",
           2, 0, 0, (SCM outputter, SCM expr),
           "Eval @var{expr} in module of @var{outputter}.")
 {
-  LY_ASSERT_FIRST_SMOB (Paper_outputter, outputter);
+  LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
   Paper_outputter *po = unsmob_outputter (outputter);
 
   po->output_scheme (expr);
index a19a1e39f710aee6437fde2e0a0b9b06fcf9f9d0..055b5363df95d4342661c6c0ae834ba84cb9025f 100644 (file)
@@ -13,7 +13,7 @@ LY_DEFINE (ly_paper_score_paper_systems, "ly:paper-score-paper-systems",
           (SCM paper_score),
           "Return vector of paper_system objects from @var{paper-score}.")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_paper_score, paper_score);
+  LY_ASSERT_TYPE (unsmob_paper_score, paper_score, 1);
 
   Paper_score *pscore = dynamic_cast<Paper_score *> (unsmob_music_output (paper_score));
   return pscore->get_paper_systems ();
index a09904e1e7649af84c58d9b7dfcc7e5ef0a3d983..5da5e3ee729970eb02ad9082b783cf02d1ae803c 100644 (file)
@@ -12,8 +12,8 @@ LY_DEFINE (ly_performance_write, "ly:performance-write",
           2, 0, 0, (SCM performance, SCM filename),
           "Write @var{performance} to @var{filename}")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_performance, performance);
-  LY_ASSERT_TYPE(scm_is_string, 2);
+  LY_ASSERT_TYPE (unsmob_performance, performance, 1);
+  LY_ASSERT_TYPE(scm_is_string, filename, 2);
 
   unsmob_performance (performance)->write_output (ly_scm2string (filename));
   return SCM_UNSPECIFIED;
index 29cbe15b4f2835f5b8080f2d632ef52339a276f2..f22a745ac7d6bcd745533ce2f5ed1acf52844581 100644 (file)
@@ -10,7 +10,7 @@ LY_DEFINE (ly_pfb_2_pfa, "ly:pfb->pfa",
           1, 0, 0, (SCM pfb_file_name),
           "Convert the contents of a PFB file to PFA.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, pfb_file_name);
+  LY_ASSERT_TYPE (scm_is_string, pfb_file_name, 1);
 
   string file_name = ly_scm2string (pfb_file_name);
 
@@ -34,7 +34,7 @@ LY_DEFINE (ly_otf_2_cff, "ly:otf->cff",
           "Convert the contents of a OTF file to CFF file, returning it as "
           " a string.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, otf_file_name);
+  LY_ASSERT_TYPE (scm_is_string, otf_file_name, 1);
 
   string file_name = ly_scm2string (otf_file_name);
   if (be_verbose_global)
index 6dcf79796c9511110b56d0a72ea95aaffaf1f8cd..aa1ac5cbfeb1617f2984dca2ed5be8adb1a4cc74 100644 (file)
@@ -13,8 +13,8 @@ LY_DEFINE (ly_pitch_transpose, "ly:pitch-transpose",
           "Transpose @var{p} by the amount @var{delta}, "
           "where @var{delta} is relative to middle C.")
 {
-  LY_ASSERT_FIRST_SMOB (Pitch, p);
-  LY_ASSERT_SMOB (Pitch, 2);
+  LY_ASSERT_SMOB (Pitch, p, 1);
+  LY_ASSERT_SMOB (Pitch, delta, 2);
 
   Pitch *t = unsmob_pitch (p);
   Pitch *d = unsmob_pitch (delta);
@@ -30,9 +30,9 @@ LY_DEFINE (ly_make_pitch, "ly:make-pitch",
           "with 0 corresponding to C and 6 corresponding to B.  "
           "The @var{alter} is a rational number of whole tones for alteration.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_integer, octave);
-  LY_ASSERT_TYPE(scm_is_integer, 2);
-  LY_ASSERT_TYPE(scm_is_rational, 3);
+  LY_ASSERT_TYPE (scm_is_integer, octave, 1);
+  LY_ASSERT_TYPE(scm_is_integer, note, 2);
+  LY_ASSERT_TYPE(scm_is_rational, alter, 3);
   
   Pitch p (scm_to_int (octave), scm_to_int (note),
           ly_scm2rational (alter));
@@ -44,7 +44,7 @@ LY_DEFINE (ly_pitch_negate, "ly:pitch-negate", 1, 0, 0,
           (SCM p),
           "Negate @var{p}.")
 {
-  LY_ASSERT_FIRST_SMOB (Pitch, p);
+  LY_ASSERT_SMOB (Pitch, p, 1);
   Pitch *pp = unsmob_pitch (p);
   return pp->negated ().smobbed_copy ();
 }
@@ -53,7 +53,7 @@ LY_DEFINE (ly_pitch_steps, "ly:pitch-steps", 1, 0, 0,
           (SCM p),
           "Number of steps counted from middle C of the pitch @var{p}.")
 {
-  LY_ASSERT_FIRST_SMOB (Pitch, p);
+  LY_ASSERT_SMOB (Pitch, p, 1);
   Pitch *pp = unsmob_pitch (p);
   return scm_from_int (pp->steps ());
 }
@@ -62,7 +62,7 @@ LY_DEFINE (ly_pitch_octave, "ly:pitch-octave",
           1, 0, 0, (SCM pp),
           "Extract the octave from pitch @var{p}.")
 {
-  LY_ASSERT_FIRST_SMOB (Pitch, pp);
+  LY_ASSERT_SMOB (Pitch, pp, 1);
   Pitch *p = unsmob_pitch (pp);
   int q = p->get_octave ();
   return scm_from_int (q);
@@ -72,7 +72,7 @@ LY_DEFINE (ly_pitch_alteration, "ly:pitch-alteration",
           1, 0, 0, (SCM pp),
           "Extract the alteration from pitch  @var{p}.")
 {
-  LY_ASSERT_FIRST_SMOB (Pitch, pp);
+  LY_ASSERT_SMOB (Pitch, pp, 1);
   Pitch *p = unsmob_pitch (pp);
   Rational q = p->get_alteration ();
 
@@ -83,7 +83,7 @@ LY_DEFINE (pitch_notename, "ly:pitch-notename",
           1, 0, 0, (SCM pp),
           "Extract the note name from pitch  @var{pp}.")
 {
-  LY_ASSERT_FIRST_SMOB (Pitch, pp);
+  LY_ASSERT_SMOB (Pitch, pp, 1);
   Pitch *p = unsmob_pitch (pp);
   int q = p->get_notename ();
   return scm_from_int (q);
@@ -93,7 +93,7 @@ LY_DEFINE (ly_pitch_quartertones, "ly:pitch-quartertones",
           1, 0, 0, (SCM pp),
           "Calculate the number of quarter tones of @var{p} from middle C.")
 {
-  LY_ASSERT_FIRST_SMOB (Pitch, pp);
+  LY_ASSERT_SMOB (Pitch, pp, 1);
   Pitch *p = unsmob_pitch (pp);
   int q = p->rounded_quartertone_pitch ();
   return scm_from_int (q);
@@ -103,7 +103,7 @@ LY_DEFINE (ly_pitch_semitones, "ly:pitch-semitones",
           1, 0, 0, (SCM pp),
           "calculate the number of semitones of @var{p} from middle C.")
 {
-  LY_ASSERT_FIRST_SMOB (Pitch, pp);
+  LY_ASSERT_SMOB (Pitch, pp, 1);
   Pitch *p = unsmob_pitch (pp);
   int q = p->rounded_semitone_pitch ();
   return scm_from_int (q);
@@ -113,8 +113,8 @@ LY_DEFINE (ly_pitch_less_p, "ly:pitch<?",
           2, 0, 0, (SCM p1, SCM p2),
           "Is @var{p1} lexicographically smaller than @var{p2}?")
 {
-  LY_ASSERT_FIRST_SMOB (Pitch, p1);
-  LY_ASSERT_SMOB (Pitch, 2);
+  LY_ASSERT_SMOB (Pitch, p1, 1);
+  LY_ASSERT_SMOB (Pitch, p2, 2);
 
   Pitch *a = unsmob_pitch (p1);
   Pitch *b = unsmob_pitch (p2);
@@ -131,8 +131,8 @@ LY_DEFINE (ly_pitch_diff, "ly:pitch-diff",
           "@var{delta} equals @var{root}")
 {
  
-  LY_ASSERT_FIRST_SMOB (Pitch, pitch);
-  LY_ASSERT_SMOB (Pitch, 2);
+  LY_ASSERT_SMOB (Pitch, pitch, 1);
+  LY_ASSERT_SMOB (Pitch, root, 2);
 
   Pitch *p = unsmob_pitch (pitch);
   Pitch *r = unsmob_pitch (root);
index acaf22a53692de10508ae804c9ef390b1db02e0a..c22c88bc729ab57a1c189ce10def62f0c730fdd7 100644 (file)
@@ -12,9 +12,9 @@ LY_DEFINE (ly_prob_set_property_x, "ly:prob-set-property!",
           2, 1, 0, (SCM obj, SCM sym, SCM value),
           "Set property @var{sym} of @var{obj} to @var{value}")
 {
-  LY_ASSERT_FIRST_SMOB (Prob, obj);
+  LY_ASSERT_SMOB (Prob, obj, 1);
   Prob *ps = unsmob_prob (obj);
-  LY_ASSERT_TYPE (ly_is_symbol, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
 
   ps->set_property (sym, value);
   return SCM_UNSPECIFIED;
@@ -34,9 +34,9 @@ LY_DEFINE (ly_prob_property, "ly:prob-property",
           2, 1, 0, (SCM obj, SCM sym, SCM dfault),
           "Return the value for @var{sym}.")
 {
-  LY_ASSERT_FIRST_SMOB (Prob, obj);
+  LY_ASSERT_SMOB (Prob, obj, 1);
   Prob *ps = unsmob_prob (obj);
-  LY_ASSERT_TYPE (ly_is_symbol, 2);
+  LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
 
   if (dfault == SCM_UNDEFINED)
     dfault = SCM_EOL;
index 4b47d9b5b9016938a0e72c369ee11712bd3ea197..fe0f290c2744c60dd9a5dc65871d645841cab11d 100644 (file)
@@ -174,8 +174,8 @@ LY_DEFINE (ly_add_option, "ly:add-option", 3, 0, 0,
     {
       option_hash = scm_permanent_object (scm_c_make_hash_table (11));
     }
-  LY_ASSERT_FIRST_TYPE (ly_is_symbol, sym);
-  LY_ASSERT_TYPE (scm_is_string, 3);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 1);
+  LY_ASSERT_TYPE (scm_is_string, description, 3);
 
   internal_set_option (sym, val);
 
@@ -188,7 +188,7 @@ LY_DEFINE (ly_add_option, "ly:add-option", 3, 0, 0,
 LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
           "Set a program option.")
 {
-  LY_ASSERT_FIRST_TYPE(ly_is_symbol, var);
+  LY_ASSERT_TYPE (ly_is_symbol, var, 1);
 
   if (val == SCM_UNDEFINED)
     val = SCM_BOOL_T;
@@ -239,6 +239,6 @@ LY_DEFINE (ly_all_options, "ly:all-options",
 LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
           "Get a global option setting.")
 {
-  LY_ASSERT_FIRST_TYPE(ly_is_symbol, var);
+  LY_ASSERT_TYPE (ly_is_symbol, var, 1);
   return scm_hashq_ref (option_hash, var, SCM_BOOL_F);
 }
index 4ba1a5bc2c5f11ab7ea5aa9dd05dca56488060e8..0859c25dba306de8fdddaca00c4a421fb0c7a9c6 100644 (file)
@@ -66,7 +66,7 @@ LY_DEFINE (ly_set_default_scale, "ly:set-default-scale",
           1, 0, 0, (SCM scale),
           "Set the global default scale.")
 {
-  LY_ASSERT_FIRST_SMOB (Scale, scale);
+  LY_ASSERT_SMOB (Scale, scale, 1);
 
   Scale *s = Scale::unsmob (scale);
   if (default_global_scale)
index 326ba2ecdce755d020778036c667927693befac9..004c14c14f2ea748d96580a8d137c4b5eba1e029 100644 (file)
@@ -16,7 +16,7 @@ LY_DEFINE (ly_make_listener, "ly:make-listener",
           "\n"
           " @var{callback} should take exactly one argument." )
 {
-  LY_ASSERT_FIRST_TYPE(ly_is_procedure, callback);
+  LY_ASSERT_TYPE (ly_is_procedure, callback, 1);
   Scheme_listener *l = new Scheme_listener (callback);
   SCM listener = GET_LISTENER (l->call).smobbed_copy ();
   l->unprotect ();
index 7cf79abe8f3fdd1a7e46811e40c5283463e6a7c7..4e08f46ae1e62841d253aa6220b12ed459a3077c 100644 (file)
@@ -20,7 +20,7 @@ LY_DEFINE (ly_make_score, "ly:make-score",
           (SCM music),
           "Return score with @var{music} encapsulated in @var{score}.")
 {
-  LY_ASSERT_FIRST_SMOB (Music, music);
+  LY_ASSERT_SMOB (Music, music, 1);
   Music *mus = unsmob_music (music);
 
   Score *score = new Score;
@@ -33,7 +33,7 @@ LY_DEFINE (ly_score_output_defs, "ly:score-output-defs",
           1, 0, 0, (SCM score),
           "All output defs in a score.")
 {
-  LY_ASSERT_FIRST_SMOB (Score, score);
+  LY_ASSERT_SMOB (Score, score, 1);
   Score *sc = unsmob_score (score);
 
   SCM l = SCM_EOL;
@@ -48,7 +48,7 @@ LY_DEFINE (ly_score_header, "ly:score-header",
           1, 0, 0, (SCM score),
           "return score header.")
 {
-  LY_ASSERT_FIRST_SMOB (Score, score);
+  LY_ASSERT_SMOB (Score, score, 1);
   Score *sc = unsmob_score (score);
   return sc->header_;
 }
@@ -58,7 +58,7 @@ LY_DEFINE (ly_score_music, "ly:score-music",
           1, 0, 0, (SCM score),
           "return score music.")
 {
-  LY_ASSERT_FIRST_SMOB (Score, score);
+  LY_ASSERT_SMOB (Score, score, 1);
   Score *sc = unsmob_score (score);
   return sc->get_music ();
 }
@@ -67,7 +67,7 @@ LY_DEFINE (ly_score_error_p, "ly:score-error?",
           1, 0, 0, (SCM score),
           "Was there an error in the score?")
 {
-  LY_ASSERT_FIRST_SMOB (Score, score);
+  LY_ASSERT_SMOB (Score, score, 1);
   Score *sc = unsmob_score (score);
   return scm_from_bool (sc->error_found_);
 }
@@ -79,8 +79,8 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
           "return a list of layout-lines. "
           "\nTake optional Object_key argument.")
 {
-  LY_ASSERT_FIRST_SMOB (Score, score);
-  LY_ASSERT_SMOB (Output_def, 2);
+  LY_ASSERT_SMOB (Score, score, 1);
+  LY_ASSERT_SMOB (Output_def, layout, 2);
 
   Score *sc = unsmob_score (score);
   Output_def *od = unsmob_output_def (layout);
index 2d702edcd0d2a30d8d308212d2efdd10a80a8b58..2e0f4ba9f73883a31832c40afff776dd1b8821ed 100644 (file)
@@ -23,15 +23,13 @@ LY_DEFINE (ly_solve_spring_rod_problem, "ly:solve-spring-rod-problem",
           "negative for compressing and #f for non-satisfied constraints) "
           "followed by the @var{spring-count}+1 positions of the objects. ")
 {
-  LY_FUNC_NOTE_FIRST_ARG(springs);
-  
   int len = scm_ilength (springs);
   if (len == 0)
     return scm_list_2 (scm_from_double (0.0), scm_from_double (0.0));
 
   SCM_ASSERT_TYPE (len >= 0, springs, SCM_ARG1, __FUNCTION__, "list of springs");
   SCM_ASSERT_TYPE (scm_ilength (rods)  > 0, rods, SCM_ARG1, __FUNCTION__, "list of rods");
-  LY_ASSERT_TYPE(scm_is_number, 3);
+  LY_ASSERT_TYPE(scm_is_number, length, 3);
 
   bool is_ragged = ragged == SCM_BOOL_T;
   Simple_spacer spacer;
index c9bb9e37ab22d86505b36b4580af8b4a22a6fa1f..ec70ba6817b6e9bab5a4a9d51bd6c3f548eb2f1d 100644 (file)
@@ -15,8 +15,8 @@ LY_DEFINE (ly_spanner_bound, "ly:spanner-bound",
           "Get one of the bounds of @var{spanner}. @var{dir} is @code{-1} "
           "for left, and @code{1} for right.")
 {
-  LY_ASSERT_FIRST_TYPE (unsmob_spanner, slur);
-  LY_ASSERT_TYPE(is_direction, 2);
+  LY_ASSERT_TYPE (unsmob_spanner, slur, 1);
+  LY_ASSERT_TYPE(is_direction, dir,2);
   
   return unsmob_spanner (slur)->get_bound (to_dir (dir))->self_scm ();
 }
@@ -27,7 +27,7 @@ LY_DEFINE (ly_spanner_broken_into, "ly:spanner-broken-into",
           1, 0, 0, (SCM spanner),
           "Return broken-into list for @var{spanner}.")
 {
-  SCM_ASSERT_FIRST_TYPE (unsmob_spanner, spanner);
+  LY_ASSERT_TYPE (unsmob_spanner, spanner, 1);
   Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (spanner));
 
   SCM s = SCM_EOL;
index 134e6cc18489977eadc610eba15cf07dad0cc44f..8e0094f143d29abc7f56e8db760e161f934e9f23 100644 (file)
@@ -14,7 +14,7 @@ LY_DEFINE (ly_grob_staff_position, "ly:grob-staff-position",
           1, 0, 0, (SCM sg),
           "Return the Y-position of @var{sg} relative to the staff.")
 {
-  LY_ASSERT_FIRST_SMOB (Grob, sg);
+  LY_ASSERT_SMOB (Grob, sg, 1);
   Grob *g = unsmob_grob (sg);
   Real pos = Staff_symbol_referencer::get_position (g);
 
index 619d43d3162ecf67df405a3a8b295c669f5dce4f..90a82ec466eeedd6dfc12f3754879487c24fd459 100644 (file)
@@ -21,18 +21,12 @@ LY_DEFINE (ly_stencil_translate_axis, "ly:stencil-translate-axis",
           "Return a copy of @var{stil} but translated by @var{amount} in @var{axis} direction.")
 {
   Stencil *s = unsmob_stencil (stil);
-  LY_ASSERT_FIRST_SMOB(Stencil, stil);
-  LY_ASSERT_TYPE(scm_is_number, 2);
+  LY_ASSERT_SMOB (Stencil, stil, 1);
+  LY_ASSERT_TYPE(scm_is_number,amount, 2);
+  LY_ASSERT_TYPE(is_axis,axis, 3);
 
   Real real_amount = scm_to_double (amount);
 
-#if 0
-  SCM_ASSERT_TYPE (!isinf (real_amount) && !isnan (real_amount),
-                  amount, SCM_ARG2, __FUNCTION__, "finite number");
-#endif
-
-  LY_ASSERT_TYPE(is_axis, 3);
-
   SCM new_s = s->smobbed_copy ();
   Stencil *q = unsmob_stencil (new_s);
   q->translate_axis (real_amount, Axis (scm_to_int (axis)));
@@ -45,8 +39,8 @@ LY_DEFINE (ly_stencil_translate, "ly:stencil-translate",
           "but translated by @var{offset} (a pair of numbers).")
 {
   Stencil *s = unsmob_stencil (stil);
-  LY_ASSERT_FIRST_SMOB(Stencil, stil);
-  LY_ASSERT_TYPE(is_number_pair, 2);
+  LY_ASSERT_SMOB (Stencil, stil, 1);
+  LY_ASSERT_TYPE(is_number_pair, offset, 2);
   Offset o = ly_scm2offset (offset);
 
   SCM new_s = s->smobbed_copy ();
@@ -60,7 +54,7 @@ LY_DEFINE (ly_stencil_expr, "ly:stencil-expr",
           "Return the expression of @var{stil}.")
 {
   Stencil *s = unsmob_stencil (stil);
-  LY_ASSERT_FIRST_SMOB(Stencil, stil);
+  LY_ASSERT_SMOB (Stencil, stil, 1);
   return s->expr ();
 }
 
@@ -70,8 +64,8 @@ LY_DEFINE (ly_stencil_extent, "ly:stencil-extent",
           "@var{axis} direction (0 or 1 for x and y axis respectively).")
 {
   Stencil *s = unsmob_stencil (stil);
-  LY_ASSERT_FIRST_SMOB(Stencil, stil);
-  LY_ASSERT_TYPE(is_axis, 2);
+  LY_ASSERT_SMOB (Stencil, stil, 1);
+  LY_ASSERT_TYPE(is_axis, axis, 2);
 
   return ly_interval2scm (s->extent (Axis (scm_to_int (axis))));
 }
@@ -81,7 +75,7 @@ LY_DEFINE (ly_stencil_empty_p, "ly:stencil-empty?",
           "Return whether @var{stil} is empty ")
 {
   Stencil *s = unsmob_stencil (stil);
-  LY_ASSERT_FIRST_SMOB(Stencil, stil);
+  LY_ASSERT_SMOB (Stencil, stil, 1);
   return scm_from_bool (s->is_empty ());
 }
 
@@ -102,24 +96,23 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
   Stencil *s2 = unsmob_stencil (second);
   Stencil result;
 
-  LY_FUNC_NOTE_FIRST_ARG(first);
   SCM_ASSERT_TYPE (s1 || first == SCM_BOOL_F || first == SCM_EOL,
                   first, SCM_ARG1, __FUNCTION__, "Stencil, #f or ()");
   SCM_ASSERT_TYPE (s2 || second == SCM_BOOL_F || second == SCM_EOL,
                   second, SCM_ARG4, __FUNCTION__, "Stencil, #f or ()");
-  LY_ASSERT_TYPE(is_axis, 2);
-  LY_ASSERT_TYPE(is_direction, 3);
+  LY_ASSERT_TYPE(is_axis, axis,  2);
+  LY_ASSERT_TYPE(is_direction, direction, 3);
 
   Real p = 0.0;
   if (padding != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(scm_is_number, 5);
+      LY_ASSERT_TYPE(scm_is_number, padding, 5);
       p = scm_to_double (padding);
     }
   Real m = 0.0;
   if (minimum != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(scm_is_number, 6);
+      LY_ASSERT_TYPE(scm_is_number, minimum, 6);
       m = scm_to_double (minimum);
     }
 
@@ -173,7 +166,6 @@ LY_DEFINE (ly_make_stencil, "ly:make-stencil",
           "If the extents are unspecified, they are taken  to be empty."
           )
 {
-  LY_FUNC_NOTE_FIRST_ARG (expr);
   SCM_ASSERT_TYPE (!scm_is_pair (expr)
                   || is_stencil_head (scm_car (expr)),
                   expr, SCM_ARG1, __FUNCTION__, "registered stencil expression");
@@ -182,14 +174,14 @@ LY_DEFINE (ly_make_stencil, "ly:make-stencil",
   Interval x; 
   if (xext != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(is_number_pair, 2);
+      LY_ASSERT_TYPE(is_number_pair, xext, 2);
       x = ly_scm2interval (xext);
     }
 
   Interval y; 
   if (yext != SCM_UNDEFINED)
     {
-      LY_ASSERT_TYPE(is_number_pair, 3);
+      LY_ASSERT_TYPE(is_number_pair,yext, 3);
       y = ly_scm2interval (yext);
     }
 
@@ -204,9 +196,9 @@ LY_DEFINE (ly_stencil_aligned_to, "ly:stencil-aligned-to",
           "@var{dir} is a number -1, 1 are left and right respectively. "
           "Other values are interpolated (so 0 means the center).")
 {
-  LY_ASSERT_FIRST_SMOB(Stencil, stil);
-  LY_ASSERT_TYPE(is_axis, 2);
-  LY_ASSERT_TYPE(scm_is_number, 3);
+  LY_ASSERT_SMOB (Stencil, stil, 1);
+  LY_ASSERT_TYPE(is_axis,axis, 2);
+  LY_ASSERT_TYPE(scm_is_number, dir, 3);
 
   Stencil target = *unsmob_stencil (stil);
 
@@ -219,7 +211,7 @@ LY_DEFINE (ly_stencil_fonts, "ly:stencil-fonts",
           1, 0, 0, (SCM s),
           " Analyse @var{s}, and return a list of fonts used in @var{s}.")
 {
-  LY_ASSERT_FIRST_SMOB (Stencil, s);
+  LY_ASSERT_SMOB (Stencil, s, 1);
   Stencil *stil = unsmob_stencil (s);
   return find_expression_fonts (stil->expr ());
 }
@@ -228,7 +220,7 @@ LY_DEFINE (ly_stencil_in_color, "ly:stencil-in-color",
           4, 0, 0, (SCM stc, SCM r, SCM g, SCM b),
           "Put @var{stc} in a different color.")
 {
-  LY_ASSERT_FIRST_SMOB (Stencil, stc);
+  LY_ASSERT_SMOB (Stencil, stc, 1);
   Stencil *stil = unsmob_stencil (stc);
   return Stencil (stil->extent_box (),
                  scm_list_3 (ly_symbol2scm ("color"),
@@ -252,8 +244,7 @@ LY_DEFINE (ly_interpret_stencil_expression, "ly:interpret-stencil-expression",
           4, 0, 0, (SCM expr, SCM func, SCM arg1, SCM offset),
           "Parse EXPR, feed bits to FUNC with first arg ARG1")
 {
-  LY_FUNC_NOTE_FIRST_ARG(expr);
-  LY_ASSERT_TYPE (ly_is_procedure, 2);
+  LY_ASSERT_TYPE (ly_is_procedure, func, 2);
 
   Stencil_interpret_arguments a;
   a.func = func;
@@ -272,10 +263,10 @@ LY_DEFINE (ly_bracket, "ly:bracket",
           "given by @var{iv}. The wings protude by an amount of @var{p}, which "
           "may be negative. The thickness is given by @var{t}.")
 {
-  LY_ASSERT_FIRST_TYPE(is_axis, a);
-  LY_ASSERT_TYPE(is_number_pair, 2);
-  LY_ASSERT_TYPE(scm_is_number, 3);
-  LY_ASSERT_TYPE(scm_is_number, 4);
+  LY_ASSERT_TYPE (is_axis, a, 1);
+  LY_ASSERT_TYPE(is_number_pair,iv, 2);
+  LY_ASSERT_TYPE(scm_is_number, t,3);
+  LY_ASSERT_TYPE(scm_is_number, p,4);
 
   return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv),
                          scm_to_double (t),
@@ -288,10 +279,10 @@ LY_DEFINE (ly_stencil_rotate, "ly:stencil-rotate",
           "Return a @var{stil} rotated @var{angle} degrees around point (@var{x}, @var{y}).")
 {
   Stencil *s = unsmob_stencil (stil);
-  LY_ASSERT_FIRST_SMOB(Stencil, stil);
-  LY_ASSERT_TYPE(scm_is_number, 2);
-  LY_ASSERT_TYPE(scm_is_number, 3);
-  LY_ASSERT_TYPE(scm_is_number, 4);
+  LY_ASSERT_SMOB (Stencil, stil, 1);
+  LY_ASSERT_TYPE(scm_is_number,angle, 2);
+  LY_ASSERT_TYPE(scm_is_number, x,3);
+  LY_ASSERT_TYPE(scm_is_number, y, 4);
   Real a = scm_to_double (angle);
   Real x_off = scm_to_double (x);
   Real y_off = scm_to_double (y);
@@ -309,9 +300,9 @@ LY_DEFINE (ly_round_filled_box, "ly:round-filled-box",
           "that prints a black box of dimensions @var{xext}, "
           "@var{yext} and roundness @var{blot}.")
 {
-  LY_ASSERT_FIRST_TYPE(is_number_pair, xext);
-  LY_ASSERT_TYPE(is_number_pair, 2);
-  LY_ASSERT_TYPE(scm_is_number, 3);
+  LY_ASSERT_TYPE (is_number_pair, xext, 1);
+  LY_ASSERT_TYPE(is_number_pair, yext, 2);
+  LY_ASSERT_TYPE(scm_is_number, blot, 3);
 
   return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
                                   scm_to_double (blot)).smobbed_copy ();
@@ -322,7 +313,7 @@ LY_DEFINE (ly_register_stencil_expression, "ly:register-stencil-expression",
           (SCM symbol),
           "Add @var{symbol} as head of a stencil expression")
 {
-  LY_ASSERT_FIRST_TYPE(ly_is_symbol, symbol);
+  LY_ASSERT_TYPE (ly_is_symbol, symbol, 1);
   register_stencil_head (symbol);
   return SCM_UNSPECIFIED;
 }
index 0a4dc71522609ae888a06688669154b9dda7badd..68aedd5497164eb09fa575b80e4b65756cac5a8e 100644 (file)
@@ -12,10 +12,10 @@ LY_DEFINE (ly_make_stream_event, "ly:make-stream-event",
           1, 1, 0, (SCM cl, SCM proplist),
           "Creates a stream event of class @var{cl} with the given mutable property list.\n" )
 {
-  LY_ASSERT_FIRST_TYPE (ly_is_symbol, cl);
+  LY_ASSERT_TYPE (ly_is_symbol, cl, 1);
 
   /* should be scm_list_p, but scm_list_p is expensive. */
-  LY_ASSERT_TYPE(scm_is_pair, 2);
+  LY_ASSERT_TYPE(scm_is_pair, proplist, 2);
   
   if (proplist == SCM_UNDEFINED)
     proplist = SCM_EOL;
@@ -29,8 +29,8 @@ LY_DEFINE (ly_event_property, "ly:event-property",
           "Get the property @var{sym} of stream event @var{mus}.\n"
           "If @var{sym} is undefined, return @code{'()}.\n")
 {
-  LY_ASSERT_FIRST_SMOB (Stream_event, sev);
-  LY_ASSERT_TYPE (ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Stream_event, sev, 1);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
 
   Stream_event *e = unsmob_stream_event (sev);
 
@@ -41,8 +41,8 @@ LY_DEFINE (ly_event_set_property_x, "ly:event-set-property!",
            3, 0, 0, (SCM ev, SCM sym, SCM val),
            "Set property @var{sym} in event @var{ev} to @var{val}.")
 {
-  LY_ASSERT_FIRST_SMOB (Stream_event, ev);
-  LY_ASSERT_TYPE (ly_is_symbol, 2);
+  LY_ASSERT_SMOB (Stream_event, ev, 1);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
   
   return ly_prob_set_property_x (ev, sym, val);
 }
index 50843a03218e7bd4fb87341e5f735d474cb5bc5b..86a1381bb411312e28b337640fe814e5a1dfcbb6 100644 (file)
@@ -25,8 +25,8 @@ Text_interface::interpret_string (SCM layout_smob,
                                  SCM props,
                                  SCM markup)
 {
-  LY_ASSERT_FIRST_SMOB (Output_def, layout_smob);
-  LY_ASSERT_TYPE (scm_is_string, 3);
+  LY_ASSERT_SMOB (Output_def, layout_smob, 1);
+  LY_ASSERT_TYPE (scm_is_string, props, 3);
 
   string str = ly_scm2string (markup);
   Output_def *layout = unsmob_output_def (layout_smob);
index caafc565488af5b4fcc6d1c62b2e3c98c5099e75..31e7afa92e48b95554ddbe9285817a0696773d01 100644 (file)
@@ -15,7 +15,7 @@ LY_DEFINE (ly_translator_name, "ly:translator-name",
           "Return the type name of the translator object @var{trans}. "
           "The name is a symbol.")
 {
-  LY_ASSERT_FIRST_SMOB (Translator, trans);
+  LY_ASSERT_SMOB (Translator, trans, 1);
   Translator *tr = unsmob_translator (trans);
   char const *nm = tr->class_name ();
   return ly_symbol2scm (nm);
@@ -25,7 +25,7 @@ LY_DEFINE (ly_translator_description, "ly:translator-description",
           1, 0, 0, (SCM me),
           "Return an alist of properties of  translator @var{me}.")
 {
-  LY_ASSERT_FIRST_SMOB (Translator, me);
+  LY_ASSERT_SMOB (Translator, me, 1);
   Translator *tr = unsmob_translator (me);
   return tr->translator_description ();
 }
index b34b657dac9d98605a27cb6813c59d1ba32a1fa0..574d1464af7492278189db36e8a7be379a3050e8 100644 (file)
@@ -223,7 +223,7 @@ LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name",
           1, 0, 0, (SCM ttf_file_name),
           "Extract the PostScript name from a TrueType font.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, ttf_file_name);
+  LY_ASSERT_TYPE (scm_is_string, ttf_file_name, 1);
   string file_name = ly_scm2string (ttf_file_name);
   if (be_verbose_global)
     progress_indication ("[" + file_name);
@@ -247,7 +247,7 @@ LY_DEFINE (ly_ttf_2_pfa, "ly:ttf->pfa",
           "Convert the contents of a TTF file to Type42 PFA, returning it as "
           " a string.")
 {
-  LY_ASSERT_FIRST_TYPE(scm_is_string, ttf_file_name);
+  LY_ASSERT_TYPE (scm_is_string, ttf_file_name, 1);
 
   string file_name = ly_scm2string (ttf_file_name);
   if (be_verbose_global)