Skip to content
Snippets Groups Projects
Commit 81482725 authored by David Gobbi's avatar David Gobbi Committed by Kitware Robot
Browse files

Merge topic 'no-max-wrapped-classes'


8564bb9c Fix HierarchyEntry cppcheck initialization warning
adbcd833 Remove MAX_WRAPPED_CLASSES from vtkWrapPython

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Tested-by: default avatarbuildbot <buildbot@kitware.com>
Merge-request: !10387
parents a5c06005 8564bb9c
No related branches found
No related tags found
No related merge requests found
......@@ -124,7 +124,7 @@ static int vtkParseHierarchy_ReadFileIntoInfo(HierarchyInfo* info, const char* f
/* Find an entry with a binary search */
HierarchyEntry* vtkParseHierarchy_FindEntry(const HierarchyInfo* info, const char* classname)
{
HierarchyEntry key;
HierarchyEntry key = { NULL, NULL, NULL, 0, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 0, 0 };
HierarchyEntry* entry;
size_t i, n, m, l;
char name[32];
......
......@@ -240,13 +240,10 @@ static void vtkWrapPython_GenerateSpecialHeaders(
/* This is the main entry point for the python wrappers. When called,
* it will print the vtkXXPython.c file contents to "fp". */
// NOLINTNEXTLINE(modernize-macro-to-enum)
#define MAX_WRAPPED_CLASSES 256
int VTK_PARSE_MAIN(int argc, char* argv[])
{
ClassInfo* wrappedClasses[MAX_WRAPPED_CLASSES];
unsigned char wrapAsVTKObject[MAX_WRAPPED_CLASSES];
ClassInfo** wrappedClasses;
unsigned char* wrapAsVTKObject;
ClassInfo* data = NULL;
NamespaceInfo* contents;
OptionInfo* options;
......@@ -427,6 +424,7 @@ int VTK_PARSE_MAIN(int argc, char* argv[])
}
/* Check for all special classes before any classes are wrapped */
wrapAsVTKObject = (unsigned char*)malloc(sizeof(unsigned char) * contents->NumberOfClasses);
for (i = 0; i < contents->NumberOfClasses; i++)
{
data = contents->Classes[i];
......@@ -458,6 +456,7 @@ int VTK_PARSE_MAIN(int argc, char* argv[])
}
/* Wrap all of the classes in the file */
wrappedClasses = (ClassInfo**)malloc(sizeof(ClassInfo*) * contents->NumberOfClasses);
for (i = 0; i < contents->NumberOfClasses; i++)
{
data = contents->Classes[i];
......@@ -582,6 +581,8 @@ int VTK_PARSE_MAIN(int argc, char* argv[])
fclose(fp);
free(name_from_file);
free(wrapAsVTKObject);
free(wrappedClasses);
if (hinfo)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment