Skip to content

Commit 4becbc3

Browse files
author
jef
committed
fix #1523 (r10084 was actually fixing #1516)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10094 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9b08521 commit 4becbc3

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/plugins/spit/qgsdbfbase.h

+10-4
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,22 @@
1515
/* $Id$ */
1616

1717
// Dbase header structure
18+
#ifndef _MSC_VER
19+
#include <stdint.h>
20+
#else
21+
typedef __int32 int32_t;
22+
typedef __int16 int16_t;
23+
#endif
1824

1925
struct DbaseHeader
2026
{
2127
unsigned char valid_dbf;
2228
char year;
2329
char month;
2430
char day;
25-
long num_recs;
26-
short size_hdr;
27-
short size_rec;
31+
int32_t num_recs;
32+
int16_t size_hdr;
33+
int16_t size_rec;
2834
char reserved[3];
2935
char lan[13];
3036
char reserved2[4];
@@ -35,7 +41,7 @@ struct FieldDescriptorArray
3541
{
3642
char field_name[11];
3743
char field_type;
38-
long field_addr; /* used only in memory */
44+
int32_t field_addr; /* used only in memory */
3945
unsigned char field_length;
4046
unsigned char field_decimal;
4147
char reserved[2];

src/plugins/spit/qgsshapefile.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ QString QgsShapeFile::getFeatureClass()
207207
dbf.read(( char * )&fda, sizeof( fda ) );
208208
switch ( fda.field_type )
209209
{
210-
case 'N': if (( int )fda.field_decimal > 0 )
210+
case 'N':
211+
if (( int )fda.field_decimal > 0 )
211212
column_types.push_back( "float" );
212213
else
213214
column_types.push_back( "int" );

0 commit comments

Comments
 (0)