diff --git a/CMakeLists.txt b/CMakeLists.txt index c029465..e04676a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,11 +5,8 @@ project(green_crdt) if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) set(GREEN_CRDT_STANDALONE ON) - # why the f do i need this >:( - set(NOT_GREEN_CRDT_STANDALONE OFF) else() set(GREEN_CRDT_STANDALONE OFF) - set(NOT_GREEN_CRDT_STANDALONE ON) endif() message("II GREEN_CRDT_STANDALONE " ${GREEN_CRDT_STANDALONE}) @@ -58,6 +55,10 @@ if (GREEN_CRDT_STANDALONE) endif() endif() + # TODO: also make option + # note: hardcoded on in tests + add_compile_definitions(EXTRA_ASSERTS=1) + endif() # cmake setup end diff --git a/version3/CMakeLists.txt b/version3/CMakeLists.txt index 87719ad..79d0223 100644 --- a/version3/CMakeLists.txt +++ b/version3/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9 FATAL_ERROR) +cmake_minimum_required(VERSION 3.9...3.24 FATAL_ERROR) project(crdt_version3 CXX C) diff --git a/version3/green_crdt/v3/list.hpp b/version3/green_crdt/v3/list.hpp index ca3dc3c..4db4e8a 100644 --- a/version3/green_crdt/v3/list.hpp +++ b/version3/green_crdt/v3/list.hpp @@ -4,7 +4,6 @@ #include #include #include -#include #include diff --git a/version3/green_crdt/v3/text_document.hpp b/version3/green_crdt/v3/text_document.hpp index 31b9022..8c77881 100644 --- a/version3/green_crdt/v3/text_document.hpp +++ b/version3/green_crdt/v3/text_document.hpp @@ -3,6 +3,7 @@ #include "./list.hpp" #include +#include //#include // debug @@ -51,7 +52,7 @@ struct TextDocument { } bool apply(const Op& op) { - if(std::holds_alternative(op)) { + if (std::holds_alternative(op)) { const auto& add_op = std::get(op); //std::cout << "a:" << add_op.id.id << " s:" << add_op.id.seq << " v:" << add_op.value << "\n"; return state.add(add_op.id, add_op.value, add_op.parent_left, add_op.parent_right); @@ -97,7 +98,7 @@ struct TextDocument { return ops; } - // adds in tast with specified parents + // adds in text with specified parents // returns generated ops std::vector addText( std::optional parent_left,