[Freeciv-Dev] [bug #21950] Game crash with popup message Exhausted city and unit numbers!
Update of bug #21950 (project freeciv): Status: Ready For Test = Fixed Assigned to:None = cazfi Open/Closed:Open = Closed ___ Reply to this item at: http://gna.org/bugs/?21950 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #21950] Game crash with popup message Exhausted city and unit numbers!
Follow-up Comment #6, bug #21950 (project freeciv): #define IDENTITY_NUMBER_SIZE (1+((MAX_UINT16 2) + 3)) What is the +3 for? ___ Reply to this item at: http://gna.org/bugs/?21950 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #21950] Game crash with popup message Exhausted city and unit numbers!
Follow-up Comment #7, bug #21950 (project freeciv): #define IDENTITY_NUMBER_SIZE (1+((MAX_UINT16 2) + 3)) What is the +3 for? The two lowest bits that MAX_UINT16 2 leaves cleared. It really should be written as binary (11) to make code more readable, but I don't think there's portable (older compilers) way to do that in C. ___ Reply to this item at: http://gna.org/bugs/?21950 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #21950] Game crash with popup message Exhausted city and unit numbers!
Follow-up Comment #8, bug #21950 (project freeciv): The two lowest bits that MAX_UINT16 2 leaves cleared. Oh, of course. ___ Reply to this item at: http://gna.org/bugs/?21950 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #21950] Game crash with popup message Exhausted city and unit numbers!
Follow-up Comment #9, bug #21950 (project freeciv): (MAX_UINT16 2 | 0x3), ((MAX_UINT16 2) | ((1 2) - 1)), or even (MAX_UINT16 2 | 0xff) would be more readable I think. ___ Reply to this item at: http://gna.org/bugs/?21950 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #21950] Game crash with popup message Exhausted city and unit numbers!
Follow-up Comment #10, bug #21950 (project freeciv): And if we are supposed to add 1, why not using (1 18)? ___ Reply to this item at: http://gna.org/bugs/?21950 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #21950] Game crash with popup message Exhausted city and unit numbers!
Follow-up Comment #11, bug #21950 (project freeciv): And if we are supposed to add 1, why not using (1 18)? Actually there's no longer specific need to have it as 2^y. The reason it was 2^16 was that then any value could fit to uint16, but it's not necessary to make it exactly 4 times as big (note that every possible value consumes memory so we can't increase it all the way to 32 bits to fit in uint32 without significant cost). Attached version of the patch makes it 25. (file #21395) ___ Additional Item Attachment: File name: 18BitIdentity-2.patch Size:0 KB ___ Reply to this item at: http://gna.org/bugs/?21950 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #21950] Game crash with popup message Exhausted city and unit numbers!
Update of bug #21950 (project freeciv): Planned Release: 2.4.3, 2.5.0, 2.6.0 = 2.4.3, 2.5.0-beta1, 2.6.0 ___ Reply to this item at: http://gna.org/bugs/?21950 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #21950] Game crash with popup message Exhausted city and unit numbers!
Update of bug #21950 (project freeciv): Category:None = general Status:None = Ready For Test Planned Release: = 2.4.3, 2.5.0, 2.6.0 ___ Follow-up Comment #5: When I wrote that patch I added the parenthesis thinking it would only increase readability. Now I realized that it actually fixes rather fundamental bug - identity numbers never wrapped. It was always added 1 (1 % big number) instead of getting wrapped every big number values. So the problem is not only when all the identity numbers are in use simultaneously (2^16 units alive), but when there has needed that many identity numbers during the entire game. My plan is to introduce fix to the wrapping problem to stable branches, and in TRUNK also make the max value 18 bits. Patch for stable branches attached. (file #21365) ___ Additional Item Attachment: File name: IdentityWrap-S2_5.patchSize:0 KB ___ Reply to this item at: http://gna.org/bugs/?21950 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #21950] Game crash with popup message Exhausted city and unit numbers!
Follow-up Comment #4, bug #21950 (project freeciv): Either I had forgotten to send this patch, or it had some issue... sending now for safekeeping at least. I will recheck that in no place identity number is being placed to narrower than 18 bit (32 bits in practice) variable. (file #20853) ___ Additional Item Attachment: File name: 18BitIdentity.patchSize:0 KB ___ Reply to this item at: http://gna.org/bugs/?21950 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #21950] Game crash with popup message Exhausted city and unit numbers!
Update of bug #21950 (project freeciv): Summary: Game crash with popup message = Game crash with popup message Exhausted city and unit numbers! ___ Reply to this item at: http://gna.org/bugs/?21950 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev