Skip to content

Commit

Permalink
Fix compiler warnings in providers
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@6498 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Feb 3, 2007
1 parent 2be7dcf commit 961eb1e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/providers/gpx/gpsdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ typedef QSet<int> QgsFeatureIds;
*/
class GPSObject {
public:
virtual ~GPSObject() {};
QString xmlify(const QString& str);
virtual void writeXML(QTextStream& stream);
QString name, cmt, desc, src, url, urlname;
Expand Down
18 changes: 16 additions & 2 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void QgsOgrProvider::loadFields()
for(int i=0;i<fdef->GetFieldCount();++i)
{
OGRFieldDefn *fldDef = fdef->GetFieldDefn(i);
OGRFieldType type = type = fldDef->GetType();
OGRFieldType type = fldDef->GetType();
bool numeric = (type == OFTInteger || type == OFTReal);
mAttributeFields.insert(i, QgsField(
mEncoding->toUnicode(fldDef->GetNameRef()),
Expand Down Expand Up @@ -495,7 +495,7 @@ void QgsOgrProvider::getFeatureGeometry(int key, QgsFeature *f)

if ((fet = ogrLayer->GetFeature(key)) != NULL)
{
if (geom = fet->GetGeometryRef())
if ((geom = fet->GetGeometryRef()))
{
geom = fet->GetGeometryRef();
// get the wkb representation
Expand Down Expand Up @@ -741,6 +741,13 @@ bool QgsOgrProvider::addFeature(QgsFeature& f)
}
break;
}
default:
{
QgsLogger::debug("Unknown feature type of: ", (int)(ftype), 1,
__FILE__, __FUNCTION__, __LINE__);
return false;
break;
}
}

QgsAttributeMap attrs = f.attributeMap();
Expand Down Expand Up @@ -1411,6 +1418,13 @@ QGISEXTERN bool createEmptyDataSource(const QString& uri,
case QGis::WKBPolygon:
OGRvectortype = wkbPolygon;
break;
default:
{
QgsLogger::debug("Unknown vector type of: ", (int)(vectortype), 1,
__FILE__, __FUNCTION__, __LINE__);
return false;
break;
}
}

OGRLayer* layer;
Expand Down
6 changes: 4 additions & 2 deletions src/providers/wfs/qgswfsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ int QgsWFSProvider::describeFeatureType(const QString& uri, QString& geometryAtt
return describeFeatureTypePOST(uri, geometryAttribute, fields);
case QgsWFSProvider::SOAP:
return describeFeatureTypeSOAP(uri, geometryAttribute, fields);
case QgsWFSProvider::FILE:
return describeFeatureTypeFile(uri, geometryAttribute, fields);
}
return 1;
}
Expand Down Expand Up @@ -534,7 +536,7 @@ int QgsWFSProvider::readAttributesFromSchema(QDomDocument& schemaDoc, QString& g

//find <complexType name=complexTypeType
QDomNodeList complexTypeNodeList = schemaElement.elementsByTagNameNS("http://www.w3.org/2001/XMLSchema", "complexType");
for(int i = 0; i < complexTypeNodeList.length(); ++i)
for(uint i = 0; i < complexTypeNodeList.length(); ++i)
{
if(complexTypeNodeList.at(i).toElement().attribute("name") == complexTypeType)
{
Expand All @@ -556,7 +558,7 @@ int QgsWFSProvider::readAttributesFromSchema(QDomDocument& schemaDoc, QString& g
return 5;
}

for(int i = 0; i < attributeNodeList.length(); ++i)
for(uint i = 0; i < attributeNodeList.length(); ++i)
{
QDomElement attributeElement = attributeNodeList.at(i).toElement();
//attribute name
Expand Down

0 comments on commit 961eb1e

Please sign in to comment.