[sword-devel] problems compiling sword

Chris Umphress umphress at gmail.com
Mon Oct 11 13:08:18 MST 2004


On Mon, 11 Oct 2004 11:57:28 -0300, lescribe at bonbon.net 
> first off, it tells me that:
> ../src/mgr/installmgr.cpp: In member function `char
>    sword::InstallMgr::FTPURLGetFile(void*, const char*, const char*)':
> ../src/mgr/installmgr.cpp:158: warning: converting of negative value `-1' to `
>    char'

Warnings shouldn't stop the compile process. Are there any error
messages as well?

> 
> so i go into the installmgr.cpp file and i realize that on line 132, it has
> retVal declared as a char, but later on, it seems like it is used as a
> if/then value, and should be an int. so i changed the line from:
>         char retVal = 0;
> to:
>  int retVal = 0;

in C++, you can assign integer values to a char. For instance, if you
wanted to make "char retVal" equal a space, you could set it with

retVal = 32; //or
retVal = ' ';

I'm not sure why this would stop a compile, though.

> 
> now it compiles. However, i run into another problem later on. it says:
> 
>  ../src/modules/common/rawstr.cpp -o rawstr.o
> ../src/modules/common/rawstr.cpp: In member function `void
>    sword::RawStr::doSetText(const char*, const char*, long int)':
> ../src/modules/common/rawstr.cpp:419: warning: comparison is always true due
> to
>    limited range of data type
> 
> so i go to line 419, and this is what the comparison is:
> else if (strcmp(key, dbKey) > 0) {
>                 if (errorStatus != -2)  // not a new file
>                         idxoff += 6;
>                 else idxoff = 0;
>         }
> 

Interesting warning message. It looks good to me off the top of my
head. strcmp() should be able to return possitive, 0, or negative. Are
there any error messages around this, or is it only the warning?

> 
> gavin
> 
> prov. 4.23

God bless,
Chris

-- 
Chris Umphres <http://daga.dyndns.org/>


More information about the sword-devel mailing list