On 03-Mar-2014 13:47, Martin Owens wrote:
I'm going to rip out c-strings from uri handling. It's dangerous code and needs to be dealt with.
A c string is only "dangerous" if the programmer mistakenly thinks it works the same as std::string. Conversely, all changes to working code are dangerous since a modification introduces the risk of creating a bug and breaking the program.
For the URIs it doesn't matter much what the internal storage method is, so go ahead and change that - in your branch. For bitmap images the underlying libraries, like libPNG, are not going to play nicely with std::string, and it seems a little silly to waste time and memory converting back and forth all the time, since either way in the end Inkscape just carries around a big block of memory. Similarly, a lot of glib uses gchar * (or guchar *) arguments, and some of those functions return values in those formats. It is far from clear to me that requiring everything that talks to glib to convert to/from std::string will reduce the number of bugs in Inkscape.
Regards,
David Mathog mathog@...1176... Manager, Sequence Analysis Facility, Biology Division, Caltech