Skip to content

Commit 9fac1f5

Browse files
author
wonder
committed
- fixed drand48() on windows so spatial index doesn't crash anymore
- debug message in OGR changed from QgsLogger::warning to QgsDebugMsg git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6733 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f2cdb3c commit 9fac1f5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/core/spatialindex/storagemanager/RandomEvictionsBuffer.cc

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
#include "RandomEvictionsBuffer.h"
2828

2929
#ifdef WIN32
30-
double drand48(void) { return (double) rand() / (double) RAND_MAX; }
30+
// following two functions don't exist natively on windows so we'll emulate them
31+
// drand48() returns real number x where 0 <= x < 1
32+
// srand48() initializes generator
33+
34+
double drand48(void) { return (double) rand() / (double) (RAND_MAX+1); }
3135
void srand48(long seed) { srand(seed); }
3236
#endif
3337

src/providers/ogr/qgsogrprovider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ QgsSpatialRefSys QgsOgrProvider::getSRS()
14921492
OGRSpatialReference * mySpatialRefSys = ogrLayer->GetSpatialRef();
14931493
if (mySpatialRefSys == NULL)
14941494
{
1495-
QgsLogger::warning("no spatial reference found");
1495+
QgsDebugMsg("no spatial reference found");
14961496
}
14971497
else
14981498
{

0 commit comments

Comments
 (0)