[r-cran-maps] 46/64: Import Upstream version 2.3-7
Andreas Tille
tille at debian.org
Thu Sep 7 07:32:33 UTC 2017
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository r-cran-maps.
commit 248c262b6ca88a3e2ced20d7ef4189f047ce661a
Author: Andreas Tille <tille at debian.org>
Date: Thu Sep 7 09:27:28 2017 +0200
Import Upstream version 2.3-7
---
DESCRIPTION | 8 +--
MD5 | 15 ++---
R/misc.r | 203 ++++++++++++++++++++++++++++----------------------------
R/zzz.R | 2 +-
man/map.Rd | 8 ++-
src/Gmake.c | 58 +++++++++-------
src/Lmake.c | 54 +++++++++------
src/Makefile | 2 +-
src/symbols.rds | Bin 564 -> 0 bytes
9 files changed, 186 insertions(+), 164 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index 7084259..44a88f7 100755
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: maps
Title: Draw Geographical Maps
-Version: 2.3-6
-Date: 2013-09-05
+Version: 2.3-7
+Date: 2014-06-03
Author: Original S code by Richard A. Becker and Allan R. Wilks.
R version by Ray Brownrigg <Ray.Brownrigg at ecs.vuw.ac.nz>.
Enhancements by Thomas P Minka <tpminka at media.mit.edu>
@@ -12,7 +12,7 @@ LazyLoad: yes
Suggests: mapproj (>= 1.2-0)
License: GPL-2
Maintainer: Ray Brownrigg <Ray.Brownrigg at ecs.vuw.ac.nz>
-Packaged: 2013-09-04 19:50:53 UTC; ray
+Packaged: 2014-06-03 00:23:44 UTC; ray
NeedsCompilation: yes
Repository: CRAN
-Date/Publication: 2013-09-06 06:36:40
+Date/Publication: 2014-06-03 07:13:43
diff --git a/MD5 b/MD5
index 69d62d4..0d7e604 100644
--- a/MD5
+++ b/MD5
@@ -1,11 +1,11 @@
-40b981d8eff994934bab1be17289c7d8 *DESCRIPTION
+d7a5ae3ed874f0bd68501ffe28146510 *DESCRIPTION
a7f0b8524eb866e5c1637c2bb26a6e6d *NAMESPACE
541be685a010ed74e9f33aeaf491abad *R/db.r
e7b747bc196353936d98e95797a2dfc1 *R/map.r
-87ee42928e3da1330378b83a4f90b61e *R/misc.r
+e3c0a0e61f5804c6847cc1023979dba0 *R/misc.r
fde3fa1c0a45d395b1ef633701becaef *R/polygon.r
45bb5cad9ffc203d8e62dae784725f37 *R/smooth.r
-d761cb0e87098ffd6c692723e9bba355 *R/zzz.R
+e0c9fa51a95a955a46f92e6ee2f0e1bc *R/zzz.R
6d3acd6bf8fe0501140653a66952a160 *data/canada.cities.rda
f7bd11430306cc100dd4d259291733ce *data/county.fips.rda
44b4c90c5a48be9b0df22f8672ba1ae6 *data/countyMapEnv.rda
@@ -35,7 +35,7 @@ f6c4336f6614dabf3573895a38ea1099 *man/identify.map.Rd
b39d593d4b02815c823f555cf8599ee5 *man/internal.Rd
56766404494d261648f09393180151dc *man/internal2.Rd
b26a115b2797ec918ad277ce680dcd8a *man/italy.Rd
-897c3359d4a599874f33d5e93a50592c *man/map.Rd
+c1937dd13e8a86bf0e503f6dd1b48977 *man/map.Rd
f590ca3d82f3a60d0714c70bf6bdffb6 *man/map.axes.Rd
075d0bdab24034a7afc7cbabda65f70a *man/map.cities.Rd
7154c4758c1f712f926af93e5fce1c60 *man/map.scale.Rd
@@ -55,9 +55,9 @@ ba6071e86450424b7b2ef124f177e447 *man/usa.Rd
faa77f6cbf5f22717cce65cf9067a97b *man/world.Rd
dc4668c3b67ae20d466fdb60c07be88c *man/world.cities.Rd
f8d6628f3fd04780afafbd5143d39b6b *man/world2.Rd
-f684d16afeece0ab0ecdaddd67397466 *src/Gmake.c
-9d0c7fa4265c2622840a930b7fa8f67a *src/Lmake.c
-7088312f20b1d127d59081a8ea4ce10c *src/Makefile
+eccd234607d07a4bb8470fb29acdac41 *src/Gmake.c
+4e6736aa698e81a165bbe6052ae3bf8e *src/Lmake.c
+0c93a8514ba96b4593e933eafc88e53f *src/Makefile
d1ebffb0e35151ea78870f20b78320d5 *src/Makefile.win
ee000c17ddd154301f679ce267ed4918 *src/README
885521324ea75cdfcea9d91a5afb0ec5 *src/convert.awk
@@ -101,7 +101,6 @@ db440c97b18a6344052b56e25b841f4f *src/state.vbm.gonstats
85b0e36ec94dcf8b1b5b39ae324106b1 *src/state.vbm.line
69fd7440de022ae8ff0874b0aa441de7 *src/state.vbm.linestats
55f43c464d795dfd9f5c30bd1326a431 *src/state.vbm.name
-1bfd33c4dac0fcabfbcf1c3ffd063e25 *src/symbols.rds
7565197b7181346e1632535bfc36650a *src/thin.c
f298493e3329a78ce0931272d511b60f *src/usa.gon
1c1041f7228b105eaaa93d8b3a9bf8d1 *src/usa.gonstats
diff --git a/R/misc.r b/R/misc.r
index 1963188..c455d2e 100644
--- a/R/misc.r
+++ b/R/misc.r
@@ -1,100 +1,99 @@
"mapthin" <-
function(xy, delta, symmetric = TRUE)
{
- x <- xy$x
- y <- xy$y
- xy <- .C("mapthin", PACKAGE="maps",
- x = as.double(x),
- y = as.double(y),
- n = as.integer(length(x)),
- as.double(delta),
- as.integer(symmetric),
- NAOK = TRUE)[c("x", "y", "n")]
- length(xy$x) <- xy$n
- length(xy$y) <- xy$n
- xy[c("x", "y")]
+ x <- xy$x
+ y <- xy$y
+ xy <- .C("mapthin", PACKAGE="maps",
+ x = as.double(x),
+ y = as.double(y),
+ n = as.integer(length(x)),
+ as.double(delta),
+ as.integer(symmetric),
+ NAOK = TRUE)[c("x", "y", "n")]
+ length(xy$x) <- xy$n
+ length(xy$y) <- xy$n
+ xy[c("x", "y")]
}
# add axes to a map
"map.axes" <-
function()
{
- axis(1)
- axis(2)
- box()
- invisible()
+ axis(1)
+ axis(2)
+ box()
+ invisible()
}
"map.cities" <-
function (x = world.cities, country = "", label = NULL, minpop = 0,
- maxpop = Inf, capitals = 0, cex = par("cex"), projection = FALSE,
- parameters = NULL, orientation = NULL, pch = 1, ...)
+ maxpop = Inf, capitals = 0, cex = par("cex"), projection = FALSE,
+ parameters = NULL, orientation = NULL, pch = 1, ...)
{
- if (missing(x)) {
- data("world.cities", package = "maps", envir = environment()) # uses lazy evaluation
- world.cities <- get("world.cities")
- }
- usr <- par("usr")
- if (!missing(projection) && projection != FALSE) {
- if (require(mapproj)) {
- if (is.character(projection)) {
- projx <- mapproject(x$long, x$lat, projection = projection,
- parameters = parameters, orientation = orientation)
- } else {
- if (nchar(.Last.projection()$projection) > 0) {
- projx <- mapproject(x$long, x$lat)
- } else stop("No projection defined\n")
- }
- x$long <- projx$x
- x$lat <- projx$y
- } else stop("mapproj package not available\n")
- } else {
- if (usr[2] > (180 + 0.04*(usr[2] - usr[1])))
- x$long[x$long < 0] <- 360 + x$long[x$long < 0]
- }
- selection <- x$long >= usr[1] & x$long <= usr[2] & x$lat >=
- usr[3] & x$lat <= usr[4] & (x$pop >= minpop & x$pop <=
- maxpop) & ((capitals == 0) | (x$capital >= 1))
- if (country != "")
- selection <- selection & x$country.etc == country
- selection0 <- selection & (x$capital == 0) & (capitals == 0)
- selection01 <- selection & (x$capital <= 1) & (capitals <= 1)
- selection1 <- selection & (x$capital == 1) & (capitals == 1)
- selection2 <- selection & (x$capital == 2) & (capitals == 2)
- selection3 <- selection & (x$capital == 3) & (capitals == 3)
- if (is.null(label))
- label <- sum(selection) < 20
- cxy <- par("cxy")
- if (sum(selection01) > 0)
- points(x$long[selection01], x$lat[selection01], pch = pch,
- cex = cex * 0.6, ...)
- if (sum(selection0) > 0)
- if (label)
- text(x$long[selection0], x$lat[selection0] + cxy[2] *
- cex * 0.7, paste(" ", x$name[selection0], sep = ""),
- cex = cex * 0.7, ...)
- if (sum(selection1) > 0) {
- points(x$long[selection1], x$lat[selection1], pch = pch,
- cex = cex, ...)
- text(x$long[selection1], x$lat[selection1] + cxy[2] *
- cex, paste(" ", x$name[selection1], sep = ""), cex = cex *
- 1.2, ...)
+ if (missing(x)) {
+ data("world.cities", package = "maps", envir = environment()) # uses lazy evaluation
+ world.cities <- get("world.cities")
+ }
+ usr <- par("usr")
+ if (!missing(projection) && projection != FALSE) {
+ if (require(mapproj)) {
+ if (is.character(projection)) {
+ projx <- mapproject(x$long, x$lat, projection = projection,
+ parameters = parameters, orientation = orientation)
+ } else {
+ if (nchar(.Last.projection()$projection) > 0) {
+ projx <- mapproject(x$long, x$lat)
+ } else stop("No projection defined\n")
+ }
+ x$long <- projx$x
+ x$lat <- projx$y
+ } else stop("mapproj package not available\n")
+ } else {
+ if (usr[2] > (180 + 0.04*(usr[2] - usr[1])))
+ x$long[x$long < 0] <- 360 + x$long[x$long < 0]
+ }
+ selection <- x$long >= usr[1] & x$long <= usr[2] & x$lat >= usr[3] &
+ x$lat <= usr[4] & (x$pop >= minpop & x$pop <= maxpop) & ((capitals == 0) |
+ (x$capital >= 1))
+ if (country != "")
+ selection <- selection & x$country.etc == country
+ selection0 <- selection & (x$capital == 0) & (capitals == 0)
+ selection01 <- selection & (x$capital <= 1) & (capitals <= 1)
+ selection1 <- selection & (x$capital == 1) & (capitals == 1)
+ selection2 <- selection & (x$capital == 2) & (capitals == 2)
+ selection3 <- selection & (x$capital == 3) & (capitals == 3)
+ if (is.null(label))
+ label <- sum(selection) < 20
+ cxy <- par("cxy")
+ if (sum(selection01) > 0)
+ points(x$long[selection01], x$lat[selection01], pch = pch,
+ cex = cex * 0.6, ...)
+ if (sum(selection0) > 0)
+ if (label)
+ text(x$long[selection0], x$lat[selection0] + cxy[2] * cex * 0.7,
+ paste(" ", x$name[selection0], sep = ""), cex = cex * 0.7, ...)
+ if (sum(selection1) > 0) {
+ if (label) {
+ points(x$long[selection1], x$lat[selection1], pch = pch, cex = cex, ...)
+ text(x$long[selection1], x$lat[selection1] + cxy[2] * cex,
+ paste(" ", x$name[selection1], sep = ""), cex = cex * 1.2, ...)
}
- if (sum(selection2) > 0) {
- points(x$long[selection2], x$lat[selection2], pch = pch,
- cex = cex, ...)
- text(x$long[selection2], x$lat[selection2] + cxy[2] *
- cex * 1.1, paste(" ", x$name[selection2], sep = ""),
- cex = cex * 1.1, ...)
+ }
+ if (sum(selection2) > 0) {
+ if (label) {
+ points(x$long[selection2], x$lat[selection2], pch = pch, cex = cex, ...)
+ text(x$long[selection2], x$lat[selection2] + cxy[2] * cex * 1.1,
+ paste(" ", x$name[selection2], sep = ""), cex = cex * 1.1, ...)
}
- if (sum(selection3) > 0) {
- points(x$long[selection3], x$lat[selection3], pch = pch,
- cex = cex, ...)
- text(x$long[selection3], x$lat[selection3] + cxy[2] *
- cex * 0.9, paste(" ", x$name[selection3], sep = ""),
- cex = cex * 0.9, ...)
+ }
+ if (sum(selection3) > 0) {
+ if (label) {
+ points(x$long[selection3], x$lat[selection3], pch = pch, cex = cex, ...)
+ text(x$long[selection3], x$lat[selection3] + cxy[2] * cex * 0.9,
+ paste(" ", x$name[selection3], sep = ""), cex = cex * 0.9, ...)
}
- invisible()
+ }
+ invisible()
}
# draw a scale bar on a map
@@ -107,25 +106,25 @@ function (x, y, relwidth = 0.15, metric = TRUE, ratio = TRUE, ...)
# }
# minka: new version
format.pretty <- function(x, digits = 2) {
- x = signif(x, 2)
- prettyNum(formatC(x, format = "fg", digits = digits), big.mark = ",")
+ x = signif(x, 2)
+ prettyNum(formatC(x, format = "fg", digits = digits), big.mark = ",")
}
usr <- par("usr")
if (missing(y))
- y <- (9 * usr[3] + usr[4])/10
+ y <- (9 * usr[3] + usr[4])/10
if (abs(y) >= 90)
- warning("location of scale out of this world!")
+ warning("location of scale out of this world!")
if (missing(x))
- #x <- (0.9 - relwidth) * usr[2] + (0.1 + relwidth) * usr[1]
- x <- (9 * usr[1] + usr[2])/10
+ #x <- (0.9 - relwidth) * usr[2] + (0.1 + relwidth) * usr[1]
+ x <- (9 * usr[1] + usr[2])/10
cosy <- cos((2 * pi * y)/360)
perdeg <- (2 * pi * (6356.78 + 21.38 * cosy) * cosy)/360
scale <- (perdeg * 100000)/(2.54 * (par("pin")/diff(par("usr"))[-2])[1])
if (metric)
- unit <- "km"
+ unit <- "km"
else {
- perdeg <- perdeg * 0.6213712
- unit <- "mi"
+ perdeg <- perdeg * 0.6213712
+ unit <- "mi"
}
len <- perdeg * relwidth * (usr[2] - usr[1])
ats <- pretty(c(0, len), n = 2)
@@ -140,18 +139,18 @@ function (x, y, relwidth = 0.15, metric = TRUE, ratio = TRUE, ...)
linexy[1, ] <- c(x, y)
linexy[2, ] <- c(x, y + dy)
for (i in 1:(nats - 1)) {
- linexy[3 * i, ] <- c(x + (i - 1) * dx, y)
- linexy[3 * i + 1, ] <- c(x + i * dx, y)
- linexy[3 * i + 2, ] <- c(x + i * dx, y + dy)
+ linexy[3 * i, ] <- c(x + (i - 1) * dx, y)
+ linexy[3 * i + 1, ] <- c(x + i * dx, y)
+ linexy[3 * i + 2, ] <- c(x + i * dx, y + dy)
}
lines(linexy)
# minka: this is broken
text(x + ats/perdeg, y + dy - 0.5 * cxy[2], labs, adj = c(0.4, 0.5), ...)
# minka: added ratio option
if(ratio)
- text(x, y + 0.5 * cxy[2],
- paste("scale approx 1:", format.pretty(scale), sep = ""),
- adj = 0, ...)
+ text(x, y + 0.5 * cxy[2],
+ paste("scale approx 1:", format.pretty(scale), sep = ""),
+ adj = 0, ...)
invisible(scale)
}
@@ -167,13 +166,13 @@ map.wrap <- function(p) {
x = c()
y = c()
for(i in j) {
- if(length(x) > 0) {
- x = c(x, NA)
- y = c(y, NA)
- }
- x = c(x, p$x[start:i])
- y = c(y, p$y[start:i])
- start = i + 1
+ if(length(x) > 0) {
+ x = c(x, NA)
+ y = c(y, NA)
+ }
+ x = c(x, p$x[start:i])
+ y = c(y, p$y[start:i])
+ start = i + 1
}
list(x = x[2:length(x)], y = y[2:length(y)])
}
diff --git a/R/zzz.R b/R/zzz.R
index fc28b0b..26c25d4 100755
--- a/R/zzz.R
+++ b/R/zzz.R
@@ -1,5 +1,5 @@
.onLoad <- function(lib, pkg) {
if (Sys.getenv("R_MAP_DATA_DIR") == "")
- Sys.setenv("R_MAP_DATA_DIR"=paste(lib, pkg, "mapdata/", sep="/"))
+ Sys.setenv("R_MAP_DATA_DIR" = paste(lib, pkg, "mapdata/", sep="/"))
library.dynam("maps", pkg, lib)
}
diff --git a/man/map.Rd b/man/map.Rd
index 11ee657..b08f0fa 100644
--- a/man/map.Rd
+++ b/man/map.Rd
@@ -21,8 +21,12 @@ map(database = "world", regions = ".", exact = FALSE, boundary = TRUE,
three USA databases (\code{\link{usa}}, \code{\link{state}},
\code{\link{county}}), and more (see the package index). The
location of the map databases may be overridden by setting the
- \code{R_MAP_DATA_DIR} environment variable. See \code{\link{world}}
- for further details.
+ \code{R_MAP_DATA_DIR} environment variable. Note that the
+ \code{\link{world}} (and \code{\link[mapdata]{worldHires}}) databases
+ are derived from a very old 1908's CIA database for which updates
+ have not been made freely available. In particular the individual
+ Russian states are still defined collectively as "USSR".
+ See \code{\link{world}} for further details.
}
\item{regions}{
character vector that names the polygons to draw.
diff --git a/src/Gmake.c b/src/Gmake.c
index 1473c71..da156bc 100644
--- a/src/Gmake.c
+++ b/src/Gmake.c
@@ -24,10 +24,20 @@ isspace(int c);
int
fatal(s, a, b)
+char *s, *a;
+int b;
+{
+ fprintf(stderr, s, a, b);
+ fprintf(stderr, "\n");
+ exit(1);
+}
+
+int
+fatal2(s, a, b)
char *s;
int a, b;
{
- fprintf(stderr, s, a, a, b);
+ fprintf(stderr, s, a, b);
fprintf(stderr, "\n");
exit(1);
}
@@ -108,9 +118,9 @@ Polyline r;
seek = sizeof(int) + sizeof(Polyline) + (r-1)*sizeof(struct line_h);
if(Seek(Lin, seek) == -1)
- fatal("Cannot seek to header in %s", (int)Linefile, 0);
+ fatal("Cannot seek to header in %s", Linefile, 0);
if(Read(Lin, &lh, 1) != 1)
- fatal("Cannot read header in %s", (int)Linefile, 0);
+ fatal("Cannot read header in %s", Linefile, 0);
return(&lh);
}
@@ -126,25 +136,25 @@ FILE *in, *out;
int column, k;
if(Read(in, &n, 1) != 1)
- fatal("Cannot read size", 0, 0);
+ fatal2("Cannot read size", 0, 0);
Alloc(rh, n, struct region_h);
if(rh == NULL)
- fatal("No memory for headers", 0, 0);
+ fatal2("No memory for headers", 0, 0);
if(Read(in, rh, n) != n)
- fatal("Cannot read headers", 0, 0);
+ fatal2("Cannot read headers", 0, 0);
for(i = 0; i < n; i++)
N = Max(N, rh[i].nline);
Alloc(r, N, Polyline);
if(r == NULL)
- fatal("No memory for data", 0, 0);
+ fatal2("No memory for data", 0, 0);
for(i = 0; i < n; i++) {
if((m = rh[i].nline) <= 0)
- fatal("Negative line count at header %d", (int)i,
+ fatal2("Negative line count at header %d", (int)i,
0);
if(Seek(in, rh[i].offset) < 0)
- fatal("Cannot seek to record %d", (int)i, 0);
+ fatal2("Cannot seek to record %d", (int)i, 0);
if(Read(in, r, m) != m)
- fatal("Cannot read record %d", (int)i, 0);
+ fatal2("Cannot read record %d", (int)i, 0);
column = 0;
for(j = 0; j < m; j++) {
sprintf(buf, " %d", (int)r[j]);
@@ -171,30 +181,30 @@ FILE *in, *out;
Polyline *r;
if(Seek(out, sizeof(Region) + np*sizeof(struct region_h)) < 0)
- fatal("Cannot seek in input file", 0, 0);
+ fatal2("Cannot seek in input file", 0, 0);
Alloc(rh, np, struct region_h);
Alloc(r, maxl+1, Polyline);
if(rh == NULL || r == NULL)
- fatal("No memory", 0, 0);
+ fatal2("No memory", 0, 0);
for(i = 0; i < np; i++) {
m = 0;
while((t = getpoly(in, &r[m++])) > 0)
;
if(t < 0)
- fatal("Read, line=%d word=%d", (int)i, (int)m);
+ fatal2("Read, line=%d word=%d", (int)i, (int)m);
--m;
rh[i].offset = ftell(out);
rh[i].nline = m;
set_range(rh+i, r);
if(Write(out, r, m) != m)
- fatal("Cannot write record %d", (int)i, 0);
+ fatal2("Cannot write record %d", (int)i, 0);
}
if(Seek(out, 0) < 0)
- fatal("Cannot seek to beginning of output file", 0, 0);
+ fatal2("Cannot seek to beginning of output file", 0, 0);
if(Write(out, &n, 1) != 1)
- fatal("Cannot write size to output file", 0, 0);
+ fatal2("Cannot write size to output file", 0, 0);
if(Write(out, rh, np) != np)
- fatal("Cannot write headers to output file", 0, 0);
+ fatal2("Cannot write headers to output file", 0, 0);
}
int
@@ -208,23 +218,23 @@ char *av[];
Me = av[0];
if(ac < 5)
- fatal(Usage, (int)Me, 0);
+ fatal(Usage, Me, 0);
ascii = *av[1] == 'a';
if(ac != (ascii ? 5 : 6))
- fatal(Usage, (int)Me, 0);
+ fatal(Usage, Me, 0);
Infile = av[2];
if((in = fopen(av[2], "rb")) == NULL)
- fatal("Cannot open %s for reading", (int)av[2], 0);
+ fatal("Cannot open %s for reading", av[2], 0);
if((in2 = fopen(av[3], "rb")) == NULL)
- fatal("Cannot open %s for reading", (int)av[3], 0);
+ fatal("Cannot open %s for reading", av[3], 0);
if(fscanf(in2, "%d%d", &np, &maxl) != 2)
- fatal("Cannot read stats data file %s", (int)av[3], 0);
+ fatal("Cannot read stats data file %s", av[3], 0);
n = np; /* won't read directly */
if((out = fopen(av[4], "wb")) == NULL)
- fatal("Cannot open %s for writing", (int)av[4], 0);
+ fatal("Cannot open %s for writing", av[4], 0);
Linefile = av[5];
if(!ascii && (Lin = fopen(av[5], "rb")) == NULL)
- fatal("Cannot open %s for reading", (int)av[5], 0);
+ fatal("Cannot open %s for reading", av[5], 0);
ascii ? to_ascii(in, out) : to_binary(in, out);
exit(0);
}
diff --git a/src/Lmake.c b/src/Lmake.c
index c27fc13..8d56cc0 100644
--- a/src/Lmake.c
+++ b/src/Lmake.c
@@ -24,6 +24,16 @@ isspace(int c);
int
fatal(s, a, b)
+char *s, *a;
+int b;
+{
+ fprintf(stderr, s, a, b);
+ fprintf(stderr, "\n");
+ exit(1);
+}
+
+int
+fatal2(s, a, b)
char *s;
int a, b;
{
@@ -117,31 +127,31 @@ FILE *in, *out;
int column, k;
if(Seek(in, sizeof(Coordtype)))
- fatal("Cannot seek past coordtype", 0, 0);
+ fatal2("Cannot seek past coordtype", 0, 0);
if(Read(in, &n, 1) != 1)
- fatal("Cannot read size", 0, 0);
+ fatal2("Cannot read size", 0, 0);
Alloc(lh, n, struct line_h);
if(lh == NULL)
- fatal("No memory for headers", 0, 0);
+ fatal2("No memory for headers", 0, 0);
if(Read(in, lh, n) != n)
- fatal("Cannot read headers", 0, 0);
+ fatal2("Cannot read headers", 0, 0);
for(i = 0; i < n; i++)
N = Max(N, lh[i].npair);
Alloc(xy, N, struct pair);
if(xy == NULL)
- fatal("No memory for data", 0, 0);
+ fatal2("No memory for data", 0, 0);
for(i = 0; i < n; i++) {
if((m = lh[i].npair) <= 0)
- fatal("Negative pair count at header %d", (int)i,
+ fatal2("Negative pair count at header %d", (int)i,
0);
if(Seek(in, lh[i].offset) < 0)
- fatal("Cannot seek to record %d", (int)i, 0);
+ fatal2("Cannot seek to record %d", (int)i, 0);
/*
* Simple read; change this to use other means of
* storing the polyline data.
*/
if(Read(in, xy, m) != m)
- fatal("Cannot read record %d", (int)i, 0);
+ fatal2("Cannot read record %d", (int)i, 0);
fprintf(out, "%d %d\n", (int)lh[i].left, (int)lh[i].right);
column = 0;
for(j = 0; j < m; j++) {
@@ -170,14 +180,14 @@ FILE *in, *out;
struct pair *xy;
if(Seek(out, sizeof(Coordtype) + sizeof(Polyline) + nl*sizeof(struct line_h)) < 0)
- fatal("Cannot seek in input file", 0, 0);
+ fatal2("Cannot seek in input file", 0, 0);
Alloc(lh, nl, struct line_h);
Alloc(xy, maxp+1, struct pair);
if(lh == NULL || xy == NULL)
- fatal("No memory", 0, 0);
+ fatal2("No memory", 0, 0);
for(i = 0; i < nl; i++) {
if(fscanf(in, "%d%d", &l, &r) != 2)
- fatal("Cannot read left and right at line %d", (int)i+1,
+ fatal2("Cannot read left and right at line %d", (int)i+1,
0);
lh[i].left = l;
lh[i].right = r;
@@ -189,7 +199,7 @@ FILE *in, *out;
m++;
}
if(t < 0)
- fatal("Read, line=%d word=%d", (int)i+1, (int)2+m*2);
+ fatal2("Read, line=%d word=%d", (int)i+1, (int)2+m*2);
lh[i].offset = ftell(out);
lh[i].npair = m;
set_range(lh+i, xy);
@@ -198,16 +208,16 @@ FILE *in, *out;
* storing the polyline data.
*/
if(Write(out, xy, m) != m)
- fatal("Cannot write record %d", (int)i, 0);
+ fatal2("Cannot write record %d", (int)i, 0);
}
if(Seek(out, 0) < 0)
- fatal("Cannot seek to beginning of output file", 0, 0);
+ fatal2("Cannot seek to beginning of output file", 0, 0);
if(Write(out, &Coordtype, 1) != 1)
- fatal("Cannot write coordtype to output file", 0, 0);
+ fatal2("Cannot write coordtype to output file", 0, 0);
if(Write(out, &n, 1) != 1)
- fatal("Cannot write size to output file", 0, 0);
+ fatal2("Cannot write size to output file", 0, 0);
if(Write(out, lh, nl) != nl)
- fatal("Cannot write headers to output file", 0, 0);
+ fatal2("Cannot write headers to output file", 0, 0);
}
int
@@ -220,19 +230,19 @@ char *av[];
Me = av[0];
if(ac != 7)
- fatal(Usage, (int)Me, 0);
+ fatal(Usage, Me, 0);
Precision = atoi(av[1]);
Coordtype = av[2][0] == 's' ? SPHERE : PLANE;
Infile = av[4];
if((in = fopen(av[4], "rb")) == NULL)
- fatal("Cannot open %s for reading", (int)av[4], 0);
+ fatal("Cannot open %s for reading", av[4], 0);
if((in2 = fopen(av[5], "rb")) == NULL)
- fatal("Cannot open %s for reading", (int)av[5], 0);
+ fatal("Cannot open %s for reading", av[5], 0);
if(fscanf(in2, "%d%d", &nl, &maxp) != 2)
- fatal("Cannot read stats data file %s", (int)av[3], 0);
+ fatal("Cannot read stats data file %s", av[3], 0);
n = nl;
if((out = fopen(av[6], "wb")) == NULL)
- fatal("Cannot open %s for writing", (int)av[6], 0);
+ fatal("Cannot open %s for writing", av[6], 0);
av[3][0] == 'a' ? (void) to_ascii(in, out) : (void) to_binary(in, out);
exit(0);
}
diff --git a/src/Makefile b/src/Makefile
index e014f19..277249a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -59,5 +59,5 @@ world2.line: world.line
@$(CP) world.name world2.name
clean:
- $(RM) $(OBJS) Gmake Lmake world2.* $(PKGNAME).s[lo] $(PKGNAME).dylib *.exe maps.dll
+ $(RM) $(OBJS) Gmake Lmake world2.* $(PKGNAME).s[lo] $(PKGNAME).dylib *.exe maps.dll symbols.rds
$(RM) -r ../inst ../libs
diff --git a/src/symbols.rds b/src/symbols.rds
deleted file mode 100644
index 58fa982..0000000
Binary files a/src/symbols.rds and /dev/null differ
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-maps.git
More information about the debian-science-commits
mailing list