gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 64bit changes to gui


From: Ivan Vučica
Subject: Re: 64bit changes to gui
Date: Sun, 17 Feb 2013 13:47:39 +0100

Doesn't "int" also change size between machines?

On 17. 2. 2013., at 12:33, Fred Kiefer <address@hidden> wrote:

Now that I am almost through with the changes to CGFloat, NSInteger and NSUInteger in gui I realized that I did not think about coding. When the size of an instance variable changes from int to NSInteger what should happen to the coding/decoding code? Lets take the tag of an NSControl as the example. The old -initWithCoder: code may look something like this:

     [aDecoder decodeValueOfObjCType: @encode(int) at: &_tag];

Now _tag no longer is an int, is now is an NSInteger. Will that code still work?
Should we change it to @encode(NSInteger)? (I think that is was base did) But that will be something different depending on the machine the code runs on? Is the coding mechanism able to handle that? And will this work for CGFloat as well? And what about old archives, e.g. Gorm files?

For the last batches of changes I no longer changed the types of the instance variables. That is a valid workaround, but only delays the decision what to do. Using local variables of the old type for coding/decoding would also work, but again looks wrong to me.

Fred

_______________________________________________
Gnustep-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]