Digging in it, I wanted to understand the Bas2Tap line 0 bug...
So I took my RAD studio, that includes also C an C++ development in order to recompile and trace...
Well I have also VC++ installed but I wanted to give a try with it !
Why, just because I recompiled some the DOS Tools of fabrice I can find into "VISTA compatible" command line tools (I do not change the code of Fabrice : it usually compiles straight) and because Borlands compiler is supposed (I said "it is supposed", I wish I were right ) to be very good for size and speed optimization.
Just compare the result of wav2tap.exe compilation (same code compiled) :
what a difference !(Author' compiler) --> (size) --> Vista/Seven compatibility
Fabrice'compiler --> 110 Ko --> so, so
Waskol' compiler --> 8Ko --> fully compatible
Well coming back to Bas2Tap.cpp/info.h compilation, I saw it requires common.h/common.cpp
Thus I created my new cpp project with those files in order to compile, and I got a bunch of errors :
I've just start to dig in it, but for instance, the first error I got is this one :Bas2Tap.cpp(70,12): Avertissement warning 8012: W8012 Comparaison de valeurs signées et non signées
common.cpp(68,39): Erreur error 2034: E2034 Impossible de convertir 'const char *' en 'char *'
common.cpp(68,39): Erreur error 2340: E2340 Mauvaise correspondance de type dans le paramètre 1 ('char *' désiré, 'const char *' obtenu)
common.cpp(75,50): Erreur error 2227: E2227 Paramètre supplémentaire dans l'appel à _open(const char *,int)
common.cpp(107,85): Erreur error 2227: E2227 Paramètre supplémentaire dans l'appel à _open(const char *,int)
1 Avertissement(s)
4 Erreur(s)
Temps écoulé 00:00:00.26
concerns this portion of code :common.cpp(68,39): Erreur error 2034: E2034 Impossible de convertir 'const char *' en 'char *'
yep the variable in the prototype of your function is a constbool LoadFile(const char* pcFileName,void* &pcBuffer,size_t &cBufferSize)
{
// get the size of the file
struct _finddata_t file_info;
if (_findfirst(pcFileName, &file_info)== -1)
{
return false;
}
...
Do you think it is important to fix this kind of thing is your code, since anyway, it seems to compile and work with your Visual C++, or do you wish me to report them to you each time I find a bug and a fix ?
cheers
________________________________________
Edit :
about the error generated on _Open, it comes from the fact that Borland and Microsoft do not have the same prototype for the _open function.
And it is Borland that do not the rules of ISO C++.
But on another hand, this function is deprecated for win32 and it is said that _sopen should be used instead (and for wich Borland c++ is OK too) , that would give, in common.cpp, this :
Code: Select all
int nHandle=_sopen(pcFileName,O_BINARY|O_RDONLY,SH_DENYWR,0);
int nHandle=_open(pcFileName,O_BINARY|O_RDONLY,0);[/code]
and this :
Code: Select all
int nHandle=_sopen(pcFileName,O_BINARY|O_WRONLY|_O_TRUNC|_O_CREAT,SH_DENYWR,_S_IREAD|_S_IWRITE);
Code: Select all
int nHandle=_sopen(pcFileName,O_BINARY|O_WRONLY|_O_TRUNC|_O_CREAT,_S_IREAD|_S_IWRITE);