slang-users mailing list

[2007 Date Index] [2007 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[slang-users] const char* argument in functions like SLsmg_write_nstring


Hello everyone,

Why are the string arguments of functions like SLsmg_write_nstring not
of type const char* but of type char*? This makes it quite annoying to
write strings from a C++ std::string with its c_str() member function as
this returns a const char*.

Furthermore I see no reason whatsoever why SLsmg_write_nstring and the
likes should not use const char* type, save for internal variables being
of unsigned char* type which is easily solvable and for
SLutf8_skip_chars taking unsigned char* instead of const unsigned char*
which should also be changed in my opinion.

Taking $type instead of const $type only limits the possible inputs of
the function when it is not necessary. As such I think it would be an
improvement if this was changed.

Regards,

Remko van der Vossen

Attachment: pgp5vcHpKFQm7.pgp
Description: PGP signature






[2007 date index] [2007 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]