Re: [Plib-devel] Porting plib to compile under win32/borland; bugs/leaks report
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2001-08-24 15:13:04
|
Maciej Komosinski wrote: > COMPILATION > ----------- > > In general, all fopen("ra") are not valid under borland. "a" is > equivalent to "t" (=text). Thus every open("ra") should be changed > to "rt". Are you *sure* about that? That "ra" mechanism is pretty firmly embedded in Windoze C/C++ compilers and I find it VERY hard to believe that Borland would go against that convention. I used Borland C++ back in the days of DOS and it certainly allowed "ra" back then. > This could be resolved by using a global macro, like > > #ifdef __BORLANDC__ > #define FOPEN_READ "rt" > #define FOPEN_WRITE "wt" > #else > #define FOPEN_READ "ra" > #define FOPEN_WRITE "wa" > #endif > > ...=fopen(f,FOPEN_READ); Bleaugh! > ----- > > Functions > > ssgLoaderOptions* ssgGetCurrentOptions () > void ssgSetCurrentOptions ( ssgLoaderOptions* options ) > ssgEntity *ssgLoad ( char *fname, ssgBranch *(*cb)(char *)) > void ssgSetAppStateCallback ( ssgState *(*cb)(char *) ) > void ssgModelPath ( const char *path ) > void ssgTexturePath ( const char *path ) > > could be moved to ssg.cxx. It would make it easier to produce libs/dlls > from the source. Why? I don't understand that. > Directories are under Win32 separated by \, not /. But modern C/C++ compilers and libraries take care of that don't they? The CygWin and MSVC guys don't have a problem with this. > you might localize differences and use > #ifdef WIN32 > to choose the form suitable for the platform. Yes - you have to do that because Linux/UNIX/OS-X allow '\' as a normal character inside filenames. > in ssg\ssgLoaderWriterStuff.cxx > #include <malloc.h> > is needed for alloca. Oh-oh. Who used 'alloca' ?? That's very naughty in a C++ environment. Would whoever added it please use 'new' and 'delete'. > STYLE > ----- > > In many places, new[] is NOT matched by delete[] but by delete. > I will not include the long list here, but it would be nice to > fix all occurences. Yes - unfortunately, Linux, IRIX and Solaris allow that - which makes it hard for me to find the problem. Could you list those places so we can fix them. > LEAKS > ----- > > There are numerous memory leaks, especially in loaders. Hopefully > they will be located. Could you be more specific? ----------------------------- Steve Baker ------------------------------- HomeMail : <sjb...@ai...> WorkMail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sf.net http://tuxaqfh.sf.net http://prettypoly.sf.net http://tuxkart.sf.net http://freeglut.sf.net http://toobular.sf.net |