Welcome, Guest. Please login or register.

Author Topic: Basic Amiga-API coding  (Read 11910 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Slash

  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 112
  • Country: gb
  • Gender: Male
    • Show all replies
    • http://www.the-snakepit.co.uk
Re: Basic Amiga-API coding
« on: July 31, 2006, 05:05:46 PM »
Just a couple of suggestions, and me being pedantic, but:

1) The 'int main()' line should probably be written as 'int main(int argc, char** argv)'

2) Probably a personal preference, but I'd make sure my window pointer was NULL when it is declared; i.e. 'struct Window *win = NULL'

3) Not as important in this instance, but after the window was closed, I'd reset the win variable to NULL after the window has been closed; i.e. 'win = NULL;'

4) Truth statements should be encapsulated within another set of parenthesis; i.e. 'if(win = OpenWindowTags(NULL,TAG_DONE))' would become if((win = OpenWindowTags(NULL, TAG_DONE))!=NULL) { ... } or if((win = OpenWindowTags(NULL, TAG_DONE))) { ... }.

Always compile with the GCC option -Wall and you'll catch these warnings.

Good idea though. :-)