Skip to content

Commit b6e350d

Browse files
author
ripley
committed
convert Callbacks.h to bool
git-svn-id: https://svn.r-project.org/R/trunk@87936 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent cee8f0c commit b6e350d

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

doc/NEWS.Rd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,10 @@
418418
\item Header \file{R_exts/Error.h} now ensures that
419419
\code{Rf_error} and similar are given a \code{noreturn}
420420
attribute when used from C++ under all compilers.
421+
422+
\item The functions in header \file{R_ext/Callbacks.h} (which is
423+
\strong{not} part of the API) have been converted to use the
424+
\code{bool} type.
421425
}
422426
}
423427

src/include/R_ext/Callbacks.h

Lines changed: 8 additions & 8 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) 2001-2020 The R Core Team.
3+
* Copyright (C) 2001-2025 The R Core Team.
44
*
55
* This header file is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
@@ -43,7 +43,7 @@
4343
visible - a logical value indicating whether the result was printed to the R ``console''/stdout.
4444
data - user-level data passed to the registration routine.
4545
*/
46-
typedef Rboolean (*R_ToplevelCallback)(SEXP expr, SEXP value, Rboolean succeeded, Rboolean visible, void *);
46+
typedef bool (*R_ToplevelCallback)(SEXP expr, SEXP value, bool succeeded, bool visible, void *);
4747

4848
typedef struct _ToplevelCallback R_ToplevelCallbackEl;
4949
/**
@@ -63,8 +63,8 @@ struct _ToplevelCallback {
6363
extern "C" {
6464
#endif
6565

66-
Rboolean Rf_removeTaskCallbackByIndex(int id);
67-
Rboolean Rf_removeTaskCallbackByName(const char *name);
66+
bool Rf_removeTaskCallbackByIndex(int id);
67+
bool Rf_removeTaskCallbackByName(const char *name);
6868
SEXP R_removeTaskCallback(SEXP which);
6969
R_ToplevelCallbackEl* Rf_addTaskCallback(R_ToplevelCallback cb, void *data, void (*finalizer)(void *), const char *name, int *pos);
7070

@@ -83,20 +83,20 @@ typedef struct _R_ObjectTable R_ObjectTable;
8383

8484
/* Do we actually need the exists() since it is never called but R
8585
uses get to see if the symbol is bound to anything? */
86-
typedef Rboolean (*Rdb_exists)(const char * const name, Rboolean *canCache, R_ObjectTable *);
87-
typedef SEXP (*Rdb_get)(const char * const name, Rboolean *canCache, R_ObjectTable *);
86+
typedef bool (*Rdb_exists)(const char * const name, bool *canCache, R_ObjectTable *);
87+
typedef SEXP (*Rdb_get)(const char * const name, bool *canCache, R_ObjectTable *);
8888
typedef int (*Rdb_remove)(const char * const name, R_ObjectTable *);
8989
typedef SEXP (*Rdb_assign)(const char * const name, SEXP value, R_ObjectTable *);
9090
typedef SEXP (*Rdb_objects)(R_ObjectTable *);
91-
typedef Rboolean (*Rdb_canCache)(const char * const name, R_ObjectTable *);
91+
typedef bool (*Rdb_canCache)(const char * const name, R_ObjectTable *);
9292

9393
typedef void (*Rdb_onDetach)(R_ObjectTable *);
9494
typedef void (*Rdb_onAttach)(R_ObjectTable *);
9595

9696
struct _R_ObjectTable{
9797
int type;
9898
char **cachedNames;
99-
Rboolean active;
99+
bool active;
100100

101101
Rdb_exists exists;
102102
Rdb_get get;

0 commit comments

Comments
 (0)