Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: Client Side Translation
Home

[Freeciv-Dev] Re: Client Side Translation

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Michael Stefaniuc <mstefani@xxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Client Side Translation
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 31 Oct 2001 14:42:39 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, Oct 31, 2001 at 12:58:01PM +0100, Michael Stefaniuc wrote:
> > > > follow. put_uchar_vec should be put_mem (similar to strcpy vs memcpy).
> > > Hmm ... I don't know if it's a good idea because put_uchar_vec
> > > serializes only an array of unsigned chars and not random memory (don't
> > > want to tempt anybody to use it to serialize something else than an
> > > array of chars like e.g. a struct). 
> > 
> > Why is this/can turn into a problem?
> Using the struct as examble: the members of a struct can be differently
> alligned on different OS'es/archs; an int/float can be a member of a
> struct and therefor we get problems with the endianess.
> And  put_uchar_vec isn't similar to memcpy: memcpy takes as src
> a void pointer whereas put_uchar_vec uses unsigned char.

I meant that string (str* methods) are null terminated and memory
(mem* functions) are specified by their length. It looks to me that
put_uchar_vec is such a memory function.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "We've all heard that a million monkeys banging on a million typewriters
  will eventually reproduce the entire works of Shakespeare.
  Now, thanks to the Internet, we know this is not true."


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