Skip to content

Commit

Permalink
fix GCC 4.3 compatibility issues (still compiles with GCC 4.2 and MSVC8)
Browse files Browse the repository at this point in the history
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 106cb5c
Show file tree
Hide file tree
Showing 25 changed files with 38 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/app/composer/qgscomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* (at your option) any later version. *
* *
***************************************************************************/
#include <typeinfo>

#include "qgscomposition.h"

#include "qgscomposer.h"
Expand Down
1 change: 1 addition & 0 deletions src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
***************************************************************************/
/* $Id$ */

#include <memory>

#include "qgsattributeactiondialog.h"
#include "qgscontexthelp.h"
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsvectordataprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <QTextCodec>

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

#include "qgsvectordataprovider.h"
#include "qgsfeature.h"
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <cassert>
#include <cfloat>
#include <cstring>
#include <climits>
#include <cmath>
#include <iosfwd>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgscontrastenhancement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/core/spatialindex/geometry/LineSegment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
// Email:
// mhadji@gmail.com

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

Tools::Geometry::LineSegment::LineSegment()
Expand Down
2 changes: 2 additions & 0 deletions src/core/spatialindex/geometry/Point.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
// Email:
// mhadji@gmail.com

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

Tools::Geometry::Point::Point()
Expand Down
2 changes: 2 additions & 0 deletions src/core/spatialindex/geometry/Region.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// Email:
// mhadji@gmail.com

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

Tools::Geometry::Region::Region()
Expand Down
2 changes: 1 addition & 1 deletion src/core/spatialindex/include/RTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/core/spatialindex/include/SpatialIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <queue>
#include <set>
#include <cmath>
#include <string>
#include <cstring>
#include <sstream>

#include "Tools.h"
Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions src/core/spatialindex/rtree/BulkLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/core/spatialindex/rtree/Leaf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/core/spatialindex/rtree/Node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/core/spatialindex/rtree/RTree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 2 additions & 0 deletions src/core/spatialindex/storagemanager/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#ifndef __storagemanager_buffer_h
#define __storagemanager_buffer_h

#include <cstring>

namespace SpatialIndex
{
namespace StorageManager
Expand Down
3 changes: 2 additions & 1 deletion src/core/spatialindex/storagemanager/DiskStorageManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <cstring>

#ifdef WIN32
#include <io.h>
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions src/core/spatialindex/storagemanager/MemoryStorageManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#ifndef __storagemanager_memorystoragemanager_h
#define __storagemanager_memorystoragemanager_h

#include <cstring>

namespace SpatialIndex
{
namespace StorageManager
Expand Down
3 changes: 3 additions & 0 deletions src/core/spatialindex/tools/Tools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
// Email:
// mhadji@gmail.com

#include <cstring>
#include <limits>
#include <cfloat>
#include <Tools.h>
#include "ExternalSort.h"
//#include "SHA1.h"
Expand Down
1 change: 1 addition & 0 deletions src/plugins/grass/qgsgrassmapcalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* *
*************************************************************************/
#include <iostream>
#include <typeinfo>

#include <qapplication.h>
#include <qstringlist.h>
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/grass/qgsgrassmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
#include "qgsfield.h"
#include "qgsfeature.h"

#include <typeinfo>

extern "C" {
#include <grass/gis.h>
#include <grass/Vect.h>
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/qgisplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions src/providers/gpx/gpsdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

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

#include <QFile>
#include <QTextStream>
Expand Down
1 change: 1 addition & 0 deletions src/providers/gpx/qgsgpxprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <algorithm>
#include <iostream>
#include <limits>
#include <cstring>
#include <cmath>

// Changed #include <qapp.h> to <qapplication.h>. Apparently some
Expand Down
1 change: 1 addition & 0 deletions src/providers/postgres/qgspostgisbox2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/* $Id$ */

#include <fstream>
#include <cstdlib>

#include <QString>

Expand Down
1 change: 1 addition & 0 deletions src/providers/postgres/qgspostgisbox3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/* $Id$ */

#include <fstream>
#include <cstdlib>

#include <QString>

Expand Down

0 comments on commit 106cb5c

Please sign in to comment.