diff --git a/plugins/input/shape/dbffile.cpp b/plugins/input/shape/dbffile.cpp index 97aaaf945..7a90abb0f 100644 --- a/plugins/input/shape/dbffile.cpp +++ b/plugins/input/shape/dbffile.cpp @@ -42,7 +42,7 @@ dbf_file::dbf_file(std::string const& file_name) :num_records_(0), num_fields_(0), record_length_(0), - file_(file_name), + file_(file_name,std::ios::binary), record_(0) { if (file_.is_open()) diff --git a/plugins/input/shape/shapefile.hpp b/plugins/input/shape/shapefile.hpp index ff1934558..5c589a7a4 100644 --- a/plugins/input/shape/shapefile.hpp +++ b/plugins/input/shape/shapefile.hpp @@ -94,7 +94,7 @@ struct shape_record int read_ndr_integer() { - int val; + boost::int32_t val; read_int32_ndr(&data[pos],val); pos+=4; return val; @@ -102,7 +102,7 @@ struct shape_record int read_xdr_integer() { - int val; + boost::int32_t val; read_int32_xdr(&data[pos],val); pos+=4; return val; @@ -147,7 +147,7 @@ public: shape_file() {} shape_file(std::string const& file_name) - : file_(file_name) {} + : file_(file_name,std::ios::binary) {} ~shape_file() {} @@ -177,7 +177,7 @@ public: { char b[4]; file_.read(b, 4); - int val; + boost::int32_t val; read_int32_xdr(b,val); return val; } @@ -186,7 +186,7 @@ public: { char b[4]; file_.read(b,4); - int val; + boost::int32_t val; read_int32_ndr(b,val); return val; } diff --git a/src/wkb.cpp b/src/wkb.cpp index d6307ebef..06c569c14 100644 --- a/src/wkb.cpp +++ b/src/wkb.cpp @@ -152,7 +152,7 @@ namespace mapnik int read_integer() { - int n; + boost::int32_t n; if (needSwap_) { read_int32_xdr(wkb_+pos_,n);