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
➜ SMAUG
➜ SMAUG coding
➜ Warning warning
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Robert Powell
Australia (367 posts) Bio
|
Date
| Fri 27 Feb 2004 05:35 AM (UTC) |
Message
| I have made a lot of additions and changed the way a lot of others work lately and now have a few warnings i would like to fix. The first one is this:
: left hand operand of comma expression has no effect
if ( !(ch, number_percent(), gsn_scribe) > 50)
How can i re-write this line so as to stop the error, this line is from a scribe 3 spells snippet.
The next one is:
: assignment from incompatible pointer type
Ok with this one i have sh_int *AttrPerm going into int max_hit, which i guess in it self isnt a bad thing as they are both types int and its the smaller going into the bigger(if i read how it happens correctly), max_hit is now int so i can have 100K hp, what i would like to know is what would be my best remidy for this, i was going to make all the stats ints but thats a waste of memory, my next guess was to add another pointer into the function *AttrPerm2 and make it int. What would be the tidiest way to achieve this. Thanks in advance for all replys.
|
Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Fri 27 Feb 2004 08:49 PM (UTC) |
Message
|
Quote:
if ( !(ch, number_percent(), gsn_scribe) > 50)
This looks like a function call without the function name.
Here is a simple test program that does that, and gives that warning:
int main (void)
{
if ( (2, 4, 6) == 6)
printf ("true\n");
else
printf ("false\n");
}
If you run that, it prints "true".
In other words, the expression (2, 4, 6) is simply 6, the 2 and 4 are discarded.
Sounds like it should read:
if ( ! some_function(ch, number_percent(), gsn_scribe) > 50)
Quote:
AttrPerm = &ch->max_hit;
Ok with this one i have sh_int *AttrPerm going into int max_hit ...
Not really, you are assigning pointers here, not what they point to. You may mean this:
*AttrPerm = ch->max_hit;
This would put the contents of max_hit (ie the number of hits) into whereever AttrPerm points to.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | 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.
9,155 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top