From: Martin A. <au...@re...> - 2006-11-15 13:42:26
|
On Wed November 15 2006 14:35, Christophe Fergeau wrote: [...] > > > > > > You can probably just rename unk208 to mediatype in the amarok source > > > (not that I've tried building amarok lately). > > > > Renaming will certainly work. > > > > I think it's quite difficult to avoid these name changes from > > 'unknown' to 'something' from time to time. Mostly the 'unknowns' will > > not be used -- otherwise their use would be known and they would be > > named... unk208 certainly was an exception. > > > > Of course, instead of unk208 I could have named it ITDB_TRACK_UNK208. > > After renaming it to mediatype, I could add a > > > > #define ITDB_TRACK_UNK208 mediatype > > > > What do you think? Maybe someone can throw in a compiler warning into > > the #define? > > I was thinking about how to maintain API compatibility in such cases the > other day, I think an anonymous union could be used and would be nicer > than what you suggest. The main problem being that some older gccs and > some non-gcc compilers have issues with that iirc. > Apart from this issue, I think we can safely replace > struct Itdb_Track { > [...] > guint32 unk208; > [...] > }; > with > struct Itdb_Track { > [...] > union { > guint32 unk208; > guint32 mediatype; > } > [...] > }; > > (not that I have tried to compile any of those proposals... :p ) > > Christophe I think that portability across platforms and compilers is more important than avoiding an occasional api breakage. We can write configure checks for that. And the problem mostly hits only users of cvs versions, these should be able to cope with it. |