[Liblas-commits] laszip: remove all std:: explicit calls and
instead put 'using n...
liblas-commits at liblas.org
liblas-commits at liblas.org
Wed Dec 15 09:51:48 EST 2010
changeset 14b8703b0c4c in /Volumes/Data/www/liblas.org/laszip
details: http://hg.liblas.orglaszip?cmd=changeset;node=14b8703b0c4c
summary: remove all std:: explicit calls and instead put 'using namespace std;' in place to allow for usage by vc6
diffstat:
include/laszip/lasunzipper.hpp | 4 +++-
include/laszip/laszipper.hpp | 5 +++--
src/bytestreamin_istream.hpp | 8 +++++---
src/bytestreamout_ostream.hpp | 14 ++++++++------
src/lasunzipper.cpp | 3 ++-
src/laszipper.cpp | 3 ++-
tools/laszippertest.cpp | 34 ++++++++++++++++++----------------
7 files changed, 41 insertions(+), 30 deletions(-)
diffs (239 lines):
diff -r 74cc4311b468 -r 14b8703b0c4c include/laszip/lasunzipper.hpp
--- a/include/laszip/lasunzipper.hpp Wed Dec 15 08:39:58 2010 -0600
+++ b/include/laszip/lasunzipper.hpp Wed Dec 15 08:51:42 2010 -0600
@@ -52,6 +52,8 @@
#include "laszip.hpp"
+using namespace std;
+
class ByteStreamIn;
class LASreadPoint;
@@ -60,7 +62,7 @@
public:
bool open(FILE* file, unsigned int num_items, const LASitem* items, unsigned int compression=0);
- bool open(std::istream* stream, unsigned int num_items, const LASitem* items, unsigned int compression=0);
+ bool open(istream* stream, unsigned int num_items, const LASitem* items, unsigned int compression=0);
bool read(unsigned char** point);
bool close();
diff -r 74cc4311b468 -r 14b8703b0c4c include/laszip/laszipper.hpp
--- a/include/laszip/laszipper.hpp Wed Dec 15 08:39:58 2010 -0600
+++ b/include/laszip/laszipper.hpp Wed Dec 15 08:51:42 2010 -0600
@@ -48,12 +48,13 @@
#include <stdio.h>
-#if _MSC_VER < 1300
+#if _MSC_VER < 1300
#include <ostream.h>
#else
#include <fstream>
#endif
+using namespace std;
#include "laszip.hpp"
@@ -65,7 +66,7 @@
public:
bool open(FILE* outfile, unsigned int num_items, LASitem* items, unsigned int compression=0);
- bool open(std::ostream* outstream, unsigned int num_items, LASitem* items, unsigned int compression=0);
+ bool open(ostream* outstream, unsigned int num_items, LASitem* items, unsigned int compression=0);
bool write(unsigned char** point);
bool chunk(LASchunk* chunk);
bool close(LASchunk* chunk=0);
diff -r 74cc4311b468 -r 14b8703b0c4c src/bytestreamin_istream.hpp
--- a/src/bytestreamin_istream.hpp Wed Dec 15 08:39:58 2010 -0600
+++ b/src/bytestreamin_istream.hpp Wed Dec 15 08:51:42 2010 -0600
@@ -52,10 +52,12 @@
#include <fstream>
#endif
+using namespace std;
+
class ByteStreamInIstream : public ByteStreamIn
{
public:
- ByteStreamInIstream(std::istream* stream);
+ ByteStreamInIstream(istream* stream);
/* read a single byte */
unsigned int getByte();
/* read an array of bytes */
@@ -63,10 +65,10 @@
/* destructor */
~ByteStreamInIstream(){};
private:
- std::istream* stream;
+ istream* stream;
};
-inline ByteStreamInIstream::ByteStreamInIstream(std::istream* stream)
+inline ByteStreamInIstream::ByteStreamInIstream(istream* stream)
{
this->stream = stream;
}
diff -r 74cc4311b468 -r 14b8703b0c4c src/bytestreamout_ostream.hpp
--- a/src/bytestreamout_ostream.hpp Wed Dec 15 08:39:58 2010 -0600
+++ b/src/bytestreamout_ostream.hpp Wed Dec 15 08:51:42 2010 -0600
@@ -52,10 +52,12 @@
#include <fstream>
#endif
+using namespace std;
+
class ByteStreamOutOstream : public ByteStreamOut
{
public:
- ByteStreamOutOstream(std::ostream* stream);
+ ByteStreamOutOstream(ostream* stream);
/* write a single byte */
bool putByte(unsigned char byte);
/* write an array of bytes */
@@ -67,11 +69,11 @@
/* destructor */
~ByteStreamOutOstream(){};
private:
- std::ostream* stream;
- std::ios::pos_type start;
+ ostream* stream;
+ ios::pos_type start;
};
-ByteStreamOutOstream::ByteStreamOutOstream(std::ostream* stream)
+ByteStreamOutOstream::ByteStreamOutOstream(ostream* stream)
{
this->stream = stream;
resetCount();
@@ -91,8 +93,8 @@
unsigned int ByteStreamOutOstream::byteCount() const
{
- std::ios::pos_type end = stream->tellp();
- std::ios::off_type size = end - start;
+ ios::pos_type end = stream->tellp();
+ ios::off_type size = end - start;
return static_cast<unsigned int>(size);
}
diff -r 74cc4311b468 -r 14b8703b0c4c src/lasunzipper.cpp
--- a/src/lasunzipper.cpp Wed Dec 15 08:39:58 2010 -0600
+++ b/src/lasunzipper.cpp Wed Dec 15 08:51:42 2010 -0600
@@ -49,6 +49,7 @@
#include "bytestreamin_istream.hpp"
#include "lasreadpoint.hpp"
+
bool LASunzipper::open(FILE* infile, unsigned int num_items, const LASitem* items, unsigned int compression)
{
count = 0;
@@ -61,7 +62,7 @@
return true;
}
-bool LASunzipper::open(std::istream* instream, unsigned int num_items, const LASitem* items, unsigned int compression)
+bool LASunzipper::open(istream* instream, unsigned int num_items, const LASitem* items, unsigned int compression)
{
count = 0;
stream = new ByteStreamInIstream(instream);
diff -r 74cc4311b468 -r 14b8703b0c4c src/laszipper.cpp
--- a/src/laszipper.cpp Wed Dec 15 08:39:58 2010 -0600
+++ b/src/laszipper.cpp Wed Dec 15 08:51:42 2010 -0600
@@ -48,6 +48,7 @@
#include "bytestreamout_file.hpp"
#include "bytestreamout_ostream.hpp"
#include "laswritepoint.hpp"
+using namespace std;
bool LASzipper::open(FILE* outfile, unsigned int num_items, LASitem* items, unsigned int compression)
{
@@ -61,7 +62,7 @@
return true;
}
-bool LASzipper::open(std::ostream* outstream, unsigned int num_items, LASitem* items, unsigned int compression)
+bool LASzipper::open(ostream* outstream, unsigned int num_items, LASitem* items, unsigned int compression)
{
count = 0;
stream = new ByteStreamOutOstream(outstream);
diff -r 74cc4311b468 -r 14b8703b0c4c tools/laszippertest.cpp
--- a/tools/laszippertest.cpp Wed Dec 15 08:39:58 2010 -0600
+++ b/tools/laszippertest.cpp Wed Dec 15 08:51:42 2010 -0600
@@ -57,6 +57,8 @@
#endif
+using namespace std;
+
#include <stdio.h>
#include <stdlib.h>
@@ -66,16 +68,16 @@
unsigned int i, j;
unsigned int num_points = 100000;
unsigned int num_errors = 0;
- std::filebuf ofb1;
- std::filebuf ofb2;
- std::ostream* ostream1 = 0;
- std::ostream* ostream2 = 0;
+ filebuf ofb1;
+ filebuf ofb2;
+ ostream* ostream1 = 0;
+ ostream* ostream2 = 0;
FILE* ofile1 = 0;
FILE* ofile2 = 0;
- std::filebuf ifb1;
- std::filebuf ifb2;
- std::istream* istream1 = 0;
- std::istream* istream2 = 0;
+ filebuf ifb1;
+ filebuf ifb2;
+ istream* istream1 = 0;
+ istream* istream2 = 0;
FILE* ifile1 = 0;
FILE* ifile2 = 0;
@@ -122,16 +124,16 @@
if (use_iostream)
{
- ofb1.open("test1.lax", std::ios::out);
- ostream1 = new std::ostream(&ofb1);
+ ofb1.open("test1.lax", ios::out);
+ ostream1 = new ostream(&ofb1);
if (!laszipper1->open(ostream1, num_items, items, LASZIP_COMPRESSION_NONE))
{
fprintf(stderr, "ERROR: could not open laszipper1\n");
exit(1);
}
- ofb2.open("test2.lax", std::ios::out);
- ostream2 = new std::ostream(&ofb2);
+ ofb2.open("test2.lax", ios::out);
+ ostream2 = new ostream(&ofb2);
if (!laszipper2->open(ostream2, num_items, items, LASZIP_COMPRESSION_ARITHMETIC))
{
fprintf(stderr, "ERROR: could not open laszipper2\n");
@@ -195,15 +197,15 @@
if (use_iostream)
{
- ifb1.open("test1.lax", std::ios::in);
- istream1 = new std::istream(&ifb1);
+ ifb1.open("test1.lax", ios::in);
+ istream1 = new istream(&ifb1);
if (!lasunzipper1->open(istream1, num_items, items, LASZIP_COMPRESSION_NONE))
{
fprintf(stderr, "ERROR: could not open lasunzipper1\n");
exit(1);
}
- ifb2.open("test2.lax", std::ios::in);
- istream2 = new std::istream(&ifb2);
+ ifb2.open("test2.lax", ios::in);
+ istream2 = new istream(&ifb2);
if (!lasunzipper2->open(istream2, num_items, items, LASZIP_COMPRESSION_ARITHMETIC))
{
fprintf(stderr, "ERROR: could not open lasunzipper2\n");
More information about the Liblas-commits
mailing list