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
➜ MUSHclient
➜ Development
➜ Fixing up warnings so others can better contribute
Fixing up warnings so others can better contribute
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
3
4
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #45 on Thu 16 Sep 2010 07:41 AM (UTC) Amended on Thu 16 Sep 2010 07:42 AM (UTC) by Twisol
|
Message
| |
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #46 on Thu 16 Sep 2010 07:43 AM (UTC) |
Message
|
Twisol said:
Just as a small note, but you have this:
#pragma warning (disable : 4800) // forcing value to bool 'true' or 'false' (performance warning)
I don't have the code in front of me right now, but if I understand correctly, the issue is assigning a numeric value to a bool variable? I believe I had removed that in my old branch altogether, and replaced 'b = i' with 'b = (i != 0)', which to my mind is more explicit anyways.
It can be reproduced like this:
BOOL a = TRUE;
bool b = a; // forcing value to bool 'true' or 'false' (performance warning)
Now given a BOOL (say, an argument to a function) I just can't come at doing this:
It's just ridiculous.
It would be like saying in Lua:
if a ~= false and a ~= nil then ...
Instead of:
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #47 on Thu 16 Sep 2010 07:44 AM (UTC) |
Message
|
Twisol said:
Nick, your second revert reverted pretty much the entirety of Worstje's fixes branch. Just checking, was that intended?
Yes, I was trying to pull in just the one commit that he mentioned fixes a few of the last 7 warnings. Not the huge numbers of typecasts he did. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #48 on Thu 16 Sep 2010 07:45 AM (UTC) |
Message
| Ah. `git cherry-pick` is the way to go, I suppose. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #49 on Thu 16 Sep 2010 07:48 AM (UTC) |
Message
|
Nick Gammon said: BOOL a = TRUE;
bool b = a; // forcing value to bool 'true' or 'false' (performance warning)
Now given a BOOL (say, an argument to a function) I just can't come at doing this:
It's just ridiculous.
It would be like saying in Lua:
if a ~= false and a ~= nil then ...
Instead of:
BOOL is a typedef for some kind of int type, since win32 was created when C had no explicit bool. The Lua analog, I suppose, would be:
if a and a ~= 0 then ... end
|
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Worstje
Netherlands (899 posts) Bio
|
Date
| Reply #50 on Thu 16 Sep 2010 07:52 AM (UTC) |
Message
| Please don't forget my fix to ProcessPreviousLine.cpp at line 749. It has one of the surviving warnings still. (Not sure if you're getting that one on VC++6, so I figured I'd mention it.) | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #51 on Thu 16 Sep 2010 09:19 AM (UTC) |
Message
| Got it now, thanks. |
- 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.
143,182 views.
This is page 4, subject is 4 pages long:
1
2
3
4
It is now over 60 days since the last post. This thread is closed.
Refresh page
top