From 7b23aff7393ee3b0aec6099c7069a1c024ff28d3 Mon Sep 17 00:00:00 2001 From: Derrick Lyndon Pallas Date: Wed, 24 Aug 2022 11:37:00 -0700 Subject: [PATCH] header-builder: add cptr type for constant pointers For pointers to shared structures that the parser that will not modify, add cptr type. An example is the settings_t used in llhttp. --- src/compiler/header-builder.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/header-builder.ts b/src/compiler/header-builder.ts index 9f5bee7..86e62d0 100644 --- a/src/compiler/header-builder.ts +++ b/src/compiler/header-builder.ts @@ -55,6 +55,8 @@ export class HeaderBuilder { ty = 'uint64_t'; } else if (prop.ty === 'ptr') { ty = 'void*'; + } else if (prop.ty === 'cptr') { + ty = 'const void*'; } else { throw new Error( `Unknown state property type: "${prop.ty}"`);