[QGIS Commit] r11604 - trunk/qgis/src/providers/osm

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Sep 9 09:06:59 EDT 2009


Author: jef
Date: 2009-09-09 09:06:59 -0400 (Wed, 09 Sep 2009)
New Revision: 11604

Modified:
   trunk/qgis/src/providers/osm/osmprovider.cpp
Log:
fix compile error (don't reference std namespace)

Modified: trunk/qgis/src/providers/osm/osmprovider.cpp
===================================================================
--- trunk/qgis/src/providers/osm/osmprovider.cpp	2009-09-09 12:16:24 UTC (rev 11603)
+++ trunk/qgis/src/providers/osm/osmprovider.cpp	2009-09-09 13:06:59 UTC (rev 11604)
@@ -27,9 +27,6 @@
 #include <QDateTime>
 #include <QByteArray>
 
-using namespace std;
-
-
 static const QString TEXT_PROVIDER_KEY = "osm";
 static const QString TEXT_PROVIDER_DESCRIPTION = "Open Street Map data provider";
 static const QString DATE_TIME_FMT = "dd.MM.yyyy HH:mm:ss";
@@ -587,11 +584,11 @@
   if ( fetchGeometry )
   {
     char* geo = new char[21];
-    std::memset( geo, 0, 21 );
+    memset( geo, 0, 21 );
     geo[0] = QgsApplication::endian();
     geo[geo[0] == QgsApplication::NDR ? 1 : 4] = QGis::WKBPoint;
-    std::memcpy( geo + 5, &selLon, sizeof( double ) );
-    std::memcpy( geo + 13, &selLat, sizeof( double ) );
+    memcpy( geo + 5, &selLon, sizeof( double ) );
+    memcpy( geo + 13, &selLat, sizeof( double ) );
     feature.setGeometryAndOwnership(( unsigned char * )geo, 24 );    // 24 is size of wkb point structure!
   }
 
@@ -1017,11 +1014,11 @@
     ( *geo ) = new char[9 + 16 * memberCnt];
     ( *geolen ) = 9 + 16 * memberCnt;
 
-    std::memset(( *geo ), 0, 9 + 16 * memberCnt );
+    memset(( *geo ), 0, 9 + 16 * memberCnt );
 
     ( *geo )[0] = QgsApplication::endian();
     ( *geo )[( *geo )[0] == QgsApplication::NDR ? 1 : 4] = QGis::WKBLineString;
-    std::memcpy(( *geo ) + 5, &memberCnt, 4 );
+    memcpy(( *geo ) + 5, &memberCnt, 4 );
 
     sqlite3_bind_int( stmtSelectMembers, 1, wayId );
 
@@ -1043,8 +1040,8 @@
       if ( selLat > maxLat ) maxLat = selLat;
       if ( selLon > maxLon ) maxLon = selLon;
 
-      std::memcpy(( *geo ) + 9 + 16 * i, &selLon, sizeof( double ) );
-      std::memcpy(( *geo ) + 9 + 16 * i + 8, &selLat, sizeof( double ) );
+      memcpy(( *geo ) + 9 + 16 * i, &selLon, sizeof( double ) );
+      memcpy(( *geo ) + 9 + 16 * i + 8, &selLat, sizeof( double ) );
       i++;
     }
 
@@ -1057,11 +1054,11 @@
     memberCnt++;
     ( *geo ) = new char[13 + 16 * memberCnt];
     ( *geolen ) = 13 + 16 * memberCnt;
-    std::memset(( *geo ), 0, 13 + 16 * memberCnt );
+    memset(( *geo ), 0, 13 + 16 * memberCnt );
     ( *geo )[0] = QgsApplication::endian();
     ( *geo )[( *geo )[0] == QgsApplication::NDR ? 1 : 4] = QGis::WKBPolygon;
-    std::memcpy(( *geo ) + 5, &ringsCnt, 4 );
-    std::memcpy(( *geo ) + 9, &memberCnt, 4 );
+    memcpy(( *geo ) + 5, &ringsCnt, 4 );
+    memcpy(( *geo ) + 9, &memberCnt, 4 );
 
     sqlite3_bind_int( stmtSelectMembers, 1, wayId );
 
@@ -1085,8 +1082,8 @@
       if ( selLat > maxLat ) maxLat = selLat;
       if ( selLon > maxLon ) maxLon = selLon;
 
-      std::memcpy(( *geo ) + 13 + 16 * i, &selLon, sizeof( double ) );
-      std::memcpy(( *geo ) + 13 + 16 * i + 8, &selLat, sizeof( double ) );
+      memcpy(( *geo ) + 13 + 16 * i, &selLon, sizeof( double ) );
+      memcpy(( *geo ) + 13 + 16 * i + 8, &selLat, sizeof( double ) );
 
       if ( firstLat == -1000.0 )
         firstLat = selLat;
@@ -1095,8 +1092,8 @@
       i++;
     }
     // add last polygon line
-    std::memcpy(( *geo ) + 13 + 16 * i, &firstLon, sizeof( double ) );
-    std::memcpy(( *geo ) + 13 + 16 * i + 8, &firstLat, sizeof( double ) );
+    memcpy(( *geo ) + 13 + 16 * i, &firstLon, sizeof( double ) );
+    memcpy(( *geo ) + 13 + 16 * i + 8, &firstLat, sizeof( double ) );
 
     sqlite3_bind_blob( stmtUpdateWay, 1, ( *geo ), 13 + 16 * memberCnt, SQLITE_TRANSIENT );
   }
@@ -1368,7 +1365,7 @@
 
   if ( sqlite3_exec( mDatabase, ptr, 0, 0, 0 ) != SQLITE_OK )
   {
-    cout << "Storing osm-file-last-modified info into database failed." << endl;
+    QgsDebugMsg( "Storing osm-file-last-modified info into database failed." );
     // its not fatal situation, lets continue..
   }
 
@@ -1378,7 +1375,7 @@
 
   if ( sqlite3_exec( mDatabase, ptr2, 0, 0, 0 ) != SQLITE_OK )
   {
-    cout << "Storing osm-provider-version info into database failed." << endl;
+    QgsDebugMsg( "Storing osm-provider-version info into database failed." );
     return false;
   }
 
@@ -1396,7 +1393,7 @@
 
   if ( sqlite3_exec( mDatabase, ptr3, 0, 0, 0 ) != SQLITE_OK )
   {
-    cout << "Storing default area boundaries information into database failed." << endl;
+    QgsDebugMsg( "Storing default area boundaries information into database failed." );
     // its not critical situation
   }
 



More information about the QGIS-commit mailing list