Skip to content

Commit ee188c5

Browse files
committed
Replaced long with int
1 parent cf18424 commit ee188c5

File tree

4 files changed

+196
-178
lines changed

4 files changed

+196
-178
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Copyright (C) 2014-2015 Stichting Mapcode Foundation (http://www.mapcode.com)
77
**Online documentation can be found at: http://mapcode-foundation.github.io/mapcode-cpp/**
88

99

10-
## The C/C++ Library: `mapcodelib/`
10+
# The C/C++ Library: `mapcodelib/`
1111

1212
The directory 'mapcodelib' contains the files:
1313

@@ -29,7 +29,7 @@ In that case, basics.h will state a version number of the for:
2929
where "xxx" states the geographical limitation.
3030

3131

32-
## A Real-Life Example, The 'mapcode' Codec Tool: `utility/`
32+
# A Real-Life Example, The 'mapcode' Codec Tool: `utility/`
3333

3434
The directory 'utility' contains a Mapcode encoding/decoding utility, as an example
3535
of how to use the library.
@@ -48,11 +48,25 @@ This tool provides a rather extensive command-line interface to encode and
4848
decode Mapcodes.
4949

5050

51-
## Release Notes
51+
# Release Notes
5252

5353
* 2.0.2
5454

55-
Speed-up of encoding (4x times faster than 2.0.1).
55+
Speed-up of encoding (4 times faster than 2.0.1).
56+
57+
Added optional mapcode_countrynames.h, with the English short names, formal names,
58+
and name variants of all territories.
59+
60+
Added optional mapcode_countrynames_short.h with only the short English names and
61+
name variants.
62+
63+
Stricter processing of high-precision letters (now fails on illegal high-precision
64+
letters, which includes the letter Z).
65+
66+
Fix to allow illegal letters "i" and "o" in Hindi, Bengali, Tibetan and Gurmukhi
67+
(so they can later be interpreted as digits 1 and 0).
68+
69+
Fix for some unrecognized aliases in convertTerritoryIsoNameToCode().
5670

5771
* 2.0.1
5872

@@ -135,7 +149,7 @@ decode Mapcodes.
135149

136150
Initial release to the public domain.
137151

138-
## License
152+
# License
139153

140154
Licensed under the Apache License, Version 2.0 (the "License");
141155
you may not use this file except in compliance with the License.

mapcodelib/basics.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define BASEX 31
2020
#define MAXFITLONG 6
2121

22-
#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,"
2323

2424
#define MAX_CCODE 533 // total number of areas (i.e. recognised iso codes) in this database
2525
static const char *entity_iso = ""
@@ -104,7 +104,7 @@ static const int parentnr[9] = {-1,410,407,495,408,411,409,496,528};
104104

105105

106106

107-
static const long xdivider19[172] = {
107+
static const int xdivider19[172] = {
108108
360, 360, 360, 360, 360, 360, 361, 361, 361, 361,
109109
362, 362, 362, 363, 363, 363, 364, 364, 365, 366,
110110
366, 367, 367, 368, 369, 370, 370, 371, 372, 373,
@@ -125,11 +125,11 @@ static const long xdivider19[172] = {
125125
23681,59485
126126
};
127127

128-
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 };
129129

130-
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};
131131

132-
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};
133133

134134
static const signed char decode_chars[256] = {
135135
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -217,7 +217,7 @@ static const int data_start[MAX_CCODE+1] = {
217217
#define NR_RECS 16344
218218
#define WORST_RECS_PER_CCODE 195 // 8 Argentina @43
219219

220-
typedef struct { long minx; long miny; long maxx; long maxy; long flags; } mminforec;
220+
typedef struct { int minx; int miny; int maxx; int maxy; int flags; } mminforec;
221221

222222
#ifndef MAKE_SOURCE_DIGITAL
223223
static const mminforec mminfo[NR_RECS+1] = {

0 commit comments

Comments
 (0)