Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] client programming problems
Home

[Freeciv-Dev] client programming problems

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: lukas.toenne@xxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] client programming problems
From: nikodimka <nikodimka@xxxxxxxxx>
Date: Thu, 28 Aug 2003 07:18:14 -0700 (PDT)

Lukas,

This is the C language, right?

All the C standards prior to C99 disallow 
variable definition intermixed with executable code.

So just move root_widget definition up to the beginning of the function.

nikodimka

>2)
>When compiling the following code (and similar things) with the first "if" 
>expression included, i get a "parse error before struct" in the line just 
>below. Return values have no meaning yet and i also tried using "NULL" 
>instead of "0" for pointer testing. Isn't there some sort of "assert" 
>function for such stuff ?
>
>
>int gui_widget_run(struct gui_widget *modal_widget)
>{
>// no idea why this doesn't work !  :(
>//  if (modal_widget == 0) {
>//    return 0;
>//  }
>
>  // find the root widget for painting the whole gui tree
>  struct gui_widget *root_widget = modal_widget;
>  while (root_widget->parent != 0) {
>    root_widget = root_widget->parent;
>  }
>  // run the event loop without blocking up the CPU
>  while (!modal_widget->quit) {
>    SDL_Delay(10);
>    gui_widget_paint(root_widget);
>  }
>  return 0;
>}

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com


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