[MINC-development] Small API change suggestion, for C++ compatibility

Sean McBride sean at rogue-research.com
Sat Jun 13 00:12:10 EDT 2009


Hi all,

I know MINC is written in C, but one might want to use its API from C++
code.  There are several functions that take a char* when it seems to me
they should really take a const char*.

Consider this C++ code:

---------
#include "minc.h"

void main (void)
{
  	miattgetstr (0, 0, MIfull_name, 0, NULL);
}
---------

Clearly it is useless, but note the 3rd parameter seems to be a typical
case, passing one of the MI #defines.  Compiled as C++ this warns:

warning: deprecated conversion from string constant to 'char*'

Would you accept a patch adding a bunch of consts?  It would be correct
C and C++.

Thanks,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the MINC-development mailing list