I've got DRODLib compiling now. In my quest for eliminating as many compiler warnings as humanly possible, i also found and fixed some potential bugs ("
always true"
comparisions, for scope errors, etc). See, it helps
Eh, this is somewhat long, so i'll make neat captions for your viewing pleasure.
The current state
I've still got some warnings left, the most bothersome is some in DbDemos.cpp saying:
"warning: choosing `CAttachableWrapper<T>::operator T&() [with T = UINT]' over `CAttachableWrapper<T>::operator T() const [with T = UINT]' for conversion from `CAttachableWrapper<UINT>' to `unsigned int' because conversion sequence for the argument is better" (and the same with bool), but i took a look at it, and it's harmless. I don't know how to make it go away, tho. Then there's some "
always true"
warnings for some ASSERTs (with _DEBUG only), which should be so. And then.. nothing else.
Changes and comments
I fixed the CDbPackedVars = c4_BytesRef problem (and a similar one) by creating a new constructor in CDbPackedVars and CDbCommands, as i was unsure how to cast that properly (this was before the reply from you, ross). I'm pretty sure it works as intended, but, as always, you might want to take a look to be sure.
I made the parameters to bIsArrowObstacle in DbRooms.cpp UINTs, by the way, to get rid of some 20 signed/unsigned warnings. I checked around, and it seems that was intended to be UINTs all along, so it shouldn't hurt anything. I saw a few other places that could benefit from UINTing, but, again, i didn't want to intrude too much..
I also fixed some more stuff i missed the last time in BackEndLib, as i forgot to define _DEBUG before. Cleaned up Assert.h a bit, commented out some more in Ports.* (it couldn't be eliminated entirely, tho). In addition to that i made Wchar.* make use of the native linux wcs* functions (thanks, ross!).
Some replies
ross wrote:
You shouldn't actually needs WCSlen() from Ports as you should already have wcslen() on Linux in wchar.h. In fact try not using Ports at all you might find that it still compiles
Thanks! I replaced all the WCS*-functions with linux ones.
The things that MSVC ignores
Yah.. It's amazing.
ErikH2000 wrote:
DbProps.h and PathMap.h need their filename case fixed.
Just change the #includes to be correct.
That was my first thought too, but that would make those files break the naming convention of the other files. Every time someone wants to include DbProps.h, they have to remember it's a special case, and write DBProps.h instead. Same with Pathmap.h, as its class is named CPathMap. I did change the #includes for now, tho. The alternative is putting version information in the attic.. (why oh why doesn't cvs have a rename function ?)
(..) void* pointers (..)
Hmm. I'm not worried about destructors getting called, because there are none in these cases. I don't understand why the compiler should worry about it. The address is enough information to free the memory. If it's just a warning, you might try casting to an "char *".
It's an array being deleted, so i think it is because delete[] doesn't know what size it is. I checked the code, and it seems to assign char size arrays to it, so casting to char* should be safe enough.
- Gerry (<- my real name )
Are you Gerry Quinn, by chance?
Nope, i'm just Gerry Jo Jellestad..
The patches!
Both are diffed against latest CVS. Btw, my text editor wants to delete all whitespace at end of lines, so there might be some extra lines changed..
By the way, i noticed mrimer wrote "
(comitted on behalf of trick)"
in the logs. That might be a bit misleading, as the sourceforge username 'trick' belongs to someone else.. Just write Gerry JJ or something
EDIT: While fixing FrontEndLib i found out that using the native linux wcs* routines is a bad idea, as they use a different definition of wchar than drod.. Also moved the patches to a real server. See the next post.
Rename the Makefiles to Makefile.linux (or something else fitting) and put them to their right dir
*yawn*
Let me know if there's any problems.
- Gerry
[Edited by trick on 06-18-2003 at 02:50 PM GMT: Oops]