diff options
| author | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-25 00:30:44 -0600 |
|---|---|---|
| committer | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-25 00:30:44 -0600 |
| commit | 5f92e02ff71be19067a422d324beb610cacd084d (patch) | |
| tree | 1af510b0e4b9e3de95b18f476a6ebff2f109c488 /src/ast.h | |
| parent | 7a7320b6a0d7dd6864b708b7e74fb5032a5bdf8e (diff) | |
| download | zash-chore/c23-nullptr-constexpr.tar.gz | |
C23: nullptr for null pointers, constexpr for typed constantschore/c23-nullptr-constexpr
nullptr in every place a null pointer constant was meant; NULL is gone
from src/.
constexpr where it improves on #define without costing anything: the
IGGCSI00 work-area offsets and sizes, and the scalar sizes MVS_DSN_MAX,
CSI_FIELD_LEN, CSI_WORK_MIN, PDS_DIRBLK, CSI_WORK, CSI_MAX_CALLS. A
constexpr in C is a constant expression, so it still bounds the arrays
that use it, and it now carries a type and can be checked with
static_assert. Feature switches (#if), the CSIETYPE/EBCDIC byte
constants read as octets, and the related-constant enum sets stay as
they were.
Diffstat (limited to 'src/ast.h')
| -rw-r--r-- | src/ast.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -38,7 +38,7 @@ typedef struct wpart { size_t len; } lit; param *param; - node *cmd; /**< P_CMDSUB; NULL for an empty $() */ + node *cmd; /**< P_CMDSUB; nullptr for an empty $() */ struct wpart *arith; /**< P_ARITH: the expression text */ } u; } wpart; @@ -216,7 +216,7 @@ typedef struct node { } bin; /**< N_AND, N_OR, N_SEQ */ struct node *body; /**< N_NOT, N_BG, N_SUBSHELL, N_GROUP */ struct { - struct node *body; /**< the pipeline, or NULL for none */ + struct node *body; /**< the pipeline, or nullptr for none */ bool posix; /**< `-p`: the POSIX output format */ } time; /**< N_TIME */ wpart *arith; /**< N_ARITH: one P_ARITH part */ |
