Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ ROM ➜ Compiling the server ➜ rom24b6olc help

rom24b6olc help

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by To4ri2n0   (2 posts)  Bio
Date Thu 27 Feb 2003 12:26 AM (UTC)
Message
I use win98 and cygwin, I got rom24b4a to go with no probs just some simple hacking of the code but when I tried to patch olc to it I got nothing. So now I'm trying to use rom24b6olc and I can't get it to compile. Heres the output:

special.c: In function 'spec string':
special.c:1037: subscripted value is neither array nor pointer
make: *** [special.o] Error1

Here is special.c 1037:

for ( cmd = 0; spec_table[cmd].function[0] != '\0'; cmd++ )

Here is the whole bunch that contains 1037:

/* OLC Inserted */
/*****************************************************************************
Name: spec_string
Purpose: Given a function, return the appropriate name.
Called by: <???>
****************************************************************************/
char *spec_string( SPEC_FUN *fun ) /* OLC */
{
int cmd;

for ( cmd = 0; spec_table[cmd].function[0] != '\0'; cmd++ )
if ( fun == spec_table[cmd].function )
return spec_table[cmd].name;

return 0;
}

I have seen this prob posted to a number of different forums and on everyone the replys do not even try to answer the prob. So if you know what I can do to make this work PLEASE tell me. Thanks
Top

Posted by Dave   Australia  (93 posts)  Bio
Date Reply #1 on Mon 03 Mar 2003 07:23 AM (UTC)

Amended on Mon 03 Mar 2003 07:24 AM (UTC) by Dave

Message
I'll take a wild stab at it:
char *spec_string(SPEC_FUN *fun) /* OLC */
{
    int cmd;

    for (cmd = 0; spec_table[cmd].function[0] != '\0'; cmd++)
        if (fun == spec_table[cmd].function)
            return spec_table[cmd].name;

    return 0;
}
Okay. so fun is a pointer to a SPEC_FUN, which I'm assuming isn't an array, and you compare fun to spec_table[cmd].function, so I'm assuming that .function is also a pointer to a SPEC_FUN.. so your problem would be "spec_table[cmd].function[0] != '\0'". Try changing it to "spec_table[cmd].function != NULL" perhaps? Look at the bottom of spec_table, and see how the last element defines itself. Hope this helps.

Dave
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,104 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.