From 61d083c621c983b7bb06a2d7f3d2dc2a80a442b7 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Mon, 7 Sep 2015 15:13:12 +0100 Subject: [PATCH] test/chimaera.sod: Use the macros for sending messages. Rather than digging about in `_vt' directly. --- test/chimaera.sod | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/chimaera.sod b/test/chimaera.sod index cc72a47..5b55e93 100644 --- a/test/chimaera.sod +++ b/test/chimaera.sod @@ -25,20 +25,20 @@ class Animal : SodObject { class Lion : Animal { void bite() { puts("Munch!"); } - void nml.tickle() { me->_vt->lion.bite(me); } + void nml.tickle() { Lion_bite(me); } } class Goat : Animal { void butt() { puts("Bonk!"); } - void nml.tickle() { me->_vt->goat.butt(me); } + void nml.tickle() { Goat_butt(me); } } class Serpent : Animal { void hiss() { puts("Sssss!"); } void bite() { puts("Nom!"); } void nml.tickle() { - if (SERPENT__CONV_NML(me)->nml.tickles > 2) me->_vt->serpent.bite(me); - else me->_vt->serpent.hiss(me); + if (SERPENT__CONV_NML(me)->nml.tickles > 2) Serpent_bite(me); + else Serpent_hiss(me); } } @@ -55,26 +55,26 @@ static void tickle_animal(Animal *a) for (i = 0; i < 3; i++) { printf("tickle %s #%d...\n", a->_vt->_class->cls.name, i); - a->_vt->nml.tickle(a); + Animal_tickle(a); } } static void provoke_lion(Lion *l) { printf("provoking %s as a lion\n", l->_vt->_class->cls.name); - l->_vt->lion.bite(l); + Lion_bite(l); } static void provoke_goat(Goat *g) { printf("provoking %s as a goat\n", g->_vt->_class->cls.name); - g->_vt->goat.butt(g); + Goat_butt(g); } static void provoke_serpent(Serpent *s) { printf("provoking %s as a serpent\n", s->_vt->_class->cls.name); - s->_vt->serpent.bite(s); + Serpent_bite(s); } int main(void) -- 2.11.0