Various BSD Networking Questions
"all computers" is too strong.
That struct will be aligned and packed the same on Mac OS X/PowerPC, Mac OS X/Intel, Windows/Intel and Linux/Intel, however.
That struct will be aligned and packed the same on Mac OS X/PowerPC, Mac OS X/Intel, Windows/Intel and Linux/Intel, however.
that's good enough for me, then 
Thanks again everyone ^_^
-wyrmmage

Thanks again everyone ^_^
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com/forum/
OSC: what x86 desktop computers have a non-regular (non-32) bit integer implementation?
It's not magic, it's Ruby.
I don't understand the question, and I don't believe it would be a sane question even if I did understand it
I think he's asking what platforms wouldn't have 32 bit ints.
akb825 Wrote:I think he's asking what platforms wouldn't have 32 bit ints.Sinclair 1000, TRS-80, Commodore 64, etc...
not to revive a dead topic, but...can I put booleans in my structs and still have no packing or alignment issues?
-wyrmmage
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com/forum/
packing/alignment issues are not related to the fields of a struct, you should always be serializing it "manually"
Sir, e^iπ + 1 = 0, hence God exists; reply!
wait, what? OSC said that if I used types of a fixed length like float or int32_t, I wouldn't have any packing issues...I'm just wondering if the same goes for boolean. How do you manually make sure that they're serialized?
-wyrmmage
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com/forum/
Use uint8_t for booleans.
Code:
void write_struct(char * buffer, struct foo * foo) {
buffer = write_int8(buffer, foo->x);
buffer = write_int8(buffer, foo->y);
buffer = write_float8(buffer, foo->angle);
buffer = write_string(buffer, foo->player_name);
// etc
}Sir, e^iπ + 1 = 0, hence God exists; reply!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Newbie networking - just dl'ing data from an URL... | sealfin | 4 | 3,216 |
Apr 19, 2007 07:01 AM Last Post: sealfin |
|
| Good networking library | Ummon | 5 | 4,161 |
Jan 22, 2007 11:59 PM Last Post: akb825 |
|
| Simple networking? | CarbonX | 13 | 6,736 |
Apr 7, 2005 12:36 AM Last Post: Andrew |
|
| Saving a Place for Networking | Roosterhouse | 3 | 3,716 |
Aug 6, 2004 02:05 PM Last Post: FCCovett |
|
| Networking for Multiplayer Games Where to start? | NYGhost | 2 | 3,221 |
Jan 28, 2004 09:15 AM Last Post: Skorche |
|

