A89: Re: What is wrong here?


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

A89: Re: What is wrong here?




> ok. Will somebody tell me what's wrong with this code (below), because I
see
> nothing wrong with it, yet TIGCC throws the following errors:

> 1) missing braces around initializer for '(anonymous).xy'

This is not an error, but a warning.  It is thrown because SCR_RECT is a
union.  To get rid of it, just put the extra braces in (double braces around
the initializer).  If it shows as an error or doesn't compile, please give
me some additional information (e.g. using IDE or command-line compiler,
version of TI-GCC, ...)

> 2) invalid lvalue in unary '&'

Well, you already know the solution for that:  The initializers can only be
constants (I think).

> #if TI89_VERSION
>     #define SCREEN_HEIGTH 99
>     #define SCREEN_WIDTH 159
> #endif
>
> #if TI92_VERSION
>     #define SCREEN_HEIGTH 127
>     #define SCREEN_WIDTH 239
> #endif

Why don't you use Zeljko's LCD_WIDTH and LCD_HEIGHT macros?  Then you would
just have one program for both calcs.

Sebastian Reichelt




References: