14
14
* limitations under the License.
15
15
*/
16
16
17
- #define UWORD unsigned short int // 2-byte unsigned integer
18
-
19
- #define mapcode_cversion "2.0.1"
17
+ #define mapcode_dataversion "2.0" // coords 2.0.2
20
18
#define MAXWIDE 10
21
19
#define BASEX 31
22
20
#define MAXFITLONG 6
23
- #define XSIDE3 168
24
- #define YSIDE3 176
25
21
26
- #define ALIASES "2UK=2UT,2CG=2CT,1GU=GUM,1UM=UMI,1VI=VIR,1PR=PRI, 1AS=ASM,1MP=MNP,4CX=CXR,4CC=CCK,4NF=NFK,4HM=HMD,COL=5CL,5ME=5MX,MEX=5MX,5TM=TAM, 5AG=AGU,5BC=BCN,5BS=BCS,5CM=CAM,5CS=CHP,5CH=CHH,5CO=COA,5DF=DIF,5DG=DUR,5GT=GUA,5GR=GRO,5HG=HID,5JA=JAL,5MI=MIC,5MO=MOR,5NA=NAY,5NL=NLE,5OA=OAX,5PB=PUE,5QE=QUE,5QR=ROO,5SL=SLP,5SI=SIN,5SO=SON,5TB=TAB,5TL=TLA,5VE=VER,5YU=YUC,5ZA=ZAC,811=8BJ,812=8TJ,813=8HE,814=8SX,815=8NM,821=8LN,822=8JL,823=8HL,831=8SH,832=8JS,833=8ZJ,834=8AH,835=8FJ,836=8JX,837=8SD,841=8HA,842=8HB,843=8HN,844=8GD,845=8GX,846=8HI,850=8CQ,851=8SC,852=8GZ,853=8YN,854=8XZ,861=8SN,862=8GS,863=8QH,864=8NX,865=8XJ,871=TWN,891=HKG,892=MAC,8TW=TWN,8HK=HKG,8MC=MAC,BEL=7BE,KIR=7KI,PRI=7PO,CHE=7CH,KHM=7KM,PER=7PM,TAM=7TT,0US=USA,0AU=AUS,0RU=RUS,0CN=CHN,TAA=SHN,ASC=SHN,DGA=IOT,WAK=MHL,JTN=UMI,MID=1HI,2OD=2OR,"
22
+ #define ALIASES "2UK=2UT,2CG=2CT,1GU=GUM,1UM=UMI,1VI=VIR,1AS=ASM,1MP=MNP,4CX=CXR,4CC=CCK,4NF=NFK,4HM=HMD,COL=5CL,5ME=5MX,MEX=5MX,5AG=AGU,5BC=BCN,5BS=BCS,5CM=CAM,5CS=CHP,5CH=CHH,5CO=COA,5DF=DIF,5DG=DUR,5GT=GUA,5GR=GRO,5HG=HID,5JA=JAL,5MI=MIC,5MO=MOR,5NA=NAY,5NL=NLE,5OA=OAX,5PB=PUE,5QE=QUE,5QR=ROO,5SL=SLP,5SI=SIN,5SO=SON,5TB=TAB,5TL=TLA,5VE=VER,5YU=YUC,5ZA=ZAC,811=8BJ,812=8TJ,813=8HE,814=8SX,815=8NM,821=8LN,822=8JL,823=8HL,831=8SH,832=8JS,833=8ZJ,834=8AH,835=8FJ,836=8JX,837=8SD,841=8HA,842=8HB,843=8HN,844=8GD,845=8GX,846=8HI,850=8CQ,851=8SC,852=8GZ,853=8YN,854=8XZ,861=8SN,862=8GS,863=8QH,864=8NX,865=8XJ,871=TWN,891=HKG,892=MAC,8TW=TWN,8HK=HKG,8MC=MAC,BEL=7BE,KIR=7KI,PRI=7PO,CHE=7CH,KHM=7KM,PER=7PM,TAM=7TT,0US=USA,0AU=AUS,0RU=RUS,0CN=CHN,TAA=SHN,ASC=SHN,DGA=IOT,WAK=MHL,JTN=UMI,MID=1HI,1PR=PRI,5TM=TAM,TAM=TAM ,2OD=2OR,"
27
23
28
24
#define MAX_CCODE 533 // total number of areas (i.e. recognised iso codes) in this database
29
25
static const char *entity_iso = ""
@@ -84,37 +80,31 @@ static const char *entity_iso = ""
84
80
85
81
#define usa_from 343
86
82
#define usa_upto 393
87
- #define ccode_usa 410
88
83
#define ind_from 271
89
84
#define ind_upto 306
90
85
#define ccode_ind 407
91
86
#define can_from 394
92
87
#define can_upto 406
93
- #define ccode_can 495
94
88
#define aus_from 307
95
89
#define aus_upto 315
96
- #define ccode_aus 408
97
90
#define mex_from 233
98
91
#define mex_upto 264
99
92
#define ccode_mex 411
100
93
#define bra_from 316
101
94
#define bra_upto 342
102
- #define ccode_bra 409
103
95
#define chn_from 497
104
96
#define chn_upto 527
105
- #define ccode_chn 528
106
97
#define rus_from 412
107
98
#define rus_upto 494
108
- #define ccode_rus 496
109
- #define ccode_ata 531
110
99
#define ccode_earth 532
111
100
112
101
#define parents3 "USA,IND,CAN,AUS,MEX,BRA,RUS,CHN,"
113
102
#define parents2 "US,IN,CA,AU,MX,BR,RU,CN,"
103
+ static const int parentnr[9] = {-1,410,407,495,408,411,409,496,528};
114
104
115
105
116
106
117
- static const UWORD xdivider19[172] = {
107
+ static const int xdivider19[172] = {
118
108
360, 360, 360, 360, 360, 360, 361, 361, 361, 361,
119
109
362, 362, 362, 363, 363, 363, 364, 364, 365, 366,
120
110
366, 367, 367, 368, 369, 370, 370, 371, 372, 373,
@@ -135,11 +125,11 @@ static const UWORD xdivider19[172] = {
135
125
23681,59485
136
126
};
137
127
138
- static const long nc[MAXFITLONG+1] = { 1, 31, 961, 29791, 923521, 28629151, 887503681 };
128
+ static const int nc[MAXFITLONG+1] = { 1, 31, 961, 29791, 923521, 28629151, 887503681 };
139
129
140
- static const long xside[MAXWIDE] = { 0, 5, 31, 168, 961, 168*31, 29791, 165869, 923521, 5141947};
130
+ static const int xside[MAXWIDE] = { 0, 5, 31, 168, 961, 168*31, 29791, 165869, 923521, 5141947};
141
131
142
- static const long yside[MAXWIDE] = { 0, 6, 31, 176, 961, 176*31, 29791, 165869, 923521, 5141947};
132
+ static const int yside[MAXWIDE] = { 0, 6, 31, 176, 961, 176*31, 29791, 165869, 923521, 5141947};
143
133
144
134
static const signed char decode_chars[256] = {
145
135
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -167,7 +157,7 @@ static const char encode_chars[34] = {
167
157
,'A','E','U'};
168
158
169
159
170
- static const UWORD data_start[MAX_CCODE+1] = {
160
+ static const int data_start[MAX_CCODE+1] = {
171
161
0, 3, 6, 10, 14, 17, 19, 20, 31, 32,
172
162
34, 36, 38, 43, 45, 48, 52, 59, 63, 65,
173
163
67, 71, 73, 81, 87, 95, 97, 132, 139, 149,
@@ -227,7 +217,7 @@ static const UWORD data_start[MAX_CCODE+1] = {
227
217
#define NR_RECS 16344
228
218
#define WORST_RECS_PER_CCODE 195 // 8 Argentina @43
229
219
230
- typedef struct { long minx; long miny; long maxx; long maxy; unsigned long flags; } mminforec;
220
+ typedef struct { int minx; int miny; int maxx; int maxy; int flags; } mminforec;
231
221
232
222
#ifndef MAKE_SOURCE_DIGITAL
233
223
static const mminforec mminfo[NR_RECS+1] = {
0 commit comments