summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2007-03-18 18:39:13 +0000
committermental <mental@users.sourceforge.net>2007-03-18 18:39:13 +0000
commitcafc0a767ff7852a805dfb3a08b6c7f712444c8f (patch)
treed3c2954bf6fbf3e5bad03d3840cdc4bdef3ef80c /src
parentUpdated Catalan translation (diff)
downloadinkscape-cafc0a767ff7852a805dfb3a08b6c7f712444c8f.tar.gz
inkscape-cafc0a767ff7852a805dfb3a08b6c7f712444c8f.zip
fix 64-bit issues with width of npos -- patch #1675697 from mellum
(Falk Hueffner) (bzr r2695)
Diffstat (limited to 'src')
-rw-r--r--src/deptool.cpp4
-rw-r--r--src/dialogs/swatches.cpp12
-rw-r--r--src/dom/uri.cpp4
-rw-r--r--src/extension/implementation/script.cpp4
-rw-r--r--src/extension/internal/odf.cpp2
-rw-r--r--src/layer-manager.cpp2
-rw-r--r--src/ui/dialog/filedialog.cpp2
7 files changed, 15 insertions, 15 deletions
diff --git a/src/deptool.cpp b/src/deptool.cpp
index ffb533981..45a01c4e7 100644
--- a/src/deptool.cpp
+++ b/src/deptool.cpp
@@ -497,7 +497,7 @@ void DepTool::parseName(const String &fullname,
if (fullname.size() < 2)
return;
- unsigned int pos = fullname.find_last_of('/');
+ String::size_type pos = fullname.find_last_of('/');
if (pos != fullname.npos && pos<fullname.size()-1)
{
path = fullname.substr(0, pos);
@@ -529,7 +529,7 @@ String DepTool::getSuffix(const String &fname)
{
if (fname.size() < 2)
return "";
- unsigned int pos = fname.find_last_of('.');
+ String::size_type pos = fname.find_last_of('.');
if (pos == fname.npos)
return "";
pos++;
diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp
index e29335193..900b83cc1 100644
--- a/src/dialogs/swatches.cpp
+++ b/src/dialogs/swatches.cpp
@@ -596,12 +596,12 @@ bool parseNum( char*& str, int& val ) {
static bool getBlock( std::string& dst, guchar ch, std::string const str )
{
bool good = false;
- size_t pos = str.find(ch);
+ std::string::size_type pos = str.find(ch);
if ( pos != std::string::npos )
{
- size_t pos2 = str.find( '(', pos );
+ std::string::size_type pos2 = str.find( '(', pos );
if ( pos2 != std::string::npos ) {
- size_t endPos = str.find( ')', pos2 );
+ std::string::size_type endPos = str.find( ')', pos2 );
if ( endPos != std::string::npos ) {
dst = str.substr( pos2 + 1, (endPos - pos2 - 1) );
good = true;
@@ -614,7 +614,7 @@ static bool getBlock( std::string& dst, guchar ch, std::string const str )
static bool popVal( guint64& numVal, std::string& str )
{
bool good = false;
- size_t endPos = str.find(',');
+ std::string::size_type endPos = str.find(',');
if ( endPos == std::string::npos ) {
endPos = str.length();
}
@@ -644,11 +644,11 @@ void ColorItem::_wireMagicColors( void* p )
{
for ( std::vector<ColorItem*>::iterator it = onceMore->_colors.begin(); it != onceMore->_colors.end(); ++it )
{
- size_t pos = (*it)->def.descr.find("*{");
+ std::string::size_type pos = (*it)->def.descr.find("*{");
if ( pos != std::string::npos )
{
std::string subby = (*it)->def.descr.substr( pos + 2 );
- size_t endPos = subby.find("}*");
+ std::string::size_type endPos = subby.find("}*");
if ( endPos != std::string::npos )
{
subby.erase( endPos );
diff --git a/src/dom/uri.cpp b/src/dom/uri.cpp
index 6db803134..b56b5c217 100644
--- a/src/dom/uri.cpp
+++ b/src/dom/uri.cpp
@@ -332,7 +332,7 @@ URI URI::resolve(const URI &other) const
}
else
{
- unsigned int pos = path.find_last_of('/');
+ std::string::size_type pos = path.find_last_of('/');
if (pos != path.npos)
{
DOMString tpath = path.substr(0, pos+1);
@@ -378,7 +378,7 @@ void URI::normalize()
}
while (pos < path.size())
{
- unsigned int pos2 = path.find('/', pos);
+ std::string::size_type pos2 = path.find('/', pos);
if (pos2==path.npos)
{
DOMString seg = path.substr(pos);
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index 003f1fc64..af70a04f0 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -293,8 +293,8 @@ Script::check_existance(const Glib::ustring &command)
The default search path is the current directory */
path = G_SEARCHPATH_SEPARATOR_S;
- unsigned int pos = 0;
- unsigned int pos2 = 0;
+ std::string::size_type pos = 0;
+ std::string::size_type pos2 = 0;
while ( pos < path.size() ) {
Glib::ustring localPath;
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp
index a19d03a31..f67800ca5 100644
--- a/src/extension/internal/odf.cpp
+++ b/src/extension/internal/odf.cpp
@@ -902,7 +902,7 @@ static Glib::ustring getExtension(const Glib::ustring &fname)
{
Glib::ustring ext;
- unsigned int pos = fname.rfind('.');
+ std::string::size_type pos = fname.rfind('.');
if (pos == fname.npos)
{
ext = "";
diff --git a/src/layer-manager.cpp b/src/layer-manager.cpp
index 4d92d37c8..e6a34852d 100644
--- a/src/layer-manager.cpp
+++ b/src/layer-manager.cpp
@@ -94,7 +94,7 @@ void LayerManager::renameLayer( SPObject* obj, gchar const *label )
Glib::ustring base(incoming);
guint startNum = 1;
- size_t pos = base.rfind('#');
+ Glib::ustring::size_type pos = base.rfind('#');
if ( pos != Glib::ustring::npos ) {
gchar* numpart = g_strdup(base.substr(pos+1).c_str());
if ( numpart ) {
diff --git a/src/ui/dialog/filedialog.cpp b/src/ui/dialog/filedialog.cpp
index 0cdd49477..cd5730a5c 100644
--- a/src/ui/dialog/filedialog.cpp
+++ b/src/ui/dialog/filedialog.cpp
@@ -1554,7 +1554,7 @@ void FileSaveDialogImpl::updateNameAndExtension()
try {
bool appendExtension = true;
Glib::ustring utf8Name = Glib::filename_to_utf8( myFilename );
- size_t pos = utf8Name.rfind('.');
+ Glib::ustring::size_type pos = utf8Name.rfind('.');
if ( pos != Glib::ustring::npos ) {
Glib::ustring trail = utf8Name.substr( pos );
Glib::ustring foldedTrail = trail.casefold();