Open gunterkoenigsmann opened 4 years ago
I think writing weird comments is a bad idea. I can suggest replacing calls to malloc and memset with a single call to calloc.
It was:
p = (NSVGparser*)malloc(sizeof(NSVGparser));
if (p == NULL) goto error;
memset(p, 0, sizeof(NSVGparser));
It became:
p = (NSVGparser*)calloc(1, sizeof(NSVGparser));
if (p == NULL) goto error;
I also think it's bad form to create a lot of pull requests based on cosmetic statistical analyzer warnings.
CppCheck, if all warnings are enabled, complains if one calls memset on something that contains a float variable. In our case setting the variable to 0 is what we actually intent which means we can tell cppcheck to mute these warnings.