Is there something wrong with this syntax?

  • firefreak11
    27th Mar 2012 Member 0 Permalink
    i get errors while trying to compile my mod and this part in powder.h is supposedly wrong.  ive never had an error with this file before and i haven't typed anything here.  is there something wrong with this?-

    struct part_transition-the line with the error
    {
    float plv; // transition occurs if pv is lower than this
    int plt;
    float phv; // transition occurs if pv is higher than this
    int pht;
    float tlv; // transition occurs if t is lower than this
    int tlt;
    float thv; // transition occurs if t is higher than this
    int tht;
    };
  • jacksonmj
    27th Mar 2012 Developer 0 Permalink
    I can't see anything wrong with that bit, post the errors.
  • boxmein
    27th Mar 2012 Former Staff 0 Permalink
    I don't know, Google gives me examples of the left curly bracket being on the same line, it can't be the reason... Try it just in case?

    What if you instantiated the structure badly, so it links back to the structure to check if it wasn't wrong?
    >edited: added stuff
  • pilojo
    27th Mar 2012 Member 0 Permalink
    @boxmein (View Post)
    That might be it, with VS C++ 2010 it has complained if functions didn't have it on the same line for me.
  • firefreak11
    27th Mar 2012 Member 0 Permalink
    the error says             
                         includes/powder.h:489: error: storage class specified for parameter 'part_type'
                         includes/powder.h:489:error: expected ';' ',' or ')'before 'struct'

    and i tried adding a ; or a , or a ) and i am still getting the error
  • pilojo
    27th Mar 2012 Member 0 Permalink
    @firefreak11 (View Post)
    Oh, you forgot to close something earlier. Look up the code.
  • firefreak11
    27th Mar 2012 Member 0 Permalink
    no theres nothing wrong with it codebolcks is being messed up i am going to try visual studio
  • jacksonmj
    27th Mar 2012 Developer 0 Permalink
    Might be a missing semicolon earlier in powder.h. Did you remember to put one at the end of
    "int update_THING(UPDATE_FUNC_ARGS);" (if you added any of those)?

    If you still can't find the problem, then pastebin all of powder.h
  • firefreak11
    27th Mar 2012 Member 0 Permalink
  • jacksonmj
    27th Mar 2012 Developer 0 Permalink
    extern part_transition, ptransitions[PT_NUM];should be
    extern part_transition ptransitions[PT_NUM];
    extern part_type ptypes[PT_NUM]should be
    extern part_type ptypes[PT_NUM];
    And missing closing bracket for update_MTHN.

    Fixed version: http://pastebin.com/UmRN8AEt