wesnoth-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-patches] [patch #3641] Remove a compilation warning


From: Guillaume Melquiond
Subject: [Wesnoth-patches] [patch #3641] Remove a compilation warning
Date: Wed, 19 Jan 2005 21:41:20 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.7.5) Gecko/20050110 Firefox/1.0 (Debian package 1.0+dfsg.1-2)

This is an automated notification sent by Savannah.
It relates to:
                patch #3641, project Battle for Wesnoth

==============================================================================
 LATEST MODIFICATIONS of patch #3641:
==============================================================================

               Posted by: Guillaume Melquiond <silene>
               Posted on: 2005-01-19 21:41 (Europe/Paris)
    _______________________________________________________

                  Status:                    None -> Wont Apply             

    _______________________________________________________

Follow-up Comment:
Thanks, the warning should be fixed now. The patch was not applied since it
would have lead to another warning on some compilers: "comparison >= 0 is
always true for unsigned types".

==============================================================================
 OVERVIEW of patch #3641:
==============================================================================

URL:
  <http://savannah.nongnu.org/patch/?func=detailitem&item_id=3641>

                 Summary: Remove a  compilation warning
                 Project: Battle for Wesnoth
            Submitted by: redsun
            Submitted on: jeu 13.01.2005 à 02:44
                Category: None
                Priority: 5 - Normal
                  Status: Wont Apply
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open

    _______________________________________________________


Replace 



"

template<typename T>

inline bool is_odd(T num) { return (static_cast<unsigned int>(num > 0 ? num :
-num)&1) == 1; }

"



by



"

template<typename T>

inline bool is_odd(T num)

{       

  if (num >= 0)

    return ((num & 1) == 1);

  else

    return ((-static_cast<int>(num) & 1) == 1);

}

"



in util.hpp line 34



    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: mer 19.01.2005 à 21:41        By: Guillaume Melquiond <silene>
Thanks, the warning should be fixed now. The patch was not applied since it
would have lead to another warning on some compilers: "comparison >= 0 is
always true for unsigned types".

-------------------------------------------------------
Date: jeu 13.01.2005 à 18:52        By: Anonymous
At first, escuse me for the absence of the patch file. I will join it.



Next, the warning was :

"

Compiler Warning (level 2) C4146 : unary minus operator applied to unsigned
type, result still unsigned

"

 

-------------------------------------------------------
Date: jeu 13.01.2005 à 08:13        By: Guillaume Melquiond <silene>
Hum... Can you tell us which warning it was? (the precise and complete
message). Especially necessary since the new code you propose is semantically
different from the old one.



As a side note, what you are submitting are not patches but bug-reports. A
patch is the result of the command "diff -u" (or even simpler for you if you
have wesnoth cvs repository: "cvs diff -u"), and hence can be automagically
applied to the code.







    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: jeu 13.01.2005 à 18:52  Name: util.hpp.patch  Size: 725o   By: None

<http://savannah.nongnu.org/patch/download.php?item_id=3641&item_file_id=4035>

==============================================================================

This item URL is:
  <http://savannah.nongnu.org/patch/?func=detailitem&item_id=3641>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]