Skip to content

Commit

Permalink
Bugfix of wrong fmt library build handling introduced in #82 (#87)
Browse files Browse the repository at this point in the history
* Because fmt is now only builded in release mode, we must not handle it the same way regardless of yaramod build type

* Preserve debug build of fmt

Co-authored-by: Tadeáš Kučera <tadeas.kucera@avast.com>
  • Loading branch information
TadeasKucera and TadeasKucera committed Mar 25, 2020
1 parent a3fcdcb commit d7cfee7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deps/pog/deps/fmt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ExternalProject_Add(
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/fmt"
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${FMT_INSTALL_DIR}
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_POSITION_INDEPENDENT_CODE=${POG_PIC}
Expand Down
2 changes: 1 addition & 1 deletion include/yaramod/types/token_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TokenStream
std::size_t insertIntoStream(std::stringstream* ss, char what);
std::size_t insertIntoStream(std::stringstream* ss, const std::string& what, std::size_t length = 0);
std::size_t insertIntoStream(std::stringstream* ss, TokenStream* ts, TokenIt what);
std::size_t printComment(std::stringstream* ss, TokenStream* ts, TokenIt it, int currentLineTabs, bool alignComment, bool ignoreUserIndent);
std::size_t printComment(std::stringstream* ss, TokenStream* ts, TokenIt it, size_t currentLineTabs, bool alignComment, bool ignoreUserIndent);
private:
std::size_t lineCounter = 0;
std::size_t columnCounter = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/parser/parser_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ void ParserDriver::defineTokens()
currentFileContext()->getLocation().addColumn(str.length());
});

_parser.token("\r\n").action([&](std::string_view str) -> Value {
_parser.token("\r\n").action([&](std::string_view) -> Value {
currentFileContext()->getTokenStream()->setNewLineChar("\r\n");
TokenIt t = emplace_back(NEW_LINE, "\r\n");
_indent.clear();
currentFileContext()->getLocation().addLine();
return t;
});
_parser.token("\n").action([&](std::string_view str) -> Value {
_parser.token("\n").action([&](std::string_view) -> Value {
currentFileContext()->getTokenStream()->setNewLineChar("\n");
TokenIt t = emplace_back(NEW_LINE, "\n");
_indent.clear();
Expand Down
4 changes: 2 additions & 2 deletions src/types/token_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ std::size_t TokenStream::PrintHelper::insertIntoStream(std::stringstream* ss, To
*
* @return columnCounter.
*/
std::size_t TokenStream::PrintHelper::printComment(std::stringstream* ss, TokenStream* ts, TokenIt it, int currentLineTabs, bool alignComment, bool ignoreUserIndent)
std::size_t TokenStream::PrintHelper::printComment(std::stringstream* ss, TokenStream* ts, TokenIt it, size_t currentLineTabs, bool alignComment, bool ignoreUserIndent)
{
auto prevIt = ts->predecessor(it);
auto indentation = it->getIndentation() + 1;
Expand Down Expand Up @@ -542,7 +542,7 @@ void TokenStream::getTextProcedure(PrintHelper& helper, std::stringstream* os, b
if (!_formatted)
autoformat();
BracketStack brackets;
int current_line_tabs = 0;
size_t current_line_tabs = 0;
bool inside_rule = false;
bool inside_hex_string = false;
bool inside_hex_jump = false;
Expand Down

0 comments on commit d7cfee7

Please sign in to comment.