From 25aaafeff2773eb4b23a3883a52b00acad99c237 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Thu, 19 Jul 2012 22:24:37 +0200 Subject: [PATCH] gcode_parse.h: remove unused union. The idea was to clear all flags with one variable, but actually, this raises the binary size instead of lowering it. So, the code in gcode_parse.c, line 354, is probably as fast as it can get. --- gcode_parse.h | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/gcode_parse.h b/gcode_parse.h index 8a3da73..825bbbc 100644 --- a/gcode_parse.h +++ b/gcode_parse.h @@ -23,28 +23,24 @@ typedef struct { /// this holds all the possible data from a received command typedef struct { - union { - struct { - uint8_t seen_G :1; - uint8_t seen_M :1; - uint8_t seen_X :1; - uint8_t seen_Y :1; - uint8_t seen_Z :1; - uint8_t seen_E :1; - uint8_t seen_F :1; - uint8_t seen_S :1; - - uint8_t seen_P :1; - uint8_t seen_T :1; - uint8_t seen_N :1; - uint8_t seen_checksum :1; ///< seen a checksum? - uint8_t seen_semi_comment :1; ///< seen a semicolon? - uint8_t seen_parens_comment :1; ///< seen an open parenthesis - uint8_t option_all_relative :1; ///< relative or absolute coordinates? - uint8_t option_e_relative :1; ///< same for e axis (M82/M83) - uint8_t option_inches :1; ///< inches or millimeters? - }; - uint16_t flags; + struct { + uint8_t seen_G :1; + uint8_t seen_M :1; + uint8_t seen_X :1; + uint8_t seen_Y :1; + uint8_t seen_Z :1; + uint8_t seen_E :1; + uint8_t seen_F :1; + uint8_t seen_S :1; + uint8_t seen_P :1; + uint8_t seen_T :1; + uint8_t seen_N :1; + uint8_t seen_checksum :1; ///< seen a checksum? + uint8_t seen_semi_comment :1; ///< seen a semicolon? + uint8_t seen_parens_comment :1; ///< seen an open parenthesis + uint8_t option_all_relative :1; ///< relative or absolute coordinates? + uint8_t option_e_relative :1; ///< same for e axis (M82/M83) + uint8_t option_inches :1; ///< inches or millimeters? }; uint8_t G; ///< G command number