Is it possible to change the char * to const char * in shapes.h. The reason is:
When you compile (with all warnings enabled) such as :
Text(100, 100, "Hello World", MonoTypeface, 32) ;
you get a warning
... warning: passing argument 3 of ‘Text’ discards ‘const’ qualifier from pointer target type
Text(100, 100, "Hello World", MonoTypeface, 32) ;
When there are 100s of such text prompts, I find it really hard to keep looking through all the warnings trying to decide which to ignore and would find it easier to not have such warnings so that I do not miss a 'real' warning.
I use const char * for strings, which also gives the above warning. The reason I use them for strings is because when using multi-dimension prompts/strings, I need to use multi-dim arrays of pointers to the actual string, because they occupy a lot less space than multi-dim array of chars (because, the latter multi-dim array of chars needs to allocate space for the largest string throughout the array and so wastes space, whereas a multi-dim array of pointers does not.) For example, I use const char * for strings for multi language menu prompts and an example of an array I use is:
in the source
int8_t * testStr[2][2] = {
{"A long string of characters","just a few"},
{"Hello", "Another long prompt for displaying"}
};
Is it possible to change the char * to const char * in shapes.h. The reason is:
you get a warning ... warning: passing argument 3 of ‘Text’ discards ‘const’ qualifier from pointer target type Text(100, 100, "Hello World", MonoTypeface, 32) ;
When there are 100s of such text prompts, I find it really hard to keep looking through all the warnings trying to decide which to ignore and would find it easier to not have such warnings so that I do not miss a 'real' warning.
in the source int8_t * testStr[2][2] = { {"A long string of characters","just a few"}, {"Hello", "Another long prompt for displaying"} };
and In the header extern int8_t * testStr[2][2] ;
Thanks Steve