From d2e51242d9b8ffb8a3c45668a00e9766c35754ef Mon Sep 17 00:00:00 2001 From: "Y. Sapir" Date: Sun, 25 May 2014 00:53:00 +0300 Subject: [PATCH] Really fix total_used_filament / total_extruded_volume. --- xs/xsp/Print.xsp | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/xs/xsp/Print.xsp b/xs/xsp/Print.xsp index 2e9d32e7..7b694e7d 100644 --- a/xs/xsp/Print.xsp +++ b/xs/xsp/Print.xsp @@ -126,22 +126,6 @@ _constant() Ref brim() %code%{ RETVAL = &THIS->brim; %}; - double total_used_filament(...) - %code%{ - if (items > 1) { - THIS->total_used_filament = (double)SvNV(ST(1)); - } - RETVAL = THIS->total_used_filament; - %}; - - double total_extruded_volume(...) - %code%{ - if (items > 1) { - THIS->total_extruded_volume = (double)SvNV(ST(1)); - } - RETVAL = THIS->total_extruded_volume; - %}; - PrintObjectPtrs* objects() %code%{ RETVAL = &THIS->objects; %}; void clear_objects(); @@ -162,4 +146,27 @@ _constant() Ref add_region(); size_t region_count() %code%{ RETVAL = THIS->regions.size(); %}; +%{ + +double +Print::total_used_filament(...) + CODE: + if (items > 1) { + THIS->total_used_filament = (double)SvNV(ST(1)); + } + RETVAL = THIS->total_used_filament; + OUTPUT: + RETVAL + +double +Print::total_extruded_volume(...) + CODE: + if (items > 1) { + THIS->total_extruded_volume = (double)SvNV(ST(1)); + } + RETVAL = THIS->total_extruded_volume; + OUTPUT: + RETVAL + +%} };