From: Erik Charlebois Date: Sun, 12 May 2013 02:00:47 +0000 (-0400) Subject: VM: Refactor fixup.hpp to Factor style X-Git-Tag: 0.97~1295 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=95d34e8ee7f65234638c1938184f48e32b0cf98e VM: Refactor fixup.hpp to Factor style --- diff --git a/vm/fixup.hpp b/vm/fixup.hpp index 3c768aff8d..fef1d6e2dc 100644 --- a/vm/fixup.hpp +++ b/vm/fixup.hpp @@ -1,46 +1,25 @@ -namespace factor -{ - -template -struct identity { - T operator()(T t) - { - return t; - } +namespace factor { + +template struct identity { + T operator()(T t) { return t; } }; struct no_fixup { - static const bool translated_code_block_map = false; - - object *fixup_data(object *obj) - { - return obj; - } - - code_block *fixup_code(code_block *compiled) - { - return compiled; - } - - object *translate_data(const object *obj) - { - return fixup_data((object *)obj); - } - - code_block *translate_code(const code_block *compiled) - { - return fixup_code((code_block *)compiled); - } - - cell size(object *obj) - { - return obj->size(); - } - - cell size(code_block *compiled) - { - return compiled->size(); - } + static const bool translated_code_block_map = false; + + object* fixup_data(object* obj) { return obj; } + + code_block* fixup_code(code_block* compiled) { return compiled; } + + object* translate_data(const object* obj) { return fixup_data((object*)obj); } + + code_block* translate_code(const code_block* compiled) { + return fixup_code((code_block*)compiled); + } + + cell size(object* obj) { return obj->size(); } + + cell size(code_block* compiled) { return compiled->size(); } }; }