#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    10
    Rep Power
    0

    Line 7: warning: type does not match prototype: set


    Hi Guys

    This is legacy code so please excuse the fact that it is a old as heck.

    Not sure what's happening here, appearantly the compiler is spitting its dummy out over a bad prototype declaration, however I cannot see the problem.

    Here is the complete code for this function:

    Code:
    void decode( c_fileflags, array, set)           /* decode various flags */
    char *c_fileflags;
    int  *array;
    short set;
    {
            int x, i_fcode = 0, i_factor = 16384;
            unsigned char   tmp[ 2];
    
            if( *c_fileflags == '\0')
                    strncpy( c_fileflags, "  ", 2);
    
            tmp[ 0] = ( unsigned char)( *c_fileflags);
            tmp[ 1] = ( unsigned char)( *( c_fileflags+1));
    
            i_fcode = ( tmp[ 0] - 32) * 200;
            i_fcode +=  tmp[ 1] - 32;
    
            if( i_fcode < 0 || i_fcode > 32767)
                    i_fcode = 0;
    
            for( x = 1; x < 16; x++, array++)
            {
                    *( array + ( set * 15)) = ( int)( i_fcode / i_factor);
                    i_fcode -= *( array + ( set * 15)) * i_factor;
                    i_factor /= 2;
            }
            return;
    }
    Any help would be appreciated.

    Thank
    Jim
  2. #2
  3. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,737
    Rep Power
    1959
    Which compiler do you use?

    Is that the only error you receive?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    159
    Rep Power
    19
    Not sure what's happening here, appearantly the compiler is spitting its dummy out over a bad prototype declaration, however I cannot see the problem.
    So where is the prototype that matches that function implementation?

    Jim
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    10
    Rep Power
    0
    Sorry the prototype is as follows:

    Code:
    GLOBAL       void    decode( char *, int *, short);

IMN logo majestic logo threadwatch logo seochat tools logo