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;
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 */
/* { */
+1
View File
@@ -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;