From: <no...@so...> - 2002-08-06 12:43:14
|
Patches item #582964, was opened at 2002-07-17 13:55 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=302435&aid=582964&group_id=2435 Category: w32api Group: None >Status: Pending Resolution: None Priority: 5 Submitted By: Gunnar Degnbol (gdegnbol) Assigned to: Earnie Boyd (earnie) Summary: Cast OLE error codes to longs Initial Comment: The OLE error codes are longs with high bit set. They are defined in winerror.h as #define CO_E_CLASS_CREATE_FAILED 0x80080001L The high bit makes g++ promote them to unsigned longs. When they are compared to a variable of type HRESULT (typedef of long) it then complains about signed/unsigned comparison (if -Wall). The patch changes all these defines to #define CO_E_CLASS_CREATE_FAILED ((long)(0x80080001L)) Microsoft does the same in their headers. The patch is made with this command: perl -e "while (<>) {s/ (0x8.*L)\$/ ((long)(\))/;print \sh }" \ < winerror.h > winerror.h.new ---------------------------------------------------------------------- >Comment By: Earnie Boyd (earnie) Date: 2002-08-06 08:43 Message: Logged In: YES user_id=15438 I set it to pending so that I could review these old tracker posts to decide what to do with them. Please leave it set as I've set them until further notice. ---------------------------------------------------------------------- Comment By: Gunnar Degnbol (gdegnbol) Date: 2002-08-06 08:28 Message: Logged In: YES user_id=485110 What is pending here? Should I send a patch doing as Danny asked? I tried to argue that I'd done the right thing. ---------------------------------------------------------------------- Comment By: Gunnar Degnbol (gdegnbol) Date: 2002-07-17 19:37 Message: Logged In: YES user_id=485110 Maybe, but a HRESULT is just a long, and will stay so. And winerror.h didn't depend on any other headers before. I only added the casts where it made any difference - all the other constants are longs as they are. ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2002-07-17 18:57 Message: Logged In: YES user_id=11494 Shouldn't they be cast to HRESULT, since that is what the OLE procedures return? eg: #define E_UNEXPECTED ((HRESULT)0x8000FFFFL) ... etc. for _all_ the OLE error codes (and success codes). Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=302435&aid=582964&group_id=2435 |