Skip to content

Commit d9b276a

Browse files
author
ripley
committed
Rboolean -> bool (and some corrections)
git-svn-id: https://svn.r-project.org/R/trunk@87953 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 3f73a3b commit d9b276a

File tree

8 files changed

+285
-292
lines changed

8 files changed

+285
-292
lines changed

src/library/grDevices/src/cairo/cairoBM.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static void cbm_Size(double *left, double *right,
9191
# include "bitmap.h"
9292
#endif
9393

94-
static Rboolean
94+
static bool
9595
BM_Open(pDevDesc dd, pX11Desc xd, int width, int height)
9696
{
9797
char buf[R_PATH_MAX];
@@ -127,15 +127,15 @@ BM_Open(pDevDesc dd, pX11Desc xd, int width, int height)
127127
if (res != CAIRO_STATUS_SUCCESS) {
128128
xd->cs = NULL;
129129
warning("cairo error '%s'", cairo_status_to_string(res));
130-
return FALSE;
130+
return false;
131131
}
132132
if(xd->onefile)
133133
cairo_svg_surface_restrict_to_version(xd->cs, CAIRO_SVG_VERSION_1_2);
134134
xd->cc = cairo_create(xd->cs);
135135
res = cairo_status(xd->cc);
136136
if (res != CAIRO_STATUS_SUCCESS) {
137137
warning("cairo error '%s'", cairo_status_to_string(res));
138-
return FALSE;
138+
return false;
139139
}
140140
cairo_set_antialias(xd->cc, xd->antialias);
141141
}
@@ -149,15 +149,15 @@ BM_Open(pDevDesc dd, pX11Desc xd, int width, int height)
149149
res = cairo_surface_status(xd->cs);
150150
if (res != CAIRO_STATUS_SUCCESS) {
151151
warning("cairo error '%s'", cairo_status_to_string(res));
152-
return FALSE;
152+
return false;
153153
}
154154
cairo_surface_set_fallback_resolution(xd->cs, xd->fallback_dpi,
155155
xd->fallback_dpi);
156156
xd->cc = cairo_create(xd->cs);
157157
res = cairo_status(xd->cc);
158158
if (res != CAIRO_STATUS_SUCCESS) {
159159
warning("cairo error '%s'", cairo_status_to_string(res));
160-
return FALSE;
160+
return false;
161161
}
162162
cairo_set_antialias(xd->cc, xd->antialias);
163163
}
@@ -171,7 +171,7 @@ BM_Open(pDevDesc dd, pX11Desc xd, int width, int height)
171171
res = cairo_surface_status(xd->cs);
172172
if (res != CAIRO_STATUS_SUCCESS) {
173173
warning("cairo error '%s'", cairo_status_to_string(res));
174-
return FALSE;
174+
return false;
175175
}
176176
// We already require >= 1.2
177177
#if CAIRO_VERSION_MAJOR > 2 || CAIRO_VERSION_MINOR >= 6
@@ -184,7 +184,7 @@ BM_Open(pDevDesc dd, pX11Desc xd, int width, int height)
184184
res = cairo_status(xd->cc);
185185
if (res != CAIRO_STATUS_SUCCESS) {
186186
warning("cairo error '%s'", cairo_status_to_string(res));
187-
return FALSE;
187+
return false;
188188
}
189189
cairo_set_antialias(xd->cc, xd->antialias);
190190
}
@@ -198,7 +198,7 @@ BM_Open(pDevDesc dd, pX11Desc xd, int width, int height)
198198
CairoInitGroups(xd);
199199
xd->appending = 0;
200200

201-
return TRUE;
201+
return true;
202202
}
203203

204204

@@ -397,18 +397,18 @@ static void BM_Close(pDevDesc dd)
397397

398398

399399

400-
static Rboolean
400+
static bool
401401
BMDeviceDriver(pDevDesc dd, int kind, SEXP filename,
402402
int quality, int width, int height, int ps,
403403
int bg, int res, int antialias, const char *family,
404-
double dpi, const char *symbolfamily, Rboolean usePUA)
404+
double dpi, const char *symbolfamily, bool usePUA)
405405
{
406406
pX11Desc xd;
407407
int res0 = (res > 0) ? res : 72;
408408
double dps = ps;
409409

410410
/* allocate new device description */
411-
if (!(xd = (pX11Desc) calloc(1, sizeof(X11Desc)))) return FALSE;
411+
if (!(xd = (pX11Desc) calloc(1, sizeof(X11Desc)))) return false;
412412
strncpy(xd->filename, R_ExpandFileName(translateCharFP(filename)),
413413
R_PATH_MAX - 1);
414414
xd->filename[R_PATH_MAX - 1] = '\0';
@@ -463,7 +463,7 @@ BMDeviceDriver(pDevDesc dd, int kind, SEXP filename,
463463

464464
if (!BM_Open(dd, xd, width, height)) {
465465
free(xd);
466-
return FALSE;
466+
return false;
467467
}
468468
if (xd->type == SVG || xd->type == PDF || xd->type == PS)
469469
xd->onefile = quality != 0;
@@ -557,7 +557,7 @@ BMDeviceDriver(pDevDesc dd, int kind, SEXP filename,
557557

558558
dd->deviceSpecific = (void *) xd;
559559

560-
return TRUE;
560+
return true;
561561
}
562562

563563
const static struct {
@@ -585,7 +585,7 @@ SEXP in_Cairo(SEXP args)
585585
pGEDevDesc gdd;
586586
SEXP sc;
587587
const char *family, *symbolfamily;
588-
Rboolean usePUA;
588+
bool usePUA;
589589
int type, quality, width, height, pointsize, bgcolor, res, antialias;
590590
double dpi;
591591
SEXP filename;
@@ -646,7 +646,7 @@ SEXP in_Cairo(SEXP args)
646646
error(_("invalid '%s' argument"), "symbolfamily");
647647
symbolfamily = translateChar(STRING_ELT(CAR(args), 0));
648648
/* scsymbol forced to have "usePUA" attribute in R code */
649-
usePUA = asRboolean(getAttrib(CAR(args), install("usePUA")));
649+
usePUA = asBool(getAttrib(CAR(args), install("usePUA")));
650650

651651
R_GE_checkVersionOrDie(R_GE_version);
652652
R_CheckDeviceAvailable();

src/library/grDevices/src/cairo/cairoBM.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
3-
* Copyright (C) 1997--2023 R Core Team
3+
* Copyright (C) 1997--2025 R Core Team
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -95,7 +95,7 @@ typedef struct {
9595
double pointsize; /* Size in points */
9696
char basefontfamily[500]; /* Initial font family */
9797
char symbolfamily[500]; /* Symbol font family */
98-
Rboolean usePUA;
98+
bool usePUA;
9999

100100
int windowWidth; /* Window width (pixels) */
101101
int windowHeight; /* Window height (pixels) */
@@ -111,9 +111,9 @@ typedef struct {
111111
int res_dpi; /* used for png/jpeg */
112112
double fallback_dpi; /* used for ps/pdf */
113113
char title[101];
114-
Rboolean onefile;
114+
bool onefile;
115115

116-
Rboolean useCairo, buffered;
116+
bool useCairo, buffered;
117117
cairo_t *cc, *xcc;
118118
cairo_surface_t *cs, *xcs;
119119
cairo_antialias_t antialias;

0 commit comments

Comments
 (0)