Skip to content
Permalink
Browse files
fix GCC 4.3 compatibility issues (still compiles with GCC 4.2 and MSVC8)
git-svn-id: http://svn.osgeo.org/qgis/trunk@8257 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 21, 2008
1 parent 2ce0bdc commit 106cb5c6455ae0dd3038038739c9bb9425a20e87
@@ -13,6 +13,8 @@
* (at your option) any later version. *
* *
***************************************************************************/
#include <typeinfo>

#include "qgscomposition.h"

#include "qgscomposer.h"
@@ -17,6 +17,7 @@
***************************************************************************/
/* $Id$ */

#include <memory>

#include "qgsattributeactiondialog.h"
#include "qgscontexthelp.h"
@@ -17,6 +17,7 @@
#include <QTextCodec>

#include <cfloat> // for DBL_MAX
#include <climits>

#include "qgsvectordataprovider.h"
#include "qgsfeature.h"
@@ -24,6 +24,7 @@
#include <cassert>
#include <cfloat>
#include <cstring>
#include <climits>
#include <cmath>
#include <iosfwd>
#include <iostream>
@@ -46,7 +46,7 @@ class CORE_EXPORT QgsContrastEnhancement {
**
** It seems like there should be a better way to do this...
*/
typedef enum QgsRasterDataType {
enum QgsRasterDataType {
QGS_Unknown = 0,
/*! Eight bit unsigned integer */ QGS_Byte = 1,
/*! Sixteen bit unsigned integer */ QGS_UInt16 = 2,
@@ -19,6 +19,8 @@
// Email:
// mhadji@gmail.com

#include <cstring>
#include <limits>
#include <Tools.h>

Tools::Geometry::LineSegment::LineSegment()
@@ -19,6 +19,8 @@
// Email:
// mhadji@gmail.com

#include <cstring>
#include <limits>
#include <Tools.h>

Tools::Geometry::Point::Point()
@@ -17,6 +17,8 @@
// Email:
// mhadji@gmail.com

#include <cstring>
#include <limits>
#include <Tools.h>

Tools::Geometry::Region::Region()
@@ -75,7 +75,7 @@ namespace SpatialIndex
// definition
extern ISpatialIndex* returnRTree(IStorageManager& sm, Tools::PropertySet& ps);
#else
extern ISpatialIndex* returnRTree(IStorageManager& in, Tools::PropertySet& in);
extern ISpatialIndex* returnRTree(IStorageManager& in0, Tools::PropertySet& in1);
#endif//_MSC_VER
extern ISpatialIndex* createNewRTree(
IStorageManager& sm,
@@ -31,7 +31,7 @@
#include <queue>
#include <set>
#include <cmath>
#include <string>
#include <cstring>
#include <sstream>

#include "Tools.h"
@@ -188,7 +188,7 @@ namespace SpatialIndex
// definition
extern IBuffer* returnRandomEvictionsBuffer(IStorageManager& sm, Tools::PropertySet& ps);
#else
extern IBuffer* returnRandomEvictionsBuffer(IStorageManager& in, Tools::PropertySet& in);
extern IBuffer* returnRandomEvictionsBuffer(IStorageManager& in0, Tools::PropertySet& in1);
#endif//_MSC_VER
extern IBuffer* createNewRandomEvictionsBuffer(IStorageManager& in, unsigned int capacity, bool bWriteThrough);
}
@@ -21,6 +21,7 @@

#include <stdio.h>
#include <unistd.h>
#include <cstring>

#include "../spatialindex/SpatialIndexImpl.h"

@@ -135,7 +135,7 @@ void Leaf::deleteData(long id, std::stack<long>& pathBuffer)
{
// keep this in the for loop. The tree height might change after insertions.
byte* overflowTable = new byte[m_pTree->m_stats.m_treeHeight];
bzero(overflowTable, m_pTree->m_stats.m_treeHeight);
memset(overflowTable, 0, m_pTree->m_stats.m_treeHeight);
m_pTree->insertData_impl(n->m_pDataLength[cChild], n->m_pData[cChild], *(n->m_ptrMBR[cChild]), n->m_pIdentifier[cChild], n->m_level, overflowTable);
n->m_pData[cChild] = 0;
delete[] overflowTable;
@@ -592,7 +592,7 @@ void Node::rtreeSplit(unsigned long dataLength, byte* pData, Region& mbr, long i

// use this mask array for marking visited entries.
byte* mask = new byte[m_capacity + 1];
bzero(mask, m_capacity + 1);
memset(mask, 0, m_capacity + 1);

// insert new data in the node for easier manipulation. Data arrays are always
// by one larger than node capacity.
@@ -1097,7 +1097,7 @@ void SpatialIndex::RTree::RTree::insertData_impl(unsigned long dataLength, byte*
NodePtr root = readNode(m_rootID);

overflowTable = new byte[root->m_level];
bzero(overflowTable, root->m_level);
memset(overflowTable, 0, root->m_level);

NodePtr l = root->chooseSubtree(mbr, 0, pathBuffer);
if (l.get() == root.get())
@@ -22,6 +22,8 @@
#ifndef __storagemanager_buffer_h
#define __storagemanager_buffer_h

#include <cstring>

namespace SpatialIndex
{
namespace StorageManager
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <cstring>

#ifdef WIN32
#include <io.h>
@@ -194,7 +195,7 @@ DiskStorageManager::DiskStorageManager(Tools::PropertySet& ps) : m_pageSize(0),

// create buffer.
m_buffer = new byte[m_pageSize];
bzero(m_buffer, m_pageSize);
memset(m_buffer, 0, m_pageSize);

if (bOverwrite == false)
{
@@ -22,6 +22,8 @@
#ifndef __storagemanager_memorystoragemanager_h
#define __storagemanager_memorystoragemanager_h

#include <cstring>

namespace SpatialIndex
{
namespace StorageManager
@@ -19,6 +19,9 @@
// Email:
// mhadji@gmail.com

#include <cstring>
#include <limits>
#include <cfloat>
#include <Tools.h>
#include "ExternalSort.h"
//#include "SHA1.h"
@@ -13,6 +13,7 @@
* *
*************************************************************************/
#include <iostream>
#include <typeinfo>

#include <qapplication.h>
#include <qstringlist.h>
@@ -76,6 +76,8 @@
#include "qgsfield.h"
#include "qgsfeature.h"

#include <typeinfo>

extern "C" {
#include <grass/gis.h>
#include <grass/Vect.h>
@@ -303,7 +305,7 @@ QgsGrassModule::QgsGrassModule ( QgsGrassTools *tools, QString moduleName, QgisI
connect ( &mProcess, SIGNAL(readyReadStandardError()), this, SLOT(readStderr()));
connect ( &mProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(finished(int,QProcess::ExitStatus)));

char *env = "GRASS_MESSAGE_FORMAT=gui";
const char *env = "GRASS_MESSAGE_FORMAT=gui";
char *envstr = new char[strlen(env)+1];
strcpy ( envstr, env );
putenv( envstr );
@@ -1237,7 +1239,7 @@ void QgsGrassModule::run()
* G_GISRC_MODE_MEMORY mode, the variable remains set in variable when a module is run
* -> unset GISRC_MODE_MEMORY. Remove later once 6.1.x / 6.0.1 is widespread.
*/
putenv ( "GISRC_MODE_MEMORY" ); // unset
putenv ( (char*) "GISRC_MODE_MEMORY" ); // unset

mOutputTextBrowser->clear();

@@ -61,7 +61,7 @@ class QgisPlugin
@todo XXX this may be a hint that there should be subclasses
*/
typedef enum PLUGINTYPE
enum PLUGINTYPE
{
UI = 1, /* user interface plug-in */
MAPLAYER, /* map layer plug-in */
@@ -17,6 +17,7 @@

#include <limits>
#include <stdexcept>
#include <cstring>

#include <QFile>
#include <QTextStream>
@@ -21,6 +21,7 @@
#include <algorithm>
#include <iostream>
#include <limits>
#include <cstring>
#include <cmath>

// Changed #include <qapp.h> to <qapplication.h>. Apparently some
@@ -18,6 +18,7 @@
/* $Id$ */

#include <fstream>
#include <cstdlib>

#include <QString>

@@ -18,6 +18,7 @@
/* $Id$ */

#include <fstream>
#include <cstdlib>

#include <QString>

0 comments on commit 106cb5c

Please sign in to comment.