diff --git a/compile.sh b/compile.sh index 3e159b9..60b6070 100755 --- a/compile.sh +++ b/compile.sh @@ -1 +1,29 @@ -g++ -o bin/release/famt -std=gnu++20 -Ofast -flto -fipa-pta -fallow-store-data-races -fgcse-sm -fgcse-las -s -DNDEBUG *.cpp -lncursesw +#!/bin/dash + +language=' + -std=gnu++20 + -fno-rtti + -fno-exceptions + -fno-non-call-exceptions' + +optimizations=' + -Ofast + -flto + -fipa-pta + -fallow-store-data-races + -fgcse-sm + -fgcse-las' + +warnings=' + -Wall + -Wextra + -Wpedantic + -Wmultiple-inheritance + -Wvirtual-inheritance' #-fanalyzer + + +# each global variable is only declared once per single object. +other='-fno-common -fno-fat-lto-objects' + +g++ -o bin/release/famt $language $optimizations $warnings $other -DNDEBUG -s *.cpp -lncursesw +#-static -lncursesw -ltinfo diff --git a/main.cpp b/main.cpp index 9845db5..bc83580 100644 --- a/main.cpp +++ b/main.cpp @@ -94,48 +94,48 @@ int main() /* ====================================================== */ - std::vector trees; + /* std::vector trees; */ - bool quit = false; - char input[128]; - short i; //Number of the entered command - const short numCom = 24; - const char* const commandList[] = - { - "quit", //0 - "rename", //1 - "load", //2 - "save", //3 - "addPerson", //4 - "addPersonWP", //5 Adds a person and connects him to his parents, by their number - "addRelation", //6 Adds a relation between two people input by name - "addRelationID", //7 -||- by number - "findID", //8 - "equate", //9 Enter the number of two trees, the second becomes equal to the first - "combine", //10 - "subtract", //11 - "removePerson", //12 - "removePersonID", //13 - "removeRelation", //14 - "removeRelationID", //15 - "addTree", //16 - "prtRelatives", //17 - "prtMember", //18 - "prtAncestors", //19 - "chooseTree", //20 - "prtCommonAncestor", //21 - "prtOldestAncestors",//22 - "prtTree" //23 - }; + /* bool quit = false; */ + /* char input[128]; */ + /* short i; //Number of the entered command */ + /* const short numCom = 24; */ + /* const char* const commandList[] = */ + /* { */ + /* "quit", //0 */ + /* "rename", //1 */ + /* "load", //2 */ + /* "save", //3 */ + /* "addPerson", //4 */ + /* "addPersonWP", //5 Adds a person and connects him to his parents, by their number */ + /* "addRelation", //6 Adds a relation between two people input by name */ + /* "addRelationID", //7 -||- by number */ + /* "findID", //8 */ + /* "equate", //9 Enter the number of two trees, the second becomes equal to the first */ + /* "combine", //10 */ + /* "subtract", //11 */ + /* "removePerson", //12 */ + /* "removePersonID", //13 */ + /* "removeRelation", //14 */ + /* "removeRelationID", //15 */ + /* "addTree", //16 */ + /* "prtRelatives", //17 */ + /* "prtMember", //18 */ + /* "prtAncestors", //19 */ + /* "chooseTree", //20 */ + /* "prtCommonAncestor", //21 */ + /* "prtOldestAncestors",//22 */ + /* "prtTree" //23 */ + /* }; */ - unsigned curTree = 0, //Currently selected tree ID - id, secondId; // Person IDs - Tree* newTree; - char name[128], secondName[128]; - U8 day, month; //TODO add h m - U16 year; - bool sex; - unsigned father, mother; // IDs + /* unsigned curTree = 0, //Currently selected tree ID */ + /* id, secondId; // Person IDs */ + /* Tree* newTree; */ + /* char name[128], secondName[128]; */ + /* U8 day, month; //TODO add h m */ + /* U16 year; */ + /* bool sex; */ + /* unsigned father, mother; // IDs */ /* do */ /* { */ diff --git a/tree.cpp b/tree.cpp index a324dc8..b1f8acf 100644 --- a/tree.cpp +++ b/tree.cpp @@ -329,6 +329,7 @@ bool Tree::addRelation(const unsigned firstId, const RelType type, const unsigne case ExSpouse: addRelation(secondId, type, firstId, 1); break; + default: assert(!"Unexpected case"); break; } } return 1;