]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/undead.cc
Issue 4798/1: Make alist routines use equal? key comparisons
[lilypond.git] / lily / undead.cc
index 33d5ed545523059a5fc78af38b32a853ae1a29cd..a328c66cafd0e6e376da5b4a7a4765752ea2a759 100644 (file)
 class Undead : public Simple_smob<Undead>
 {
 public:
-  static int print_smob (SCM, SCM, scm_print_state *);
-  static SCM mark_smob (SCM);
+  int print_smob (SCM, scm_print_state *) const;
+  SCM mark_smob () const;
   static const char type_p_name_[];
 private:
   SCM object_;
 public:
-  SCM object () { return object_; }
+  SCM object () const { return object_; }
   Undead (SCM object = SCM_UNDEFINED) : object_ (object) { };
 };
 
 SCM
-Undead::mark_smob (SCM s)
+Undead::mark_smob () const
 {
   bool saved = parsed_objects_should_be_dead;
   parsed_objects_should_be_dead = false;
-  scm_gc_mark (Undead::unsmob (s)->object ());
+  scm_gc_mark (object ());
   parsed_objects_should_be_dead = saved;
   return SCM_UNDEFINED;
 }
 
 int
-Undead::print_smob (SCM undead,
-                    SCM port,
-                    scm_print_state *)
+Undead::print_smob (SCM port, scm_print_state *) const
 {
   scm_puts ("#<Undead ", port);
-  scm_display (Undead::unsmob (undead)->object (), port);
+  scm_display (object (), port);
   scm_puts (" >", port);
   return 1;
 }
@@ -69,7 +67,7 @@ LY_DEFINE (ly_get_undead, "ly:get-undead",
            "Get back object from @var{undead}.")
 {
   LY_ASSERT_SMOB (Undead, undead, 1);
-  return Undead::unsmob (undead)->object ();
+  return unsmob<Undead> (undead)->object ();
 }
 
 // '