[Bf-committers] char* or char[MAX_FILE] in DNA?

Mitchell Stokes mogurijin at gmail.com
Wed May 12 00:16:22 CEST 2010


Hello devs,

As part of my gsoc project I've added three new char* to Material to store
file paths to shaders. This is kind of a pain, but I've gotten everything
setup to use the char* without crashing. This included editing readfile.c,
writefile.c and material.c. Also I've had to add 9 extra functions to
rna_materials.c. The plus side to this is that there is no arbitrary cap on
the length of the file path. However, the downside is all the extra code.
So, now I have two questions:

Should I continue to use the char* or should I use char[MAX_FILE]? (I have
both working)
If I use char[MAX_FILE], BKE_defineutils.h isn't currently included in any
DNA files, but DNA_space_types defines MAX_FILE again. Is it okay to include
BKE_utildefines.h in DNA_material_types.h?

Thank you,
Mitchell Stokes (Moguri)


More information about the Bf-committers mailing list