Char is char, which you probably have set to signed (vs unsigned). That is
why line 218: sign extends what it believes is a signed byte to a signed
word.

On Thu, Apr 10, 2008 at 2:21 PM, Luc Le Blanc <[EMAIL PROTECTED]> wrote:

> I have a position union:
>
> typedef struct
> {
>    UInt8    type;
>    UInt8    datum;
>
>    union
>    {
>        struct
>        {
>            Int16   altitude;
>            UInt32  northing;
>            UInt32  easting;
>            Char    zone;
>            UInt8   gore;
>
>        } grid;
>
>        struct
>        {
>            Int16   altitude;
>            UInt32  latitude;
>            UInt32  longitude;
>            Boolean south;
>            Boolean east;
>
>        } latLon;
>
>        Int16   altitude;
>
>        Int16   depth;
>
>        struct
>        {
>            float    x, y, z;
>
>        } absolute;
>
>        struct
>        {
>            Int16   altitude;
>            UInt16  unused;
>            float   x, y;
>
>        } spot;
>    };
> } Position;
>
> I use the grid case. Both zone and gore contain 0xff (as seen in
> debugger).
>
> I have a symbol:
>
> #define Undefined                   0xff
>
> yet, when I hit
>
> if ( position->grid.zone == Undefined )
>    StrPrintF( string, "X %ld%sY %ld",
>               ( position->grid.easting + 50 ) / 100, separator,
>               ( position->grid.northing + 50 ) / 100 );
>
> the StrPrintF is skipped. Here's the assembler:
>
> 00000214: 102A 000C          move.b    12(a2),d0
> 00000218: 4880               ext.w     d0
> 0000021A: 0C40 00FF          cmpi.w    #255,d0
> 0000021E: 6632               bne.s     *+52           ; 0x00000252
>
> Go figure.
>
>
> Luc Le Blanc
> --
> For information on using the ACCESS Developer Forums, or to unsubscribe,
> please see http://www.access-company.com/developers/forums/
>



-- 
[Jeff Loucks, Gig Harbor, WA, USA]

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to