update release compilation, add warnings

This commit is contained in:
vrd
2023-01-17 21:41:36 +02:00
parent 25bcd2e22b
commit e2cf4ba993
3 changed files with 70 additions and 41 deletions
+29 -1
View File
@@ -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
+40 -40
View File
@@ -94,48 +94,48 @@ int main()
/* ====================================================== */ /* ====================================================== */
std::vector<Tree> trees; /* std::vector<Tree> trees; */
bool quit = false; /* bool quit = false; */
char input[128]; /* char input[128]; */
short i; //Number of the entered command /* short i; //Number of the entered command */
const short numCom = 24; /* const short numCom = 24; */
const char* const commandList[] = /* const char* const commandList[] = */
{ /* { */
"quit", //0 /* "quit", //0 */
"rename", //1 /* "rename", //1 */
"load", //2 /* "load", //2 */
"save", //3 /* "save", //3 */
"addPerson", //4 /* "addPerson", //4 */
"addPersonWP", //5 Adds a person and connects him to his parents, by their number /* "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 /* "addRelation", //6 Adds a relation between two people input by name */
"addRelationID", //7 -||- by number /* "addRelationID", //7 -||- by number */
"findID", //8 /* "findID", //8 */
"equate", //9 Enter the number of two trees, the second becomes equal to the first /* "equate", //9 Enter the number of two trees, the second becomes equal to the first */
"combine", //10 /* "combine", //10 */
"subtract", //11 /* "subtract", //11 */
"removePerson", //12 /* "removePerson", //12 */
"removePersonID", //13 /* "removePersonID", //13 */
"removeRelation", //14 /* "removeRelation", //14 */
"removeRelationID", //15 /* "removeRelationID", //15 */
"addTree", //16 /* "addTree", //16 */
"prtRelatives", //17 /* "prtRelatives", //17 */
"prtMember", //18 /* "prtMember", //18 */
"prtAncestors", //19 /* "prtAncestors", //19 */
"chooseTree", //20 /* "chooseTree", //20 */
"prtCommonAncestor", //21 /* "prtCommonAncestor", //21 */
"prtOldestAncestors",//22 /* "prtOldestAncestors",//22 */
"prtTree" //23 /* "prtTree" //23 */
}; /* }; */
unsigned curTree = 0, //Currently selected tree ID /* unsigned curTree = 0, //Currently selected tree ID */
id, secondId; // Person IDs /* id, secondId; // Person IDs */
Tree* newTree; /* Tree* newTree; */
char name[128], secondName[128]; /* char name[128], secondName[128]; */
U8 day, month; //TODO add h m /* U8 day, month; //TODO add h m */
U16 year; /* U16 year; */
bool sex; /* bool sex; */
unsigned father, mother; // IDs /* unsigned father, mother; // IDs */
/* do */ /* do */
/* { */ /* { */
+1
View File
@@ -329,6 +329,7 @@ bool Tree::addRelation(const unsigned firstId, const RelType type, const unsigne
case ExSpouse: case ExSpouse:
addRelation(secondId, type, firstId, 1); addRelation(secondId, type, firstId, 1);
break; break;
default: assert(!"Unexpected case"); break;
} }
} }
return 1; return 1;