[commit] r2706 - trunk/GME/Parser
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Mon Oct 30 15:58:10 CDT 2017
Author: ksmyth
Date: Mon Oct 30 15:58:10 2017
New Revision: 2706
Log:
Parser: use size_t for string index
Modified:
trunk/GME/Parser/MgaParser.cpp
trunk/GME/Parser/MgaParserBC.cpp
Modified: trunk/GME/Parser/MgaParser.cpp
==============================================================================
--- trunk/GME/Parser/MgaParser.cpp Mon Oct 30 15:58:07 2017 (r2705)
+++ trunk/GME/Parser/MgaParser.cpp Mon Oct 30 15:58:10 2017 (r2706)
@@ -1477,14 +1477,14 @@
const std::tstring *s = GetByNameX(attributes, _T("refs"));
if( s != NULL )
{
- int pos = s->find_first_not_of(' ', 0);
- ASSERT( pos >= 0 );
- while( pos < (int) s->length() )
+ size_t pos = s->find_first_not_of(' ', 0);
+ ASSERT(pos != -1);
+ while (pos < s->length())
{
- int pos2 = s->find_first_of(' ', pos);
- if( pos2 < 0 )
+ size_t pos2 = s->find_first_of(' ', pos);
+ if (pos2 == -1)
pos2 = s->length();
- ASSERT( pos2 > pos );
+ ASSERT(pos2 > pos);
CComObjPtr<IMgaFCO> ref;
LookupByID(std::tstring(*s, pos, pos2-pos), ref);
@@ -1676,14 +1676,14 @@
const std::tstring *s = GetByNameX(attributes, _T("members"));
if( s != NULL )
{
- int pos = s->find_first_not_of(' ', 0);
- ASSERT( pos >= 0 );
- while( pos < (int) s->length() )
+ size_t pos = s->find_first_not_of(' ', 0);
+ ASSERT(pos != -1);
+ while (pos < s->length())
{
- int pos2 = s->find_first_of(' ', pos);
- if( pos2 < 0 )
+ size_t pos2 = s->find_first_of(' ', pos);
+ if (pos2 == -1)
pos2 = s->length();
- ASSERT( pos2 > pos );
+ ASSERT(pos2 > pos);
CComObjPtr<IMgaFCO> member;
LookupByID(std::tstring(*s, pos, pos2-pos), member);
Modified: trunk/GME/Parser/MgaParserBC.cpp
==============================================================================
--- trunk/GME/Parser/MgaParserBC.cpp Mon Oct 30 15:58:07 2017 (r2705)
+++ trunk/GME/Parser/MgaParserBC.cpp Mon Oct 30 15:58:10 2017 (r2706)
@@ -364,14 +364,14 @@
const std::tstring *s = GetByNameX(attributes, _T("refs"));
if( s != NULL )
{
- int pos = s->find_first_not_of(' ', 0);
- ASSERT( pos >= 0 );
- while( pos < (int) s->length() )
+ size_t pos = s->find_first_not_of(' ', 0);
+ ASSERT(pos != -1);
+ while (pos < s->length())
{
- int pos2 = s->find_first_of(' ', pos);
- if( pos2 < 0 )
+ size_t pos2 = s->find_first_of(' ', pos);
+ if (pos2 == -1)
pos2 = s->length();
- ASSERT( pos2 > pos );
+ ASSERT(pos2 > pos);
CComObjPtr<IMgaFCO> ref;
LookupByID(std::tstring(*s, pos, pos2-pos), ref);
@@ -525,14 +525,14 @@
const std::tstring *s = GetByNameX(attributes, _T("members"));
if( s != NULL )
{
- int pos = s->find_first_not_of(' ', 0);
- ASSERT( pos >= 0 );
- while( pos < (int) s->length() )
+ size_t pos = s->find_first_not_of(' ', 0);
+ ASSERT(pos != -1);
+ while (pos < s->length())
{
- int pos2 = s->find_first_of(' ', pos);
- if( pos2 < 0 )
+ size_t pos2 = s->find_first_of(' ', pos);
+ if (pos2 == -1)
pos2 = s->length();
- ASSERT( pos2 > pos );
+ ASSERT(pos2 > pos);
CComObjPtr<IMgaFCO> member;
LookupByID(std::tstring(*s, pos, pos2-pos), member);
More information about the gme-commit
mailing list