[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Development
. . -> [Subject]  Fixing up warnings so others can better contribute
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Fixing up warnings so others can better contribute

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1  2  3  4 

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #45 on Thu 16 Sep 2010 07:41 AM (UTC)  quote  ]

Amended on Thu 16 Sep 2010 07:42 AM (UTC) by Twisol

Message
Nick, your second revert reverted pretty much the entirety of Worstje's fixes branch. Just checking, was that intended? If you look at the commit changes for that revert, it's massive [1]. Using Compare View, there are only three files that have been changed, and that was from the last commit [2].

[1] http://github.com/nickgammon/mushclient/commit/07792acff259be0b0c114e504b059be40f3707db

[2] http://github.com/nickgammon/mushclient/compare/5f711c8853...e2ecc40e85

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (19,435 posts)  [Biography] bio   Forum Administrator
Date Reply #46 on Thu 16 Sep 2010 07:43 AM (UTC)  quote  ]
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:


bool b = a != 0;


It's just ridiculous.

It would be like saying in Lua:


if a ~= false and a ~= nil then ...


Instead of:


if a then ...


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (19,435 posts)  [Biography] bio   Forum Administrator
Date Reply #47 on Thu 16 Sep 2010 07:44 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #48 on Thu 16 Sep 2010 07:45 AM (UTC)  quote  ]
Message
Ah. `git cherry-pick` is the way to go, I suppose.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #49 on Thu 16 Sep 2010 07:48 AM (UTC)  quote  ]
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:
bool b = a != 0;

It's just ridiculous.

It would be like saying in Lua:
if a ~= false and a ~= nil then ...

Instead of:
if a then ...

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
[Go to top] top

Posted by Worstje   Netherlands  (867 posts)  [Biography] bio
Date Reply #50 on Thu 16 Sep 2010 07:52 AM (UTC)  quote  ]
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.)
[Go to top] top

Posted by Nick Gammon   Australia  (19,435 posts)  [Biography] bio   Forum Administrator
Date Reply #51 on Thu 16 Sep 2010 09:19 AM (UTC)  quote  ]
Message
Got it now, thanks.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


16,424 views.

This is page 4, subject is 4 pages long:  [Previous page]  1  2  3  4 

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]