+ avoid implicit conversion by passing expected types to read_intxx_{ndr,xdr}

( msvc compiler generates an error otherwise )
This commit is contained in:
Artem Pavlenko 2009-07-08 20:52:22 +00:00
parent e5ac14a236
commit 5d193947ae
3 changed files with 7 additions and 7 deletions

View file

@ -42,7 +42,7 @@ dbf_file::dbf_file(std::string const& file_name)
:num_records_(0), :num_records_(0),
num_fields_(0), num_fields_(0),
record_length_(0), record_length_(0),
file_(file_name), file_(file_name,std::ios::binary),
record_(0) record_(0)
{ {
if (file_.is_open()) if (file_.is_open())

View file

@ -94,7 +94,7 @@ struct shape_record
int read_ndr_integer() int read_ndr_integer()
{ {
int val; boost::int32_t val;
read_int32_ndr(&data[pos],val); read_int32_ndr(&data[pos],val);
pos+=4; pos+=4;
return val; return val;
@ -102,7 +102,7 @@ struct shape_record
int read_xdr_integer() int read_xdr_integer()
{ {
int val; boost::int32_t val;
read_int32_xdr(&data[pos],val); read_int32_xdr(&data[pos],val);
pos+=4; pos+=4;
return val; return val;
@ -147,7 +147,7 @@ public:
shape_file() {} shape_file() {}
shape_file(std::string const& file_name) shape_file(std::string const& file_name)
: file_(file_name) {} : file_(file_name,std::ios::binary) {}
~shape_file() {} ~shape_file() {}
@ -177,7 +177,7 @@ public:
{ {
char b[4]; char b[4];
file_.read(b, 4); file_.read(b, 4);
int val; boost::int32_t val;
read_int32_xdr(b,val); read_int32_xdr(b,val);
return val; return val;
} }
@ -186,7 +186,7 @@ public:
{ {
char b[4]; char b[4];
file_.read(b,4); file_.read(b,4);
int val; boost::int32_t val;
read_int32_ndr(b,val); read_int32_ndr(b,val);
return val; return val;
} }

View file

@ -152,7 +152,7 @@ namespace mapnik
int read_integer() int read_integer()
{ {
int n; boost::int32_t n;
if (needSwap_) if (needSwap_)
{ {
read_int32_xdr(wkb_+pos_,n); read_int32_xdr(wkb_+pos_,n);