freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] Strange code in cff/t2parse.c?


From: Rich Stephens
Subject: [Devel] Strange code in cff/t2parse.c?
Date: Thu, 21 Dec 2000 10:02:33 -0500

Hello all...

We're attempting to do something a bit odd....compile freetype on an AS400.
We're using freetype 2, beta 8.  Yes, I know I should get the latest code,
but we need to get our platforms in sync with the same version before we
start updating.  Our problem at present is the following odd bit of code,
specifically the first line here I show, in src/cff/t2parse.c.  Lines 408
and 409 below it show an example of this odd macro in use:

    +392  #define T2_REF( s, f )  ( ((s*)0)->f )
  +393
  +394  #define T2_FIELD_CALLBACK( code, name ) \
  +395            {                             \
  +396              t2_kind_callback,           \
  +397              code | T2CODE,              \
  +398              0, 0,                       \
  +399              parse_ ## name,             \
  +400              0, 0                        \
  +401            },
  +402
  +403  #undef  T2_FIELD
  +404  #define T2_FIELD( code, name, kind )                 \
  +405            {                                          \
  +406              kind,                                    \
  +407              code | T2CODE,                           \
  +408              (FT_UInt)(char*)&T2_REF( T2TYPE, name ), \
  +409              sizeof( T2_REF( T2TYPE, name ) ),        \
  +410              0, 0, 0                                  \
  +411            },

Our compiler on the AS400 chokes on line 392 big-time, and I am at a loss as
to exactly its purpose.  How is taking a reference to a member of a
structure pointer whose value is 0 valid on ANY platform?  I know, it
compiles on our UNIX platforms, but I can't see for sure why...what IS it,
and is there any way to change the macro to make it less... wierd (I.E. so
it will compile on our AS400)?

Rich Stephens
Software Developer

Optio Software, Inc.
Windward Fairways II
3015 Windward Plaza
Alpharetta, GA 30005
(770) 576-3561
address@hidden




reply via email to

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