[XForms] Genuine API changes to forms.h, glcanvas.h since XForms0.89

jason cipriani jac4 at mindless.com
Tue May 18 13:18:27 EDT 2004


> Angus> I don't see any implications in passing 'unsigned long' to
> Angus> functions that used to receive 'unsigned' vars. Are there any
> Angus> implications when using shared objects?
>
> It might be that binary compatibility is not kept. However, the harm
> is done in 1.0 already, I guess.
>
> Angus> I don't see any implications at all to returning an 'int' from
> Angus> functions that were previously declared as 'void'.
>
> Don't know.

As far as coding go it would only break code that took addresses of these functions and assumed they had a certain type. Should 
be easy to fix in any apps that do that, though.

> Angus> To subscribers of the xforms list The change below assumes that
> Angus> a sizeof(pointer) == 4. Not so on 64 bit machines. How should
> Angus> we address this?

It assumed that sizeof(pointer) == sizeof(int), and 2 byte ints are allowed. If you are trying to keep the size of the structure 
constant then perhaps it would make more sense to change it to:

- int internal_reserved[16];
+ struct flimage_src_ *src; /* src other than file */
+ struct flimage_dest_ *dest; /* destination other than file */
+ char internal_reserved[64 - 2 * sizeof(void *)];

In other words, make the decision right now that internal_reserved is 64 bytes. Cross your fingers that nobody (who can't rebuild 
their apps after the header change) relied on internal_reserved being 64 bytes on a system with ints that weren't 4 bytes, and 
then it becomes simple to change it predictably in the future.

> I think some compiler settings will warn on ignoreing return values.

Is that the case? Even with -Wall -pedantic gcc doesn't warn. It's also perfectly legal to do things like:

  { 0; }

There really shouldn't be any problem converting void returns to int returns other than function pointer problems and shared 
library dynamic linking (dunno how it's done on non-Windows, and it may not even have a problem as C function names aren't 
mangled based on their return value).

Jason
-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm



More information about the Xforms mailing list