Commit 0bd205ba authored by David Gobbi's avatar David Gobbi Committed by Kitware Robot

Merge topic 'wrap-warn-fix'

91c225bf Fix rule-of-three warnings caused by wrapping
1050c26b Move wrappers to more recent version of bison
cadeae5f Use dynamic array track wrapped instantions
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Mathieu Westphal's avatarMathieu Westphal <mathieu.westphal@kitware.com>
Merge-request: !6901
parents 32a4d0ba 91c225bf
......@@ -103,6 +103,9 @@ public:
unsigned int GetCurrentFailLevel() const { return this->CurrentFailLevel; }
private:
vtkHyperTreeGridScales(const vtkHyperTreeGridScales&) = delete;
vtkHyperTreeGridScales& operator=(const vtkHyperTreeGridScales&) = delete;
/**
* JB Update the cell scales table afin de repondre que la
* table puisse retourner la taille de la maille pour ce niveau
......
......@@ -41,8 +41,6 @@ PURPOSE. See the above copyright notice for more information.
class vtkStatisticsAlgorithmPrivate
{
public:
vtkStatisticsAlgorithmPrivate() = default;
~vtkStatisticsAlgorithmPrivate() = default;
// --------------------------------------------------------------------
/**
* Empty current set of requests
......
......@@ -42,20 +42,23 @@ Many of the rules in this file have the same names as in description
of the grammar in the official ISO standard. The file vtkParse.y is
used to generate the file vtkParse.tab.c, which contains the parser.
1. Get a copy of bison 2.3 or later, it has a yacc-compatible front end.
2. Run yacc -b vtkParse vtkParse.y, it will generate vtkParse.tab.c
1. Get a copy of bison 3.2.3 or later, it has a yacc-compatible front end.
2. Run bison --no-lines -b vtkParse vtkParse.y, to generate vtkParse.tab.c
3. Edit the file vtkParse.tab.c as follows, to eliminate compiler warnings
and to make it pass the git commit hook tests:
a) Convert tabs to 8 spaces, e.g. :%s/\t/ /g
b) Remove extra whitespace from the ends of lines, e.g. :%s/ *$//
c) Remove blank lines at the beginning and end of the file
d) Replace all instances of "static inline" with "static".
a) replace all instances of "static inline" with "static"
b) replace "#if ! defined lint || defined __GNUC__" with "#if 1"
c) remove YY_ATTRIBUTE_UNUSED from yyfillin, yyfill, and yynormal
d) remove the "break;" after "return yyreportAmbiguity"
e) replace "(1-yyrhslen)" with "(1-(int)yyrhslen)"
f) replace "sizeof yynewStates[0] with "sizeof (yyGLRState*)"
g) replace "sizeof yynewLookaheadNeeds[0] with "sizeof (yybool)"
When yacc is run, it should not report any shift/reduce or reduce/reduce
When bison is run, it should not report any shift/reduce or reduce/reduce
warnings. If modifications to the rules cause these warnings to occur,
you can run yacc with the --debug and --verbose options:
yacc --debug --verbose -b vtkParse vtkParse.y
This will cause yacc to produce a file called "vtkParse.output" that
bison --debug --verbose -b vtkParse vtkParse.y
This will cause bison to produce a file called "vtkParse.output" that
will show which rules conflict with other rules.
The rules in vtkParse.y avoid most of the ambiguities that are present
......
This diff is collapsed.
......@@ -18,7 +18,7 @@
This file must be translated to C and modified to build everywhere.
Run bison like this (use bison 3.0.2 or later)
Run bison like this (use bison 3.2.3 or later)
bison --no-lines -b vtkParse vtkParse.y
......@@ -28,7 +28,6 @@ Modify vtkParse.tab.c:
- remove YY_ATTRIBUTE_UNUSED from yyfillin, yyfill, and yynormal
- remove the "break;" after "return yyreportAmbiguity"
- replace "(1-yyrhslen)" with "(1-(int)yyrhslen)"
- remove dead store "yynewStates = YY_NULLPTR;"
- replace "sizeof yynewStates[0] with "sizeof (yyGLRState*)"
- replace "sizeof yynewLookaheadNeeds[0] with "sizeof (yybool)"
*/
......
......@@ -196,7 +196,7 @@ int vtkWrapPython_WrapTemplatedClass(
FILE* fp, ClassInfo* data, FileInfo* file_info, HierarchyInfo* hinfo)
{
char classname[1024];
const char* instantiations[1024];
const char** instantiations = NULL;
int ninstantiations = 0;
int i, j, k, nargs;
ClassInfo* sdata;
......@@ -332,7 +332,7 @@ int vtkWrapPython_WrapTemplatedClass(
}
if (k == ninstantiations)
{
instantiations[ninstantiations++] = name_with_args;
vtkParse_AddStringToArray(&instantiations, &ninstantiations, name_with_args);
}
else
{
......@@ -422,6 +422,8 @@ int vtkWrapPython_WrapTemplatedClass(
"}\n"
"\n");
free((char**)instantiations);
return 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment