This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cs8900a for big endian targets


Bob Koninckx wrote:
Jifl,

I thought of that myself also, but, doesn't that introduce the risk
of swapping everything at runtime rather than at compile time ? An
additional problem would be the following

The compiler will fold constants at compilation time, so you don't have to worry.


If you define e.g.

#define ISQ_RxEvent CYG_CPU_TO_LE16(0x0004)

how do you then deal with code like ...

switch(x) {
 ...

 case ISQ_RxEvent:    <<-- you get a compiler error here since it
                           no longer expands to an integer
                           expression
}

Ah, that one would be a problem.


You'd have to do switch (CYG_CPU_TO_LE16(x)) and leave the case unadorned in that special case.

Jifl
--
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]