Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] Re: (PR#3781) Micro size of structs optimizations
Home

[Freeciv-Dev] Re: (PR#3781) Micro size of structs optimizations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bursig@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3781) Micro size of structs optimizations
From: "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Date: Wed, 26 Mar 2003 05:04:05 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, Mar 24, 2003 at 10:17:51AM -0800, Rafa³ Bursig wrote:
> IMHO we should chande game structs variables to network variables
> size ( real size sent by net code ).

You mean plastering Uint16 and Sint32 all over the place? No. What is
ok IMHO is to add more typedefs. For example:

typedef short int turn_no_t;
typedef int gold_t;
typedef signed char team_t;

Ending with "_t" is reserved by the standard so we would have to
chosse something other.

In these few typedefs we _could_ use Uint32 and co. Minimal impact.

> > and introduces sorting of variables in structs by optimization rather 
> > than
> > logic, which is not good for code readability reasons.
> That depens what /* comment */ you made in code. Some compilers make 
> such sorting during build time but gcc don't do it and programer must 
> do it manualy. And don't say me that reducing size of code won't have 
> any influence.

There are compilers out there which reorder struct-fields? Which one?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "Real Users find the one combination of bizarre
   input values that shuts down the system for days."




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