Re: More compilation fixes for Camel
Philip Van Hoof <[email protected]> Wed, 18 Oct 2006 13:25:58 +0200
| Newsgroups | gmane.comp.gnome.evolution.patches |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2006-10-18 at 13:59 +0300, Tor Lillqvist wrote: > Instead of this cast-o-rama, have you investigated whether it would be > simpler and more correct to change the prototypes of the affected > functions instead (changing signedness or constness of char * parameters > as appropriate), and/or changing signedness/constness of the affected > char* variables? > > Maybe then the need for casts all over the place to avoid warnings would > diminish drastically? Indeed. I have been thinking about correcting the prototypes too. But I figured that most of such corrections would imply changing the API (at least a little bit). I also noticed that most costness and signedness of the functions are indeed correct. It were mostly temporary variables, mostly called "p" and "intPtr" which didn't have the same constness and/or signedness. And often the temporary variable is indeed used by a mixed set of functions that do and don't change the pointer and that do and don't expect the signedness. Another example where the strlen, strcpy, strcmp functions being used with temporary variables that have correct signed and constness. Very few assignments where wrong. So the return values of the functions where probably used to decide about the constness and signedness of the temporary variables. -- Philip Van Hoof, software developer home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org work: vanhoof at x-tend dot be blog: http://pvanhoof.be/blog