X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fsmobs.hh;h=a816b67ca3df9e0f0f2228e5729102c06d0e0036;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=bc4b61d7fd491218d7fe45fe9c4140fc9aa8c373;hpb=10d0d9e67d52b1655435cf8e154c13523b9cbef9;p=lilypond.git diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index bc4b61d7fd..a816b67ca3 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1999--2014 Han-Wen Nienhuys + Copyright (C) 1999--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -179,12 +179,8 @@ private: static SCM mark_trampoline (SCM); // Used for calling mark_smob static size_t free_smob (SCM obj); static SCM equal_p (SCM, SCM); - - // print_smob is the exception. It is unconditionally passed to - // GUILE since the default output of, say, # - // would depend on memory layout, thus being unsuitable for regtest - // comparisons unless filtered. - static int print_smob (SCM, SCM, scm_print_state *); + int print_smob (SCM, scm_print_state *); + static int print_trampoline (SCM, SCM, scm_print_state *); // type_p_name_ can be overriden in the Super class with a static // const char [] string. This requires both a declaration in the @@ -259,6 +255,9 @@ class Smob : public Smob_base { private: SCM self_scm_; SCM protection_cons_; + Smob (const Smob &); // Do not define! Not copyable! +protected: + Smob () : self_scm_ (SCM_UNDEFINED), protection_cons_ (SCM_EOL) { }; public: static size_t free_smob (SCM obj) { @@ -267,7 +266,6 @@ public: } SCM unprotected_smobify_self () { - self_scm_ = SCM_UNDEFINED; self_scm_ = Smob_base::register_ptr (static_cast (this)); return self_scm_; } @@ -281,7 +279,6 @@ public: return self_scm_; } void smobify_self () { - protection_cons_ = SCM_EOL; self_scm_ = unprotected_smobify_self (); protect (); }