Thread: Syntax Error??

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,665
    > writetostore(outfile, fr->p1, TMRI_PARAMREC);
    Probably because TMRI_PARAMREC is your typedef struct, not an enum

    > getnextchunk(p, file, TYPE_PARAMREC);
    This appears to be correct use of the enum.

    Oh and all your realloc calls are poor.
    Never do p = realloc( p, size );
    Always assign to a temp pointer first.

    That's some f-ugly code there - those functions are way too long.

    Next time, add a comment to the code along the lines of
    /* This line generates the foo error message */

    Also, try compiling more often than once a day, or however long it took you to type in that code.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  2. #2
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Quote Originally Posted by Salem
    > writetostore(outfile, fr->p1, TMRI_PARAMREC);
    Probably because TMRI_PARAMREC is your typedef struct, not an enum

    > getnextchunk(p, file, TYPE_PARAMREC);
    This appears to be correct use of the enum.
    8 hours of looking at it didn't reveal that to me. I hate it when that happens. I, of course, kept reading that TYPE_PARAMREC not TMRI_PARAMREC -- this is why I'll be hiring someone to work with me next year. . .
    Quote Originally Posted by Salem
    Also, try compiling more often than once a day, or however long it took you to type in that code.
    Unfortunately, I couldn't. This was a re-write of the original code from six weeks ago. I couldn't compile it until I had all the functions complete. That is also the reason for the length of the importadf function. I had to scrap the old one and put in this new one.

    Thanks for spotting that for me. If you notice in the first post I had it right. . . but I was giving you the way it should be instead of the way it was.

    Thanks again!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM
  5. Linking error
    By DockyD in forum C++ Programming
    Replies: 10
    Last Post: 01-20-2003, 05:27 AM