[Coin-lpsolver] Bug in ClpMain.cpp wrt command parsing...
Edwards, Nathan J.
Nathan.Edwards at celera.com
Fri Feb 20 13:44:16 EST 2004
AIX, g++.
Patch below. std::string::pos's return type isn't unsigned int, but it
only matters when testing against std::string::npos (which in g++ at
least is -1!).
Note that the same bug is present in the Sbb code.
Cheers!
nathan
Nathan Edwards, Ph.D.
Snr Scientist, Bioinformatics
Informatics Research
Applied Biosystems
45 West Gude Drive
Rockville, MD 20850
Phone: (240) 453-3612
Fax: (240) 453-3324
Email: EdwardNJ at AppliedBiosystems.Com
Email: EdwardNJ at Celera.Com
Index: ClpMain.cpp
===================================================================
RCS file: /usr/cvs/coin/COIN/Clp/Test/ClpMain.cpp,v
retrieving revision 1.33
diff -c -r1.33 ClpMain.cpp
*** ClpMain.cpp 12 Feb 2004 21:40:43 -0000 1.33
--- ClpMain.cpp 20 Feb 2004 18:37:46 -0000
***************
*** 417,423 ****
void
ClpItem::gutsOfConstructor()
{
! unsigned int shriekPos = name_.find('!');
lengthName_ = name_.length();
if ( shriekPos==std::string::npos ) {
//does not contain '!'
--- 417,423 ----
void
ClpItem::gutsOfConstructor()
{
! std::string::size_type shriekPos = name_.find('!');
lengthName_ = name_.length();
if ( shriekPos==std::string::npos ) {
//does not contain '!'
***************
*** 479,485 ****
unsigned int it;
for (it=0;it<definedKeyWords_.size();it++) {
std::string thisOne = definedKeyWords_[it];
! unsigned int shriekPos = thisOne.find('!');
unsigned int length1 = thisOne.length();
unsigned int length2 = length1;
if ( shriekPos!=std::string::npos ) {
--- 479,485 ----
unsigned int it;
for (it=0;it<definedKeyWords_.size();it++) {
std::string thisOne = definedKeyWords_[it];
! std::string::size_type shriekPos = thisOne.find('!');
unsigned int length1 = thisOne.length();
unsigned int length2 = length1;
if ( shriekPos!=std::string::npos ) {
***************
*** 518,524 ****
unsigned int it;
for (it=0;it<definedKeyWords_.size();it++) {
std::string thisOne = definedKeyWords_[it];
! unsigned int shriekPos = thisOne.find('!');
if ( shriekPos!=std::string::npos ) {
//contains '!'
thisOne = thisOne.substr(0,shriekPos)+
--- 518,524 ----
unsigned int it;
for (it=0;it<definedKeyWords_.size();it++) {
std::string thisOne = definedKeyWords_[it];
! std::string::size_type shriekPos = thisOne.find('!');
if ( shriekPos!=std::string::npos ) {
//contains '!'
thisOne = thisOne.substr(0,shriekPos)+
More information about the Clp
mailing list