From: mental Date: Sun, 18 Mar 2007 18:39:13 +0000 (+0000) Subject: fix 64-bit issues with width of npos -- patch #1675697 from mellum X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5eb26fcf16904b1881b3df87b17fd2e20a1ae110;p=inkscape.git fix 64-bit issues with width of npos -- patch #1675697 from mellum (Falk Hueffner) --- 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::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();