diff --git a/.gitignore b/.gitignore index f87ed06..935f408 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ *.dSYM/ *.autosave +*.pro.user diff --git a/scpi.pro.user b/scpi.pro.user index df9b4c3..27cb714 100644 --- a/scpi.pro.user +++ b/scpi.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/source/scpi_parser.c b/source/scpi_parser.c index 42c2ca4..f5b43fe 100644 --- a/source/scpi_parser.c +++ b/source/scpi_parser.c @@ -4,6 +4,7 @@ #include #include +#include #include "scpi_parser.h" #include "scpi_errors.h" @@ -61,8 +62,8 @@ static struct { char charbuf[MAX_CHARBUF_LEN + 1]; uint16_t charbuf_i; - int32_t blob_cnt; // preamble counter, if 0, was just #, must read count. Used also for blob body. - int32_t blob_len; // total blob length to read + uint32_t blob_cnt; // preamble counter, if 0, was just #, must read count. Used also for blob body. + uint32_t blob_len; // total blob length to read char string_quote; // symbol used to quote string bool string_escape; // last char was backslash, next quote is literal @@ -861,7 +862,7 @@ static void arg_convert_value(void) break; case SCPI_DT_INT: - j = sscanf(pst.charbuf, "%d", &dest->INT); + j = sscanf(pst.charbuf, "%" SCNu32, &dest->INT); if (j == 0 || pst.charbuf[0] == '\0') { //fail or empty buffer sprintf(ebuf, "Invalid INT value: '%s'", pst.charbuf); @@ -937,7 +938,7 @@ static void pars_blob_preamble_char(uint8_t c) // end of preamble sequence charbuf_terminate(); - sscanf(pst.charbuf, "%d", &pst.blob_len); + sscanf(pst.charbuf, "%" SCNu32, &pst.blob_len); pst.args[pst.arg_i].BLOB_LEN = pst.blob_len; run_command_callback();