Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2001:
[Freeciv-Dev] Re: int -> void*, was Re: [RFC] Attaching information to o
Home

[Freeciv-Dev] Re: int -> void*, was Re: [RFC] Attaching information to o

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Falk Hueffner <falk.hueffner@xxxxxxxxxxxxxxxxxxxxxxxx>, freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: int -> void*, was Re: [RFC] Attaching information to objects
From: David Pfitzner <dwpfitzner@xxxxxxxxx>
Date: Mon, 15 Jan 2001 15:11:08 -0800 (PST)

Falk Hueffner <falk.hueffner@xxxxxxxxxxxxxxxxxxxxxxxx> wrote: 

> [1] It seems when using ints as keys, the current code uses the void*
> of the hash_bucket to point to the int, instead of stuffing the int
> directly into the void* (which should always be at least as large as
> an int). Is there a certain reason for this?

Is it guaranteed by the language that stuffing the int into the
void* will always work, or does it just happen to work on most
(all?) platforms?

Eg, could you have a platform on which a particular int bit pattern
happened to be invalid as a pointer value, and the implementation
happened to notice this at runtime and throw up its hands in horror?

-- David


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



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