diff options
author | FormerLurker <hochgebe@gmail.com> | 2020-11-23 17:39:15 +0300 |
---|---|---|
committer | FormerLurker <hochgebe@gmail.com> | 2020-11-23 17:39:15 +0300 |
commit | f2b52d935ebc81a2eb12cfd7a1c4b924cfc5ea68 (patch) | |
tree | c790f2249ef02d6bdd10dc8d44f9b3bcf58a4cdb /GcodeProcessorLib | |
parent | 3eda30c23a6a8f1679989e1862e6c9d815cdbd7e (diff) |
Implement #18 and #19. Fix some compiler warnings.
Diffstat (limited to 'GcodeProcessorLib')
-rw-r--r-- | GcodeProcessorLib/CMakeLists.txt | 10 | ||||
-rw-r--r-- | GcodeProcessorLib/gcode_parser.cpp | 2 | ||||
-rw-r--r-- | GcodeProcessorLib/utilities.cpp | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/GcodeProcessorLib/CMakeLists.txt b/GcodeProcessorLib/CMakeLists.txt index 21fe511..52d1d3a 100644 --- a/GcodeProcessorLib/CMakeLists.txt +++ b/GcodeProcessorLib/CMakeLists.txt @@ -20,9 +20,17 @@ execute_process( OUTPUT_STRIP_TRAILING_WHITESPACE ) +# get the tag for the current branch +execute_process( + COMMAND git describe --abbrev=0 + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_TAG + OUTPUT_STRIP_TRAILING_WHITESPACE +) + # get the most recent tagged version execute_process( - COMMAND git describe --tags + COMMAND git describe WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_TAGGED_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE diff --git a/GcodeProcessorLib/gcode_parser.cpp b/GcodeProcessorLib/gcode_parser.cpp index 8d2e68a..a4035fb 100644 --- a/GcodeProcessorLib/gcode_parser.cpp +++ b/GcodeProcessorLib/gcode_parser.cpp @@ -480,7 +480,7 @@ bool gcode_parser::try_extract_double(char ** p_p_gcode, double * p_double, unsi ++p; } r += f / ten_pow(n); - *p_precision = n; + *p_precision = (unsigned char)n; } if (neg) { r = -r; diff --git a/GcodeProcessorLib/utilities.cpp b/GcodeProcessorLib/utilities.cpp index 2818eee..b0b0edc 100644 --- a/GcodeProcessorLib/utilities.cpp +++ b/GcodeProcessorLib/utilities.cpp @@ -218,7 +218,7 @@ std::istream& utilities::safe_get_line(std::istream& is, std::string& t) std::string utilities::center(std::string input, int width) { - int input_width = input.length(); + int input_width = (int)input.length(); int difference = width - input_width; if (difference < 1) { |