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 ➜ Missing braces get on my nerves.

Missing braces get on my nerves.

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


Posted by Sitral   (1 post)  Bio
Date Fri 13 Dec 2002 07:39 AM (UTC)
Message
Yes, I'm aware it compiles fine. Yes, I'm aware it runs fine. But watching three dozen warnings scroll by everytime I compile is very unsettling. So, has anyone bothered to fix these problems, or mind helping me do it?

For instance, here's one of the problems:
if ( pdesc != NULL )
if (++count == number)
{
send_to_char( pdesc, ch );
return;
}
else continue;

The spacing on this one suggests that the else is _included_ in the first if statement:
if ( pdesc != NULL )
{ /* Where the brace belongs? */
if (++count == number)
{
send_to_char( pdesc, ch );
return;
}
else continue;
} /* Where the brace belongs? */

Or is the else _part of_ the first if statement?:
if ( pdesc != NULL )
{ /* Where the brace belongs? */
if (++count == number)
{
send_to_char( pdesc, ch );
return;
}
} /* Where the brace belongs? */
else continue;

Like I said, from this example it seems clear that the first solution is right...but not each instance is spaced so well, so can anyone tell me which is right?
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.


8,818 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.