From 08183a36843d8f629d62c981a53b935d2da48878 Mon Sep 17 00:00:00 2001 From: Iztok Jeras <iztok.jeras@redpitaya.com> Date: 周五, 16 10月 2015 18:36:09 +0800 Subject: [PATCH] integer parser: added test which caused issues with gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf cross compiler --- libscpi/src/units.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libscpi/src/units.c b/libscpi/src/units.c index 517bb1a..f59fe86 100644 --- a/libscpi/src/units.c +++ b/libscpi/src/units.c @@ -200,8 +200,7 @@ * @param mandatory if the parameter is mandatory * @return */ -scpi_bool_t SCPI_ParamNumber(scpi_t * context, const scpi_choice_def_t * special, scpi_number_t * value, scpi_bool_t mandatory) -{ +scpi_bool_t SCPI_ParamNumber(scpi_t * context, const scpi_choice_def_t * special, scpi_number_t * value, scpi_bool_t mandatory) { scpi_token_t token; lex_state_t state; scpi_parameter_t param; @@ -223,7 +222,7 @@ state.pos = state.buffer; state.len = param.len; - switch(param.type) { + switch (param.type) { case SCPI_TOKEN_DECIMAL_NUMERIC_PROGRAM_DATA: case SCPI_TOKEN_HEXNUM: case SCPI_TOKEN_OCTNUM: @@ -234,9 +233,11 @@ value->special = FALSE; result = TRUE; break; + default: + break; } - switch(param.type) { + switch (param.type) { case SCPI_TOKEN_DECIMAL_NUMERIC_PROGRAM_DATA: case SCPI_TOKEN_DECIMAL_NUMERIC_PROGRAM_DATA_WITH_SUFFIX: case SCPI_TOKEN_PROGRAM_MNEMONIC: @@ -251,9 +252,11 @@ case SCPI_TOKEN_OCTNUM: value->base = 8; break; + default: + break; } - switch(param.type) { + switch (param.type) { case SCPI_TOKEN_DECIMAL_NUMERIC_PROGRAM_DATA: SCPI_ParamToDouble(context, ¶m, &(value->value)); break; @@ -280,7 +283,7 @@ scpiLex_CharacterProgramData(&state, &token); /* convert string to special number type */ - SCPI_ParamToChoice(context, &token, special, &tag); + result = SCPI_ParamToChoice(context, &token, special, &tag); value->special = TRUE; value->tag = tag; -- Gitblit v1.9.1