diff --git a/README.md b/README.md index 9ec45c6b4..5b6a4d0c7 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,22 @@ # x2py -Standalone extraction of the Fortran parser used for wrapper-oriented signature -extraction. +Wrapper-oriented parser and semantic-interface tooling for Fortran, with a +partial C parser frontend that is source-faithful and ready for later semantic +conversion work. [![Tests](https://github.com/PyNumLab/x2py/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/PyNumLab/x2py/actions/workflows/tests.yml) [![codecov](https://codecov.io/gh/PyNumLab/x2py/graph/badge.svg?token=QZRRCS5YO6)](https://codecov.io/gh/PyNumLab/x2py) -## What the parser handles +## What the parsers handle -The parser is intentionally a robust subset parser (not a full Fortran compiler -front-end). Current handled coverage: +The parsers are intentionally robust subset parsers, not full compiler +frontends. They preserve source facts needed for wrapper generation and defer +ABI, ownership, and wrappability policy to semantic stages. + +### Fortran parser + +Current handled coverage: - **Source forms** - Free-form: `.f90`, `.f95`, `.f03`, `.f08` @@ -44,19 +50,44 @@ front-end). Current handled coverage: - Unknown argument declaration reporting - Parse-stage unsupported construct reporting +### C parser + +The C frontend is currently parse-only. It supports: + +- Raw-source directive metadata for includes, simple macros, conditionals, and + pragmas. +- Compiler-assisted preprocessing through the shared CLI flags, with `#line` + and GCC/Clang linemarker remapping back to original source locations. +- Top-level variables, typedefs, function declarations/definitions, structs, + unions, enums, incomplete tags, flexible array member diagnostics, and + compatible top-level redeclaration merging. +- Pointer, array, function, and parenthesized declarator shapes, including + function pointer typedefs/parameters and parameter adjustment metadata. +- Project include/index facts through `parse_c_project(...)`. + +C semantic IR conversion, C `.pyi` generation, and C wrap-readiness are still +intentionally disabled until the C semantic layer is implemented. + ## Public APIs -Public API: +Public API entrypoints include: -- `parse_fortran_file(source_or_path, filename=None, macro_defines=None, encoding="utf-8") -> FortranFile` -- `parse_fortran_project(files, encoding="utf-8") -> FortranProject` -- `fortran_file_to_semantic_modules(parsed_file, standalone_module_name=None) -> list[SemanticModule]` -- `assess_semantic_wrap_readiness(semantic_ir, source=None) -> dict` -- `assess_pyi_wrap_readiness(path_or_paths, encoding="utf-8") -> dict` +- `x2py.parse_fortran_file(source_or_path, filename=None, macro_defines=None, encoding="utf-8") -> FortranFile` +- `x2py.parse_fortran_project(files, encoding="utf-8") -> FortranProject` +- `c_parser.parse_c_file(source_or_path, filename=None, macro_defines=None, include_dirs=None, preprocessing="raw", encoding="utf-8") -> CFile` +- `c_parser.parse_c_project(files, include_dirs=None, macro_defines=None, preprocessing="raw", encoding="utf-8") -> CProject` +- `x2py.fortran_file_to_semantic_modules(parsed_file, standalone_module_name=None) -> list[SemanticModule]` +- `x2py.assess_semantic_wrap_readiness(semantic_ir, source=None) -> dict` +- `x2py.assess_pyi_wrap_readiness(path_or_paths, encoding="utf-8") -> dict` +- `x2py.c_type_probe.probe_c_standard_types(config, runner=None) -> CStandardTypeProbeReport` +- `x2py.evaluate_fortran_type_requirements(config, requirements, runner=None) -> dict[str, int]` ## Repository layout -Fortran source inputs live under `tests/data/fortran`. Stage-specific tests and expected fixtures live under `tests/parser`, `tests/semantics`, and `tests/pyi`. +Fortran source inputs live under `tests/data/fortran`. C parser fixtures live +under `tests/data/c` and C parser tests live under `tests/parser/c`. +Stage-specific tests and expected fixtures live under `tests/parser`, +`tests/semantics`, and `tests/pyi`. The editable wrapper `.pyi` format is documented in [`docs/pyi_format.md`](docs/pyi_format.md). @@ -70,6 +101,9 @@ The editable wrapper `.pyi` format is documented in - `--pyi` for generated Python stub text - `--wrap-readiness` for semantic wrap-readiness from either Fortran or `.pyi` +Fortran is the default frontend. Use `--language c --parse` for C parser output. +C semantics, C `.pyi`, and C wrap-readiness currently return explicit errors. + For parse output, `--show-vars` expands scope-level variables that are normally summarized as `vars=N`. Use `--print-limit N` to keep large repeated sections readable. @@ -87,7 +121,113 @@ x2py --parse ``` `` can be one or more files and/or directories. Directories are -scanned recursively for: `.f`, `.for`, `.ftn`, `.f90`, `.f95`, `.f03`, `.f08`. +scanned recursively for Fortran suffixes by default: `.f`, `.for`, `.ftn`, +`.f90`, `.f95`, `.f03`, `.f08`. In explicit C mode, directories scan `.c` and +`.h` files. + +### Compiler preprocessing and target probes + +The shared compiler mode is: + +```bash +python -m x2py path/to/source --parse \ + --preprocess compiler \ + --compiler /path/to/compiler \ + -I include \ + -D FEATURE=1 \ + -U DEBUG \ + --std f2008 \ + --compiler-arg=-fdefault-real-8 +``` + +For C, `--language c --preprocess compiler` runs the exact compiler +preprocessor and parses stdout. C also supports `--compile-commands +build/compile_commands.json`; the matching entry supplies the compiler and +project flags. + +Target-dependent type facts are not hard-coded. They are probed with the same +compiler path and target-relevant flags because results may change with ABI, +architecture, library headers, and compiler options. + +C standard-header facts: + +```bash +python -m x2py.c_type_probe --compiler /usr/bin/gcc-13 \ + -I include \ + -D FEATURE=1 \ + -U DEBUG \ + --std c11 \ + --compiler-arg=--sysroot=/opt/sdk +``` + +The C probe passes `-I`, `-D`, `-U`, and `--compiler-arg` into the generated +probe and records the requested `--std`. The generated probe itself is compiled +as C11 because it uses C11 `_Generic` and `_Alignof`; if a standard-selection +flag affects the target ABI or headers, pass a compatible override through +`--compiler-arg`. The probe does not consume `compile_commands.json` directly; +when the parser uses a compile database, pass the selected compiler and +target-relevant flags from that entry to the probe explicitly. + +Fortran kind/compile-time facts: + +```bash +python -m x2py.fortran_type_probe --compiler /usr/bin/gfortran-12 \ + --expr 'selected_real_kind(12)' \ + --expr 'selected_int_kind(9)' \ + --std f2008 \ + --compiler-arg=-fdefault-real-8 +``` + +The Fortran probe passes `-I`, `-D`, `-U`, `--std`, and `--compiler-arg` to the +generated probe. The semantic CLI path uses this automatically when Fortran +input is converted with `--preprocess compiler --compiler ...`: it collects +unresolved compiler-dependent values, evaluates them with the probe, and feeds +the resulting `compile_time_values` into semantic conversion. + +By default the probes execute the generated binary on the host. For cross +targets, provide a compatible runner/emulator or supply a target profile; host +execution only describes the host target. + +### C parser examples + +Parse a C header in raw mode: + +```bash +python -m x2py include/api.h --language c --parse +``` + +Print C parser JSON: + +```bash +python -m x2py include/api.h --language c --parse --json +``` + +Parse a macro-shaped API through the configured compiler preprocessor: + +```bash +python -m x2py include/api.h --language c --parse \ + --preprocess compiler \ + --compiler clang-18 \ + -I include \ + -D API_EXPORT= +``` + +Parse a C source using a compile database entry: + +```bash +python -m x2py src/api.c --language c --parse \ + --preprocess compiler \ + --compile-commands build/compile_commands.json +``` + +Current C parser output is parse-only. These stages remain intentionally +disabled until C semantic conversion exists: + +```bash +python -m x2py include/api.h --language c --semantics +python -m x2py include/api.h --language c --pyi +python -m x2py include/api.h --language c --wrap-readiness +``` ### Example 1: human-readable output @@ -466,6 +606,24 @@ The edited `.pyi` is the source of truth for readiness. It can declare derived types with `class` stubs, literal compile-time constants with `Final[...] = value`, and callback signatures with `Callable[[...], ...]`. +### Example 3: parse C from Python + +```python +from c_parser import parse_c_file, parse_c_project + +header = parse_c_file("include/api.h") +print("functions:", [fn.name for fn in header.functions]) +print("typedefs:", [typedef.name for typedef in header.typedefs]) + +project = parse_c_project(["src/api.c", "include/api.h"], include_dirs=["include"]) +print("include graph:", project.include_graph) +print("header/source pairs:", project.header_source_pairs) +``` + +The C Python API is intentionally imported from `c_parser` while the C frontend +stabilizes. C semantic conversion will be added through the semantic layer in a +future phase. + ## Running tests From repository root: @@ -552,8 +710,11 @@ the signature while still being valid scoped references for readiness checks. The semantics layer consumes `FortranFile`/`FortranModule` objects and projects them into language-independent semantic IR (`SemanticModule`, `SemanticFunction`, `SemanticClass`, `SemanticType`). This keeps the semantic API model independent from parser internals, matching the project goal that parser output is a helper and the semantic interface/IR is the source of truth. For compiler-specific constants, use `collect_semantic_compile_time_requirements(parsed)` to extract unresolved -values and pass a dictionary to semantic conversion via -`compile_time_values`. +values. With a configured Fortran compiler, pass those requirements to +`evaluate_fortran_type_requirements(config, requirements)` and provide the +returned dictionary to semantic conversion via `compile_time_values`. The CLI +does this automatically for Fortran semantic stages when `--preprocess +compiler --compiler ...` is active. For Fortran `use` imports, the parser stores each explicit imported symbol as a source/target mapping. A non-renamed `use iso_c_binding, only: c_int` maps diff --git a/c_parser/cli.py b/c_parser/cli.py index 4797bbdf7..c1ebc291f 100644 --- a/c_parser/cli.py +++ b/c_parser/cli.py @@ -3,13 +3,15 @@ import argparse import json +from collections.abc import Callable, Sequence from pathlib import Path +from typing import Any from .models import CFile, c_model_to_dict from .parser import CParser -_C_SOURCE_SUFFIXES = {".c", ".h"} +_C_SOURCE_SUFFIXES = {".c", ".h", ".i"} def _collect_c_extensions(path: Path) -> list[Path]: @@ -31,11 +33,33 @@ def expand_c_paths(paths: list[str]) -> list[Path]: return sorted(set(expanded)) -def parse_c_report(paths: list[str]) -> dict[str, dict]: +def parse_c_report( + paths: list[str], + *, + include_dirs: Sequence[str | Path] | None = None, + preprocessing: str = "raw", + source_loader: Callable[[Path], str | tuple[str, dict[str, Any] | None]] | None = None, +) -> dict[str, dict]: out: dict[str, dict] = {} parser = CParser() for p in expand_c_paths(paths): - parsed = parser.visit_file(p, filename=str(p)) + if source_loader is None: + parsed = parser.visit_file( + p, + filename=str(p), + include_dirs=include_dirs, + preprocessing=preprocessing, + ) + else: + loaded = source_loader(p) + source, preprocessing_recipe = loaded if isinstance(loaded, tuple) else (loaded, None) + parsed = parser.visit_file( + source, + filename=str(p), + include_dirs=include_dirs, + preprocessing=preprocessing, + ) + parsed.preprocessing_recipe = preprocessing_recipe out[str(p)] = c_model_to_dict(parsed) return out diff --git a/c_parser/lexer.py b/c_parser/lexer.py index 89882a771..0523418ee 100644 --- a/c_parser/lexer.py +++ b/c_parser/lexer.py @@ -2,6 +2,7 @@ from __future__ import annotations from dataclasses import dataclass, field +import re @dataclass(frozen=True) @@ -35,6 +36,15 @@ class CToken: source_line: str | None = None +@dataclass(frozen=True) +class CLineMapping: + """Mapping from one preprocessed physical line to its original source line.""" + + filename: str | None + line: int + source_line: str | None = None + + @dataclass(frozen=True) class CTopLevelSegment: """A top-level C declaration or function-definition header.""" @@ -49,6 +59,8 @@ class CTopLevelSegment: original_source_line: str | None = None original_end_source_line: str | None = None original_source_lines: tuple[str, ...] = field(default_factory=tuple) + original_filenames: tuple[str | None, ...] = field(default_factory=tuple) + original_line_numbers: tuple[int, ...] = field(default_factory=tuple) _TWO_CHAR_OPERATORS = { @@ -75,6 +87,12 @@ class CTopLevelSegment: _BRACKET_PAIRS = {"(": ")", "[": "]", "{": "}"} _BRACKET_CLOSERS = {")": "(", "]": "[", "}": "{"} +_GCC_LINEMARKER_RE = re.compile( + r'^\s*#\s+(?P\d+)\s+(?:"(?P(?:[^"\\]|\\.)*)"|(?P\S+))' +) +_LINE_DIRECTIVE_RE = re.compile( + r'^\s*#\s*line\s+(?P\d+)(?:\s+(?:"(?P(?:[^"\\]|\\.)*)"|(?P\S+)))?' +) def _source_line(lines: list[str], line_number: int) -> str | None: @@ -87,6 +105,124 @@ def _source_lines(lines: list[str], start_line: int, end_line: int) -> tuple[str return tuple(lines[start_line - 1 : end_line]) +def _unescape_linemarker_filename(text: str) -> str: + """Unescape the filename fragment from a compiler linemarker.""" + result: list[str] = [] + escaped = False + for char in text: + if escaped: + result.append( + { + "n": "\n", + "r": "\r", + "t": "\t", + "\\": "\\", + '"': '"', + }.get(char, char) + ) + escaped = False + elif char == "\\": + escaped = True + else: + result.append(char) + if escaped: + result.append("\\") + return "".join(result) + + +def _parse_linemarker(line: str) -> tuple[int, str | None] | None: + """Parse GCC/Clang `# N "file"` and standard `#line N "file"` markers.""" + stripped = line.strip() + match = _LINE_DIRECTIVE_RE.match(stripped) + if match is None: + match = _GCC_LINEMARKER_RE.match(stripped) + if match is None: + return None + + line_number = int(match.group("line")) + filename = match.group("quoted") or match.group("bare") + if filename is not None: + filename = _unescape_linemarker_filename(filename) + return line_number, filename + + +def line_mappings_for_source( + source: str, + filename: str | None = None, + *, + use_linemarkers: bool = False, +) -> list[CLineMapping]: + """Return one original-source mapping per physical source line. + + In ordinary raw mode each physical line maps to itself. In preprocessed + mode, compiler linemarkers describe the original file and line for the + next physical line. Linemarker lines themselves are mapped defensively but + are normally blanked before parsing. + """ + mappings: list[CLineMapping] = [] + current_filename = filename + current_line = 1 + + for physical_line, source_line in enumerate(source.splitlines(), start=1): + marker = _parse_linemarker(source_line) if use_linemarkers else None + if marker is not None: + marker_line, marker_filename = marker + if marker_filename is not None: + current_filename = marker_filename + current_line = marker_line + mappings.append(CLineMapping(current_filename, current_line, source_line)) + continue + + if use_linemarkers: + mappings.append(CLineMapping(current_filename, current_line, source_line)) + current_line += 1 + else: + mappings.append(CLineMapping(filename, physical_line, source_line)) + + return mappings + + +def _line_mapping( + mappings: list[CLineMapping], + physical_line: int, + default_filename: str | None, +) -> CLineMapping: + """Return the mapping for `physical_line` with safe fallback defaults.""" + if 1 <= physical_line <= len(mappings): + return mappings[physical_line - 1] + return CLineMapping(default_filename, physical_line, None) + + +def _mapped_source_lines( + mappings: list[CLineMapping], + start_line: int, + end_line: int, +) -> tuple[str, ...]: + """Return source-line text for a physical line range.""" + return tuple( + mapping.source_line or "" + for mapping in mappings[start_line - 1 : end_line] + ) + + +def _mapped_filenames( + mappings: list[CLineMapping], + start_line: int, + end_line: int, +) -> tuple[str | None, ...]: + """Return mapped filenames for a physical line range.""" + return tuple(mapping.filename for mapping in mappings[start_line - 1 : end_line]) + + +def _mapped_line_numbers( + mappings: list[CLineMapping], + start_line: int, + end_line: int, +) -> tuple[int, ...]: + """Return mapped line numbers for a physical line range.""" + return tuple(mapping.line for mapping in mappings[start_line - 1 : end_line]) + + def _advance_position(char: str, line: int, column: int) -> tuple[int, int]: if char == "\n": return line + 1, 1 @@ -190,18 +326,28 @@ def _is_aggregate_definition_header(header: str) -> bool: return any(word in {"struct", "union", "enum"} for word in words) +def _is_braced_declaration_header(header: str) -> bool: + """Return whether a brace belongs to a declaration preserved through `;`.""" + return _is_aggregate_definition_header(header) or top_level_partition(header, "=")[1] is not None + + def split_top_level_c_source( source: str, filename: str | None = None, *, skip_preprocessor: bool = True, + use_linemarkers: bool = False, ) -> list[CTopLevelSegment]: """Split C source into top-level declarations and definition headers.""" stripped = strip_c_comments(source) if skip_preprocessor: stripped = _blank_preprocessor_directives(stripped) - source_lines = source.splitlines() + line_mappings = line_mappings_for_source( + source, + filename=filename, + use_linemarkers=use_linemarkers, + ) segments: list[CTopLevelSegment] = [] start_index: int | None = None start_line = 1 @@ -219,7 +365,7 @@ def split_top_level_c_source( block_start_line = 1 block_start_column = 1 block_source_line: str | None = None - aggregate_block = False + braced_declaration = False while i < len(stripped): char = stripped[i] @@ -269,31 +415,36 @@ def split_top_level_c_source( if start_index is not None: header = stripped[start_index:i].strip() if header: + start_mapping = _line_mapping(line_mappings, start_line, filename) block_header = header block_start_line = start_line block_start_column = start_column - block_source_line = _source_line(source_lines, start_line) - aggregate_block = _is_aggregate_definition_header(header) + block_source_line = start_mapping.source_line + braced_declaration = _is_braced_declaration_header(header) brace_depth = 1 - if not aggregate_block: + if not braced_declaration: start_index = None elif char == "{" and brace_depth: brace_depth += 1 elif char == "}" and brace_depth: brace_depth -= 1 - if brace_depth == 0 and block_header and not aggregate_block: + if brace_depth == 0 and block_header and not braced_declaration: + start_mapping = _line_mapping(line_mappings, block_start_line, filename) + end_mapping = _line_mapping(line_mappings, line, filename) segments.append( CTopLevelSegment( text=block_header, terminator="block", - filename=filename, - original_start_line=block_start_line, - original_end_line=line, + filename=start_mapping.filename, + original_start_line=start_mapping.line, + original_end_line=end_mapping.line, original_start_column=block_start_column, original_end_column=column, original_source_line=block_source_line, - original_end_source_line=_source_line(source_lines, line), - original_source_lines=_source_lines(source_lines, block_start_line, line), + original_end_source_line=end_mapping.source_line, + original_source_lines=_mapped_source_lines(line_mappings, block_start_line, line), + original_filenames=_mapped_filenames(line_mappings, block_start_line, line), + original_line_numbers=_mapped_line_numbers(line_mappings, block_start_line, line), ) ) block_header = None @@ -307,24 +458,28 @@ def split_top_level_c_source( ): text = stripped[start_index:i].strip() if text: + start_mapping = _line_mapping(line_mappings, start_line, filename) + end_mapping = _line_mapping(line_mappings, line, filename) segments.append( CTopLevelSegment( text=text, terminator=";", - filename=filename, - original_start_line=start_line, - original_end_line=line, + filename=start_mapping.filename, + original_start_line=start_mapping.line, + original_end_line=end_mapping.line, original_start_column=start_column, original_end_column=column, - original_source_line=_source_line(source_lines, start_line), - original_end_source_line=_source_line(source_lines, line), - original_source_lines=_source_lines(source_lines, start_line, line), + original_source_line=start_mapping.source_line, + original_end_source_line=end_mapping.source_line, + original_source_lines=_mapped_source_lines(line_mappings, start_line, line), + original_filenames=_mapped_filenames(line_mappings, start_line, line), + original_line_numbers=_mapped_line_numbers(line_mappings, start_line, line), ) ) start_index = None block_header = None block_source_line = None - aggregate_block = False + braced_declaration = False line, column = _advance_position(char, line, column) i += 1 @@ -332,18 +487,22 @@ def split_top_level_c_source( if start_index is not None and brace_depth == 0: text = stripped[start_index:].strip() if text: + start_mapping = _line_mapping(line_mappings, start_line, filename) + end_mapping = _line_mapping(line_mappings, line, filename) segments.append( CTopLevelSegment( text=text, terminator="eof", - filename=filename, - original_start_line=start_line, - original_end_line=line, + filename=start_mapping.filename, + original_start_line=start_mapping.line, + original_end_line=end_mapping.line, original_start_column=start_column, original_end_column=column, - original_source_line=_source_line(source_lines, start_line), - original_end_source_line=_source_line(source_lines, line), - original_source_lines=_source_lines(source_lines, start_line, line), + original_source_line=start_mapping.source_line, + original_end_source_line=end_mapping.source_line, + original_source_lines=_mapped_source_lines(line_mappings, start_line, line), + original_filenames=_mapped_filenames(line_mappings, start_line, line), + original_line_numbers=_mapped_line_numbers(line_mappings, start_line, line), ) ) @@ -579,9 +738,11 @@ def lex_c_source(source: str, filename: str | None = None) -> list[CToken]: __all__ = ( "CLogicalRecord", + "CLineMapping", "CToken", "CTopLevelSegment", "NormalizedCSource", + "line_mappings_for_source", "lex_c_source", "normalize_c_source", "split_top_level_c_source", diff --git a/c_parser/models.py b/c_parser/models.py index 4a553c81d..bb35e5532 100644 --- a/c_parser/models.py +++ b/c_parser/models.py @@ -58,10 +58,32 @@ def c_model_to_dict(obj: Any, _seen: set[int] | None = None) -> Any: if isinstance(obj, (CStruct, CUnion, CEnum, CTypedef)): _seen.add(id(obj)) payload = {"model": type(obj).__name__} - payload.update({f.name: c_model_to_dict(getattr(obj, f.name), _seen) for f in fields(obj)}) + payload.update( + { + f.name: c_model_to_dict(getattr(obj, f.name), _seen) + for f in fields(obj) + if not (f.name == "origin" and getattr(obj, f.name) is None) + } + ) return payload if is_dataclass(obj): - return {f.name: c_model_to_dict(getattr(obj, f.name), _seen) for f in fields(obj)} + return { + f.name: c_model_to_dict(getattr(obj, f.name), _seen) + for f in fields(obj) + if not ( + (f.name == "origin" and getattr(obj, f.name) is None) + or ( + isinstance(obj, CFile) + and f.name in {"preprocessing_recipe", "preprocessed_source_path"} + and getattr(obj, f.name) is None + ) + or ( + isinstance(obj, CFile) + and f.name == "original_source_paths" + and not getattr(obj, f.name) + ) + ) + } if isinstance(obj, list): return [c_model_to_dict(v, _seen) for v in obj] if isinstance(obj, dict): @@ -348,6 +370,7 @@ class CParameter: declared_type: CType | None = None source_location: CSourceLocation | None = None callback_policy: Any = None + origin: str | None = None @property def callback_candidate(self) -> bool: @@ -368,6 +391,7 @@ class CFunction: start: CSourceLocation | None = None end: CSourceLocation | None = None declaration_locations: list[CSourceLocation] = field(default_factory=list) + origin: str | None = None @property def type(self) -> CFunctionType: @@ -386,6 +410,7 @@ class CStruct(CType): anonymous_id: str | None = None is_incomplete: bool = False source_location: CSourceLocation | None = None + origin: str | None = None @property def reference_name(self) -> str: @@ -399,6 +424,7 @@ class CUnion(CType): anonymous_id: str | None = None is_incomplete: bool = False source_location: CSourceLocation | None = None + origin: str | None = None @property def reference_name(self) -> str: @@ -410,6 +436,7 @@ class CEnumerator: name: str value: str | None = None source_location: CSourceLocation | None = None + origin: str | None = None @dataclass @@ -418,6 +445,7 @@ class CEnum(CType): constants: list[CEnumerator] = field(default_factory=list) anonymous_id: str | None = None source_location: CSourceLocation | None = None + origin: str | None = None @property def reference_name(self) -> str: @@ -430,6 +458,7 @@ class CTypedef(CType): type: CType | None = None source_location: CSourceLocation | None = None declaration_locations: list[CSourceLocation] = field(default_factory=list) + origin: str | None = None @property def reference_name(self) -> str: @@ -451,6 +480,7 @@ class CVariable: source_location: CSourceLocation | None = None callback_policy: Any = None declaration_locations: list[CSourceLocation] = field(default_factory=list) + origin: str | None = None @property def callback_candidate(self) -> bool: @@ -495,6 +525,9 @@ class CFile: language: str = "c" parser_status: str = "partial" preprocessing: str = "raw" + preprocessing_recipe: dict[str, Any] | None = None + preprocessed_source_path: str | None = None + original_source_paths: list[str] = field(default_factory=list) functions: list[CFunction] = field(default_factory=list) structs: list[CStruct] = field(default_factory=list) unions: list[CUnion] = field(default_factory=list) diff --git a/c_parser/parser.py b/c_parser/parser.py index 48056899a..8234e562b 100644 --- a/c_parser/parser.py +++ b/c_parser/parser.py @@ -1,4 +1,42 @@ # -*- coding: utf-8 -*- +"""Partial C parser for wrapper-oriented declaration extraction. + +Parsing sketch +============== + +The public wrappers call the same orchestration object: + + parse_c_file(...) -> CParser.visit_file(...) -> CFile + parse_c_project(...) -> CParser.visit_project(...) -> CProject + +One source file follows this path: + + source text/path + -> raw directive metadata, or compiler/preprocessed line mappings + -> split_top_level_c_source(...) -> CTopLevelSegment objects + -> _parse_translation_unit(...) + -> _parse_tag_definition(...) -> _parse_fields(...) + -> _parse_function(...) + -> _parse_declaration(...) + -> _normalize_redeclarations(...) + -> typed CFile declarations and diagnostics + +Declarations share one type-construction path. For example: + + const int *values[4] + -> _split_declaration_specifiers: ("const int", "*values[4]") + -> _parse_specifiers: CInt qualified with CConst + -> _parse_declarator: name "values", array and pointer operations + -> _apply_declarator_operations: CArray -> CPointer -> CInt + +This is why typedefs, variables, function parameters, and aggregate members +obtain types with the same declarator rules. Raw preprocessing records macro +dependencies without expanding them; compiler/preprocessed input is parsed by +the same route after linemarkers are mapped back to original source locations. + +Executable walkthroughs live in +``tests/parser/c/test_c_parser_developer_tutorial.py``. +""" from __future__ import annotations from dataclasses import dataclass @@ -8,6 +46,7 @@ from .lexer import ( CTopLevelSegment, + line_mappings_for_source, split_top_level_c_source, strip_c_comments, top_level_partition, @@ -63,8 +102,7 @@ from .preprocessor import collect_preprocessor_metadata from .type_resolver import resolve_project_types - -_C_SOURCE_SUFFIXES = {".c", ".h"} +_C_SOURCE_SUFFIXES = {".c", ".h", ".i"} _IDENTIFIER_RE = re.compile(r"[A-Za-z_]\w*") _STORAGE_CLASSES = {"typedef", "extern", "static", "register", "_Thread_local"} _TYPE_QUALIFIERS = {"const", "restrict", "volatile", "_Atomic"} @@ -76,7 +114,6 @@ "[[", "_Alignas", "alignas", - "_Atomic(", ) _CXX_DECLARATION_KEYWORDS = {"using", "namespace", "template", "class"} _CXX_ACCESS_SPECIFIERS = {"public", "private", "protected"} @@ -144,11 +181,15 @@ @dataclass class _PointerOp: + """Declarator operation representing one pointer layer.""" + qualifiers: list[str] @dataclass class _ArrayOp: + """Declarator operation representing one array suffix.""" + size: str | None = None static: bool = False qualifiers: list[str] | None = None @@ -157,6 +198,8 @@ class _ArrayOp: @dataclass class _FunctionOp: + """Declarator operation representing one function suffix.""" + parameters: list[CParameter] variadic: bool = False prototype_style: str | None = None @@ -164,20 +207,27 @@ class _FunctionOp: @dataclass class _ParsedDeclarator: + """Name plus type-construction operations parsed from a declarator.""" + name: str | None operations: list[_PointerOp | _ArrayOp | _FunctionOp] source_text: str = "" class _UnsupportedDeclaratorSyntax(ValueError): + """Raised internally when a declarator has unconsumed syntax.""" + pass class _InvalidSpecifierSequence(ValueError): + """Raised internally when declaration specifiers are not valid C.""" + pass def _looks_like_existing_source_path(value: object) -> bool: + """Return whether `value` can safely be treated as an existing source path.""" if isinstance(value, Path): return value.is_file() if not isinstance(value, str) or not value or "\n" in value: @@ -189,6 +239,7 @@ def _looks_like_existing_source_path(value: object) -> bool: def _collect_c_paths(path: Path) -> list[Path]: + """Collect C source/header files below a directory in stable order.""" return sorted( p for p in path.rglob("*") @@ -197,10 +248,12 @@ def _collect_c_paths(path: Path) -> list[Path]: def _posix_key(path: str | Path | PurePosixPath) -> str: + """Normalize a filesystem-ish path to the project JSON key spelling.""" return PurePosixPath(str(path)).as_posix() def _include_key_from_current(current_key: str, target: str) -> str: + """Resolve an include target key relative to the current file key.""" current_parent = PurePosixPath(current_key).parent if str(current_parent) == ".": return _posix_key(target) @@ -208,14 +261,17 @@ def _include_key_from_current(current_key: str, target: str) -> str: def _is_header_key(key: str) -> bool: + """Return whether a project key names a C header.""" return PurePosixPath(key).suffix.lower() == ".h" def _is_source_key(key: str) -> bool: + """Return whether a project key names a C source file.""" return PurePosixPath(key).suffix.lower() == ".c" def _looks_like_cxx_declaration(text: str) -> bool: + """Detect obvious C++ declarations so they become explicit diagnostics.""" stripped = text.lstrip() identifier = _IDENTIFIER_RE.match(stripped) if identifier is None: @@ -230,31 +286,284 @@ def _looks_like_cxx_declaration(text: str) -> bool: class CParser: - """C parser entrypoint for the currently implemented C subset. + """Parser orchestration object for the partial typed C model. - The implemented subset covers raw preprocessing metadata, recursive - declarators, aggregate declarations, typedefs, and function signatures. + The instance carries no parse stack; per-call input and preprocessing + configuration flow explicitly through `visit_file` and `visit_project`. + See the module sketch and developer tutorial tests for the helper path. """ + # ------------------------------------------------------------------ + # Public visitor entrypoints + # ------------------------------------------------------------------ + + def visit_file( + self, + source_or_path: str | Path, + filename: str | None = None, + *, + macro_defines: set[str] | dict[str, int | bool | str] | None = None, + include_dirs: Sequence[str | Path] | None = None, + preprocessing: str = "raw", + encoding: str = "utf-8", + ) -> CFile: + """Parse one source string/path into a `CFile` parser model. + + The current implementation supports raw preprocessing metadata, + compiler-fed preprocessed text, and the partial grammar subset + documented in `docs/c_parser`. `macro_defines` is accepted for API + compatibility with compiler-assisted preprocessing, but raw mode does + not evaluate conditional branches. + """ + del macro_defines + source_path: Path | None = None + if _looks_like_existing_source_path(source_or_path): + path = Path(source_or_path) + source_path = path + if filename is None: + filename = str(path) + source = path.read_text(encoding=encoding) + else: + source = str(source_or_path) + + inferred_preprocessed_path = ( + filename + if filename is not None and PurePosixPath(filename).suffix.lower() == ".i" + else None + ) + if preprocessing == "raw" and inferred_preprocessed_path is not None: + preprocessing = "preprocessed" + + parsed = CFile(filename=filename, parser_status="partial", preprocessing=preprocessing) + if preprocessing == "raw": + effective_include_dirs = list(include_dirs or ()) + if source_path is not None: + effective_include_dirs.insert(0, source_path.parent) + metadata = collect_preprocessor_metadata( + source, + filename=filename, + include_dirs=effective_include_dirs, + ) + parsed.includes = metadata.includes + parsed.macros = metadata.macros + parsed.raw_directives = metadata.raw_directives + function_like_macro_names = {macro.name for macro in metadata.macros if macro.function_like} + object_like_macro_names = { + macro.name + for macro in metadata.macros + if macro.directive == "define" and not macro.function_like + } + parsed.macro_dependencies = self._macro_dependencies( + source, + filename, + function_like_macro_names, + object_like_macro_names, + ) + parsed.diagnostics = metadata.diagnostics + functions, structs, unions, enums, typedefs, variables, parser_diagnostics = self._parse_translation_unit( + source, + filename, + function_like_macros=function_like_macro_names, + object_like_macros=object_like_macro_names, + ) + parsed.functions = functions + parsed.structs = structs + parsed.unions = unions + parsed.enums = enums + parsed.typedefs = typedefs + parsed.variables = variables + parsed.diagnostics.extend(parser_diagnostics) + self._normalize_redeclarations(parsed) + elif preprocessing in {"compiler", "preprocessed"}: + parsed.preprocessed_source_path = inferred_preprocessed_path + functions, structs, unions, enums, typedefs, variables, parser_diagnostics = self._parse_translation_unit( + source, + filename, + use_linemarkers=True, + ) + parsed.functions = functions + parsed.structs = structs + parsed.unions = unions + parsed.enums = enums + parsed.typedefs = typedefs + parsed.variables = variables + parsed.diagnostics.extend(parser_diagnostics) + self._normalize_redeclarations(parsed) + self._mark_preprocessed_declarations(parsed) + parsed.original_source_paths = self._original_source_paths( + source, + filename, + preprocessed_source_path=parsed.preprocessed_source_path, + ) + else: + raise ValueError( + "C preprocessing mode must be 'raw', 'compiler', or 'preprocessed'." + ) + return parsed + + def visit_project( + self, + files: Mapping[str, str] | Sequence[str | Path] | str | Path, + *, + include_dirs: Sequence[str | Path] | None = None, + macro_defines: set[str] | dict[str, int | bool | str] | None = None, + preprocessing: str = "raw", + encoding: str = "utf-8", + ) -> CProject: + """Parse a mapping, file list, single file, or directory into a `CProject`.""" + if isinstance(files, Mapping): + parsed_files = { + name: self.visit_file( + source, + filename=name, + include_dirs=include_dirs, + macro_defines=macro_defines, + preprocessing=preprocessing, + encoding=encoding, + ) + for name, source in files.items() + } + return self._build_project(parsed_files) + + paths: list[Path] = [] + root: Path | None = None + if isinstance(files, (str, Path)): + path = Path(files) + if path.is_dir(): + root = path + paths = _collect_c_paths(path) + else: + paths = [path] + else: + paths = [Path(p) for p in files] + + parsed_files: dict[str, CFile] = {} + for path in sorted(paths): + key = path.name if root is not None else str(path) + if root is not None: + key = str(path.relative_to(root)) + parsed_files[key] = self.visit_file( + path, + filename=key, + include_dirs=include_dirs, + macro_defines=macro_defines, + preprocessing=preprocessing, + encoding=encoding, + ) + return self._build_project(parsed_files) + + # ------------------------------------------------------------------ + # Source locations, diagnostics, and macro provenance + # ------------------------------------------------------------------ + + @staticmethod + def _mark_preprocessed_declarations(parsed: CFile) -> None: + """Mark declarations extracted from an externally preprocessed stream.""" + seen_types: set[int] = set() + + def mark_type(type_: CType | None) -> None: + if type_ is None: + return + if isinstance(type_, CComposedType): + for component in type_.components: + mark_type(component) + return + if isinstance(type_, CFunctionType): + mark_type(type_.result_type) + for parameter_type in type_.parameter_types: + mark_type(parameter_type) + return + if isinstance(type_, (CStruct, CUnion)): + if id(type_) in seen_types: + return + seen_types.add(id(type_)) + type_.origin = "preprocessed" + for member in type_.members: + mark_variable(member) + return + if isinstance(type_, CEnum): + if id(type_) in seen_types: + return + seen_types.add(id(type_)) + type_.origin = "preprocessed" + for constant in type_.constants: + constant.origin = "preprocessed" + return + if isinstance(type_, CTypedef): + if id(type_) in seen_types: + return + seen_types.add(id(type_)) + type_.origin = "preprocessed" + mark_type(type_.type) + + def mark_variable(variable: CVariable) -> None: + variable.origin = "preprocessed" + mark_type(variable.type) + + for function in parsed.functions: + function.origin = "preprocessed" + mark_type(function.result_type) + for parameter in function.parameters: + parameter.origin = "preprocessed" + mark_type(parameter.type) + mark_type(parameter.declared_type) + for aggregate in [*parsed.structs, *parsed.unions]: + mark_type(aggregate) + for enum in parsed.enums: + mark_type(enum) + for typedef in parsed.typedefs: + typedef.origin = "preprocessed" + mark_type(typedef.type) + for variable in parsed.variables: + mark_variable(variable) + + @staticmethod + def _original_source_paths( + source: str, + filename: str | None, + *, + preprocessed_source_path: str | None, + ) -> list[str]: + """Collect non-generated source identities referenced by linemarkers.""" + paths: list[str] = [] + for mapping in line_mappings_for_source(source, filename=filename, use_linemarkers=True): + path = mapping.filename + if ( + path is None + or path == preprocessed_source_path + or (path.startswith("<") and path.endswith(">")) + or path in paths + ): + continue + paths.append(path) + return paths + def _source_location_at(self, segment: CTopLevelSegment, offset: int) -> CSourceLocation: + """Return the original source location for `offset` inside a segment.""" prefix = segment.text[:offset] line_offset = prefix.count("\n") line = segment.original_start_line + line_offset + filename = segment.filename if line_offset: column = len(prefix.rsplit("\n", 1)[-1]) + 1 else: column = segment.original_start_column + len(prefix) source_line = segment.original_source_line + if line_offset < len(segment.original_line_numbers): + line = segment.original_line_numbers[line_offset] + if line_offset < len(segment.original_filenames): + filename = segment.original_filenames[line_offset] if line_offset and line_offset < len(segment.original_source_lines): source_line = segment.original_source_lines[line_offset] return CSourceLocation( - filename=segment.filename, + filename=filename, line=line, column=column, source_line=source_line, ) def _source_location(self, segment: CTopLevelSegment) -> CSourceLocation: + """Return the original start location for a top-level segment.""" return self._source_location_at(segment, 0) def _macro_dependencies( @@ -264,6 +573,7 @@ def _macro_dependencies( function_like_macro_names: set[str], object_like_macro_names: set[str] | None = None, ) -> list[CMacroDependency]: + """Collect top-level declaration dependencies on known macro names.""" dependencies: list[CMacroDependency] = [] if not function_like_macro_names and not object_like_macro_names: return dependencies @@ -284,6 +594,7 @@ def _segment_macro_dependency( function_like_macro_names: set[str], object_like_macro_names: set[str] | None = None, ) -> CMacroDependency | None: + """Return the first macro dependency that blocks parsing this segment.""" text = segment.text.strip() if not text: return None @@ -319,6 +630,7 @@ def _macro_dependent_declaration_diagnostic( *, function_like: bool, ) -> CDiagnostic: + """Build a warning for a declaration that requires macro expansion.""" macro_kind = "function-like" if function_like else "object-like" return CDiagnostic( code="C_MACRO_DEPENDENT_DECLARATION", @@ -333,6 +645,7 @@ def _macro_dependent_declaration_diagnostic( ) def _has_unsupported_declaration_marker(self, text: str) -> bool: + """Return whether `text` contains a known unsupported declaration marker.""" return any(marker in text for marker in _UNSUPPORTED_DECLARATION_MARKERS) def _redeclaration_diagnostic( @@ -343,6 +656,7 @@ def _redeclaration_diagnostic( unit_kind: str, unit_name: str | None, ) -> CDiagnostic: + """Build a normalized redeclaration/conflict diagnostic.""" return CDiagnostic( code=code, message=message, @@ -357,10 +671,16 @@ def _append_declaration_location( locations: list[CSourceLocation], location: CSourceLocation | None, ) -> None: + """Append a declaration location once, preserving encounter order.""" if location is not None and location not in locations: locations.append(location) + # ------------------------------------------------------------------ + # Redeclaration compatibility and normalization + # ------------------------------------------------------------------ + def _type_key(self, type_: CType, seen: set[int] | None = None) -> tuple: + """Return a cycle-safe structural key used for type compatibility.""" if seen is None: seen = set() object_id = id(type_) @@ -407,12 +727,15 @@ def _type_key(self, type_: CType, seen: set[int] | None = None) -> tuple: return (type(type_).__name__, qualifiers) def _types_compatible(self, left: CType, right: CType) -> bool: + """Return whether two parser type models are structurally compatible.""" return self._type_key(left) == self._type_key(right) def _unspecified_function_declaration(self, function: CFunction) -> bool: + """Return whether `function` is an old C empty-parameter declaration.""" return function.prototype_style == "unspecified" and not function.parameters def _functions_compatible(self, left: CFunction, right: CFunction) -> bool: + """Return whether two function declarations can denote one function.""" if not self._types_compatible(left.result_type, right.result_type): return False if self._unspecified_function_declaration(left) or self._unspecified_function_declaration(right): @@ -429,6 +752,7 @@ def _merge_function_declaration( existing: CFunction, incoming: CFunction, ) -> CFunction: + """Merge compatible function declarations, preferring definitions.""" if incoming.is_definition and not existing.is_definition: merged = incoming for location in existing.declaration_locations: @@ -446,6 +770,7 @@ def _deduplicate_functions( functions: list[CFunction], diagnostics: list[CDiagnostic], ) -> list[CFunction]: + """Merge compatible functions and report duplicate/conflicting ones.""" by_name: dict[str, CFunction] = {} order: list[str] = [] @@ -485,6 +810,7 @@ def _deduplicate_functions( return [by_name[name] for name in order] def _is_variable_definition(self, variable: CVariable) -> bool: + """Return whether a file-scope variable has an initializer.""" return variable.initializer is not None def _merge_variable_declaration( @@ -492,6 +818,7 @@ def _merge_variable_declaration( existing: CVariable, incoming: CVariable, ) -> CVariable: + """Merge compatible file-scope variable declarations.""" if self._is_variable_definition(incoming) and not self._is_variable_definition(existing): merged = incoming for location in existing.declaration_locations: @@ -509,6 +836,7 @@ def _deduplicate_variables( variables: list[CVariable], diagnostics: list[CDiagnostic], ) -> list[CVariable]: + """Merge tentative variables and report duplicate/conflicting definitions.""" by_name: dict[str, CVariable] = {} order: list[str] = [] @@ -554,6 +882,7 @@ def _deduplicate_typedefs( typedefs: list[CTypedef], diagnostics: list[CDiagnostic], ) -> list[CTypedef]: + """Merge repeated compatible typedefs and report conflicts.""" by_name: dict[str, CTypedef] = {} order: list[str] = [] @@ -587,6 +916,7 @@ def _deduplicate_structs( structs: list[CStruct], diagnostics: list[CDiagnostic], ) -> list[CStruct]: + """Merge incomplete/complete struct tags and report duplicate definitions.""" by_name: dict[str, CStruct] = {} ordered: list[CStruct] = [] @@ -621,6 +951,7 @@ def _deduplicate_unions( unions: list[CUnion], diagnostics: list[CDiagnostic], ) -> list[CUnion]: + """Merge incomplete/complete union tags and report duplicate definitions.""" by_name: dict[str, CUnion] = {} ordered: list[CUnion] = [] @@ -655,6 +986,7 @@ def _deduplicate_enums( enums: list[CEnum], diagnostics: list[CDiagnostic], ) -> list[CEnum]: + """Report duplicate enum definitions while preserving first definitions.""" by_name: dict[str, CEnum] = {} ordered: list[CEnum] = [] @@ -679,6 +1011,7 @@ def _deduplicate_enums( return ordered def _normalize_redeclarations(self, parsed: CFile) -> None: + """Normalize top-level redeclarations in one parsed file in place.""" parsed.structs = self._deduplicate_structs(parsed.structs, parsed.diagnostics) parsed.unions = self._deduplicate_unions(parsed.unions, parsed.diagnostics) parsed.enums = self._deduplicate_enums(parsed.enums, parsed.diagnostics) @@ -687,14 +1020,25 @@ def _normalize_redeclarations(self, parsed: CFile) -> None: parsed.functions = self._deduplicate_functions(parsed.functions, parsed.diagnostics) def _end_location(self, segment: CTopLevelSegment) -> CSourceLocation: + """Return the original end location for a top-level segment.""" + filename = ( + segment.original_filenames[-1] + if segment.original_filenames + else segment.filename + ) return CSourceLocation( - filename=segment.filename, + filename=filename, line=segment.original_end_line, column=segment.original_end_column, source_line=segment.original_end_source_line, ) + # ------------------------------------------------------------------ + # Declaration specifiers and lexical helper primitives + # ------------------------------------------------------------------ + def _last_identifier(self, text: str) -> re.Match[str] | None: + """Return the last identifier in `text`, ignoring bracket contents.""" bracket_depth = 0 allowed_spans: list[tuple[int, int]] = [] span_start = 0 @@ -716,9 +1060,11 @@ def _last_identifier(self, text: str) -> re.Match[str] | None: return matches[-1] if matches else None def _specifier_words(self, spec_text: str) -> list[str]: + """Extract identifier-like words from a declaration-specifier prefix.""" return _IDENTIFIER_RE.findall(spec_text) def _qualifiers(self, spellings: list[str]) -> list: + """Instantiate qualifier model objects from qualifier spellings.""" return [_QUALIFIER_CLASSES[spelling]() for spelling in spellings] def _invalid_specifier_error( @@ -728,6 +1074,7 @@ def _invalid_specifier_error( *, offset: int = 0, ) -> CParseError: + """Build the fatal diagnostic used for invalid specifier sequences.""" location = self._source_location_at(segment, offset) return CParseError( message, @@ -738,8 +1085,40 @@ def _invalid_specifier_error( code="CPARSE003", ) + def _atomic_type_specifier_parts(self, spec_text: str) -> tuple[str, str] | None: + """Return surrounding specifiers and the type-name inside `_Atomic(...)`.""" + for match in _IDENTIFIER_RE.finditer(spec_text): + if match.group(0) != "_Atomic": + continue + open_index = self._skip_whitespace(spec_text, match.end()) + if open_index >= len(spec_text) or spec_text[open_index] != "(": + continue + close_index = self._find_matching_delimiter(spec_text, open_index, "(", ")") + if close_index is None: + return None + surrounding = " ".join( + part + for part in ( + spec_text[: match.start()].strip(), + spec_text[close_index + 1 :].strip(), + ) + if part + ) + return surrounding, spec_text[open_index + 1 : close_index].strip() + return None + + def _add_outermost_qualifiers(self, type_: CType, qualifiers: list) -> None: + """Attach qualifiers to the object denoted by an assembled type.""" + if isinstance(type_, CComposedType) and type_.components: + type_.components[0].qualifiers.extend(qualifiers) + else: + type_.qualifiers.extend(qualifiers) + def _parse_specifiers(self, spec_text: str) -> tuple[CType, list[str], list[str]]: - words = self._specifier_words(spec_text) + """Parse C declaration specifiers into base type and specifier lists.""" + atomic_specifier = self._atomic_type_specifier_parts(spec_text) + outer_spec_text = atomic_specifier[0] if atomic_specifier is not None else spec_text + words = self._specifier_words(outer_spec_text) storage: list[str] = [] qualifiers: list[str] = [] function_specifiers: list[str] = [] @@ -755,7 +1134,29 @@ def _parse_specifiers(self, spec_text: str) -> tuple[CType, list[str], list[str] else: type_words.append(word) - if type_words and type_words[0] in _TAG_KINDS: + if atomic_specifier is not None: + if type_words: + raise _InvalidSpecifierSequence( + f"Invalid type specifier sequence {spec_text.strip()!r}." + ) + inner_text = atomic_specifier[1] + inner_spec_text, inner_declarator = self._split_declaration_specifiers(inner_text) + if not inner_spec_text: + raise _InvalidSpecifierSequence( + f"Invalid _Atomic type-name {inner_text!r}." + ) + name, type_, inner_storage, inner_function_specifiers, _direct_function = ( + self._build_declared_type(inner_spec_text, inner_declarator) + ) + if name is not None or inner_storage or inner_function_specifiers: + raise _InvalidSpecifierSequence( + f"Invalid _Atomic type-name {inner_text!r}." + ) + self._add_outermost_qualifiers( + type_, + [CAtomic(), *self._qualifiers(qualifiers)], + ) + elif type_words and type_words[0] in _TAG_KINDS: tag_name = type_words[1] if len(type_words) > 1 else None tag_type = {"struct": CStruct, "union": CUnion, "enum": CEnum}[type_words[0]] tag_kwargs = { @@ -793,11 +1194,13 @@ def _parse_specifiers(self, spec_text: str) -> tuple[CType, list[str], list[str] return type_, storage, function_specifiers def _skip_whitespace(self, text: str, index: int) -> int: + """Advance `index` past ASCII/Unicode whitespace.""" while index < len(text) and text[index].isspace(): index += 1 return index def _read_identifier(self, text: str, index: int) -> tuple[str, int] | None: + """Read one C identifier at `index` and return `(name, end)`.""" if index >= len(text): return None first = text[index] @@ -815,6 +1218,7 @@ def _find_matching_delimiter( open_char: str, close_char: str, ) -> int | None: + """Find the matching delimiter while respecting strings and chars.""" depth = 0 state = "normal" quote = "" @@ -844,6 +1248,13 @@ def _find_matching_delimiter( return None def _split_declaration_specifiers(self, text: str) -> tuple[str, str]: + """Split a declaration into specifier prefix and declarator tail. + + This is the declaration grammar gateway. It consumes storage classes, + qualifiers, function specifiers, primitive words, tag references, and at + most one typedef-name placeholder before leaving the declarator text for + the recursive declarator parser. + """ index = 0 spec_end = 0 consumed_type = False @@ -856,6 +1267,19 @@ def _split_declaration_specifiers(self, text: str) -> tuple[str, str]: break word, end = identifier + if word == "_Atomic": + open_index = self._skip_whitespace(text, end) + if open_index < len(text) and text[open_index] == "(": + if consumed_type: + break + close_index = self._find_matching_delimiter(text, open_index, "(", ")") + if close_index is None: + break + consumed_type = True + index = close_index + 1 + spec_end = index + continue + if word in _STORAGE_CLASSES or word in _TYPE_QUALIFIERS or word in _FUNCTION_SPECIFIERS: index = end spec_end = end @@ -887,11 +1311,16 @@ def _split_declaration_specifiers(self, text: str) -> tuple[str, str]: return text[:spec_end].strip(), text[spec_end:].strip() + # ------------------------------------------------------------------ + # Recursive declarator grammar + # ------------------------------------------------------------------ + def _parse_pointer_ops( self, text: str, index: int, ) -> tuple[list[_PointerOp], int]: + """Parse leading pointer operators from a declarator fragment.""" pointers: list[_PointerOp] = [] index = self._skip_whitespace(text, index) while index < len(text) and text[index] == "*": @@ -912,6 +1341,7 @@ def _parse_pointer_ops( return pointers, index def _parse_array_op(self, content: str) -> _ArrayOp: + """Parse the contents of one array declarator suffix.""" words = content.strip().split() qualifiers: list[str] = [] is_static = False @@ -937,6 +1367,7 @@ def _parse_declarator_suffixes( text: str, index: int, ) -> tuple[list[_ArrayOp | _FunctionOp], int]: + """Parse direct-declarator array/function suffixes.""" operations: list[_ArrayOp | _FunctionOp] = [] while True: index = self._skip_whitespace(text, index) @@ -974,6 +1405,13 @@ def _parse_direct_declarator_at( text: str, index: int, ) -> tuple[str | None, list[_PointerOp | _ArrayOp | _FunctionOp], int]: + """Parse a direct declarator at `index`. + + Direct declarators contain the identifier, parenthesized declarator, and + suffix chain. Parenthesized declarators recurse back into + `_parse_declarator` so pointer/function/array precedence follows C's + grammar instead of a flat string split. + """ index = self._skip_whitespace(text, index) if index < len(text) and text[index] == "(": close_index = self._find_matching_delimiter(text, index, "(", ")") @@ -997,11 +1435,13 @@ def _parse_declarator_at( text: str, index: int, ) -> tuple[str | None, list[_PointerOp | _ArrayOp | _FunctionOp], int]: + """Parse one full declarator at `index` into name and operations.""" pointers, index = self._parse_pointer_ops(text, index) name, direct_operations, index = self._parse_direct_declarator_at(text, index) return name, [*pointers, *direct_operations], index def _parse_declarator(self, text: str) -> _ParsedDeclarator: + """Parse a complete declarator fragment and reject unconsumed syntax.""" stripped = text.strip() if not stripped: return _ParsedDeclarator(name=None, operations=[], source_text="") @@ -1014,6 +1454,7 @@ def _parse_declarator(self, text: str) -> _ParsedDeclarator: return _ParsedDeclarator(name=name, operations=operations, source_text=stripped) def _prepend_component(self, component: CType, current: CType) -> CComposedType: + """Prepend one derived type component to an existing parser type.""" if isinstance(current, CComposedType): return CComposedType( components=[component, *current.components], @@ -1022,12 +1463,14 @@ def _prepend_component(self, component: CType, current: CType) -> CComposedType: return CComposedType(components=[component, current], source_text=current.source_text) def _apply_pointer_operation(self, current: CType, operation: _PointerOp) -> CType: + """Apply one parsed pointer operation to the current type.""" return self._prepend_component( CPointer(qualifiers=self._qualifiers(operation.qualifiers)), current, ) def _apply_array_operation(self, current: CType, operation: _ArrayOp) -> CType: + """Apply one parsed array operation to the current type.""" array = CArray( bound=operation.size, is_static_minimum=operation.static, @@ -1037,6 +1480,7 @@ def _apply_array_operation(self, current: CType, operation: _ArrayOp) -> CType: return self._prepend_component(array, current) def _apply_function_operation(self, current: CType, operation: _FunctionOp) -> CType: + """Apply one parsed function operation to the current type.""" return CFunctionType( result_type=current, parameter_types=[parameter.type for parameter in operation.parameters], @@ -1050,6 +1494,7 @@ def _apply_declarator_operations( base_type: CType, operations: list[_PointerOp | _ArrayOp | _FunctionOp], ) -> CType: + """Apply parsed declarator operations to a declaration base type.""" current = base_type for operation in operations: if isinstance(operation, _PointerOp): @@ -1065,6 +1510,7 @@ def _build_declared_type( spec_text: str, declarator_fragment: str = "", ) -> tuple[str | None, CType, list[str], list[str], _FunctionOp | None]: + """Build the declared entity name, type, and declaration metadata.""" base_type, storage, function_specifiers = self._parse_specifiers(spec_text) parsed = self._parse_declarator(declarator_fragment) type_ = self._apply_declarator_operations(base_type, parsed.operations) @@ -1082,6 +1528,7 @@ def _build_type( spec_text: str, declarator_fragment: str = "", ) -> tuple[CType, list[str]]: + """Build a type-only declaration result for helper callers.""" _name, type_, _storage, function_specifiers, _direct_function = self._build_declared_type( spec_text, declarator_fragment, @@ -1089,6 +1536,7 @@ def _build_type( return type_, function_specifiers def _adjust_parameter_type(self, declared_type: CType) -> CType: + """Apply C parameter adjustment while preserving the written type.""" if isinstance(declared_type, CFunctionType): return CComposedType( components=[CPointer(), declared_type], @@ -1109,7 +1557,12 @@ def _adjust_parameter_type(self, declared_type: CType) -> CType: ) return declared_type + # ------------------------------------------------------------------ + # Parameter and function grammar + # ------------------------------------------------------------------ + def _parse_parameter(self, text: str) -> CParameter | None: + """Parse one function parameter declaration through the shared backend.""" stripped = text.strip() if not stripped or stripped == "void": return None @@ -1127,6 +1580,7 @@ def _parse_parameter(self, text: str) -> CParameter | None: ) def _find_parameter_list(self, text: str) -> tuple[int, int] | None: + """Return the bounds of a trailing parameter list in declaration text.""" close_index = len(text) - 1 while close_index >= 0 and text[close_index].isspace(): close_index -= 1 @@ -1162,6 +1616,7 @@ def _find_parameter_list(self, text: str) -> tuple[int, int] | None: return None def _parse_parameters(self, parameters_text: str) -> tuple[list[CParameter], bool]: + """Parse a comma-separated parameter list and variadic marker.""" stripped = parameters_text.strip() if not stripped or stripped == "void": return [], False @@ -1178,6 +1633,7 @@ def _parse_parameters(self, parameters_text: str) -> tuple[list[CParameter], boo return parameters, variadic def _is_knr_definition(self, segment: CTopLevelSegment, parameters_text: str) -> bool: + """Return whether a function-looking block is a K&R-style definition.""" if segment.terminator != "block": return False stripped = parameters_text.strip() @@ -1192,9 +1648,17 @@ def _raise_for_unsupported_old_style_definitions( self, source: str, filename: str | None, + *, + use_linemarkers: bool = False, ) -> None: + """Raise before top-level splitting hides unsupported K&R declarations.""" source_lines = source.splitlines() stripped_lines = strip_c_comments(source).splitlines() + line_mappings = line_mappings_for_source( + source, + filename=filename, + use_linemarkers=use_linemarkers, + ) for index, line in enumerate(stripped_lines): text = line.strip() @@ -1228,11 +1692,14 @@ def _raise_for_unsupported_old_style_definitions( if not stripped: continue if stripped.startswith("{"): - source_line = source_lines[index] if index < len(source_lines) else line + mapping = line_mappings[index] if index < len(line_mappings) else None + source_line = mapping.source_line if mapping is not None else ( + source_lines[index] if index < len(source_lines) else line + ) raise CParseError( "K&R style function definitions are not supported", - filename=filename, - line_number=index + 1, + filename=mapping.filename if mapping is not None else filename, + line_number=mapping.line if mapping is not None else index + 1, column=max(line.find(name_match.group(0)) + 1, 1), source_line=source_line, code="CPARSE002", @@ -1243,20 +1710,25 @@ def _raise_for_unsupported_old_style_definitions( break if saw_old_style_declaration: - source_line = source_lines[index] if index < len(source_lines) else line + mapping = line_mappings[index] if index < len(line_mappings) else None + source_line = mapping.source_line if mapping is not None else ( + source_lines[index] if index < len(source_lines) else line + ) raise CParseError( "K&R style function definitions are not supported", - filename=filename, - line_number=index + 1, + filename=mapping.filename if mapping is not None else filename, + line_number=mapping.line if mapping is not None else index + 1, column=max(line.find(name_match.group(0)) + 1, 1), source_line=source_line, code="CPARSE002", ) def _prototype_style(self, parameters_text: str) -> str: + """Classify empty `()` versus prototype-style parameter lists.""" return "unspecified" if not parameters_text.strip() else "prototype" def _parse_function(self, segment: CTopLevelSegment) -> CFunction | None: + """Parse a function prototype or definition segment, if it is one.""" text = segment.text.strip() if text.startswith(("typedef ", "_Static_assert")) or self._has_unsupported_declaration_marker(text): return None @@ -1304,6 +1776,7 @@ def _function_from_type( function_specifiers: list[str], segment: CTopLevelSegment, ) -> CFunction: + """Assemble a `CFunction` model from a parsed function declarator.""" return CFunction( name=name, result_type=function_type.result_type, @@ -1318,11 +1791,17 @@ def _function_from_type( end=self._end_location(segment) if segment.terminator == "block" else None, ) + # ------------------------------------------------------------------ + # Aggregate, field, enum, and declaration parsing + # ------------------------------------------------------------------ + def _anonymous_tag_id(self, kind: str, segment: CTopLevelSegment) -> str: + """Create a stable anonymous aggregate id from source location.""" filename = segment.filename or "" return f"{kind}@{filename}:{segment.original_start_line}:{segment.original_start_column}" def _tag_definition_header(self, text: str) -> tuple[str, list[str], str | None] | None: + """Parse the prefix before an aggregate definition body.""" words = self._specifier_words(text) for index, word in enumerate(words): if word not in _TAG_KINDS: @@ -1337,6 +1816,7 @@ def _tag_definition_header(self, text: str) -> tuple[str, list[str], str | None] return None def _forward_tag(self, segment: CTopLevelSegment) -> CStruct | CUnion | None: + """Parse `struct tag;` or `union tag;` forward declarations.""" words = self._specifier_words(segment.text.strip()) if len(words) != 2 or words[0] not in {"struct", "union"}: return None @@ -1357,6 +1837,7 @@ def _use_aggregate_definition( type_: CType, aggregate: CStruct | CUnion | CEnum, ) -> CType: + """Replace a matching tag reference with the parsed aggregate object.""" if isinstance(type_, CComposedType): terminal = type_.components[-1] if isinstance(terminal, (CStruct, CUnion, CEnum)) and not terminal.qualifiers: @@ -1374,6 +1855,12 @@ def _declarations_from_declarators( *, resolved: CStruct | CUnion | CEnum | None = None, ) -> tuple[list[CFunction], list[CTypedef], list[CVariable], list[CDiagnostic]]: + """Parse all declarators after a shared declaration-specifier prefix. + + This is the common declaration backend for top-level functions, + variables, typedefs, and aggregate declarators that follow inline + `struct`/`union`/`enum` definitions. + """ functions: list[CFunction] = [] typedefs: list[CTypedef] = [] variables: list[CVariable] = [] @@ -1430,6 +1917,7 @@ def _declarations_from_declarators( return functions, typedefs, variables, diagnostics def _declarator_diagnostic(self, segment: CTopLevelSegment, message: str) -> CDiagnostic: + """Build a warning for a declarator rejected by the grammar subset.""" return CDiagnostic( code="C_UNSUPPORTED_DECLARATOR", message=message, @@ -1440,6 +1928,7 @@ def _declarator_diagnostic(self, segment: CTopLevelSegment, message: str) -> CDi ) def _union_by_value_names(self, type_: CType) -> set[str]: + """Return union type names that appear without pointer/array indirection.""" if isinstance(type_, CUnion): return {type_.reference_name} if isinstance(type_, CTypedef) and type_.type is not None: @@ -1468,6 +1957,7 @@ def _union_by_value_names(self, type_: CType) -> set[str]: return set() def _union_by_value_diagnostics(self, function: CFunction) -> list[CDiagnostic]: + """Build conservative diagnostics for functions using unions by value.""" union_names = self._union_by_value_names(function.result_type) for parameter in function.parameters: union_names.update(self._union_by_value_names(parameter.type)) @@ -1494,6 +1984,7 @@ def _append_union_by_value_diagnostics( function: CFunction, diagnostics: list[CDiagnostic], ) -> None: + """Append union-by-value diagnostics without duplicating messages.""" for diagnostic in self._union_by_value_diagnostics(function): already_present = any( existing.code == diagnostic.code @@ -1513,6 +2004,7 @@ def _field_diagnostic( *, offset: int = 0, ) -> CDiagnostic: + """Build a field-level warning at a precise member offset.""" return CDiagnostic( code="C_UNSUPPORTED_FIELD_DECLARATION", message=message, @@ -1523,6 +2015,7 @@ def _field_diagnostic( ) def _incomplete_array_component(self, type_: CType) -> CArray | None: + """Return the outer incomplete array component, if present.""" components = type_.components if isinstance(type_, CComposedType) else [type_] if not components or not isinstance(components[0], CArray): return None @@ -1536,6 +2029,7 @@ def _validate_flexible_members( members: list[CVariable], owner_kind: str, ) -> list[CDiagnostic]: + """Validate C flexible array member placement rules for this subset.""" diagnostics: list[CDiagnostic] = [] named_members = sum(member.name is not None for member in members) for index, member in enumerate(members): @@ -1563,6 +2057,33 @@ def _validate_flexible_members( ) return diagnostics + def _nested_field_segment( + self, + segment: CTopLevelSegment, + text: str, + offset: int, + ) -> CTopLevelSegment: + """Create a location-preserving segment for a nested field definition.""" + start = self._source_location_at(segment, offset) + end = self._source_location_at(segment, offset + max(len(text) - 1, 0)) + line_offset = segment.text[:offset].count("\n") + line_count = text.count("\n") + 1 + line_slice = slice(line_offset, line_offset + line_count) + return CTopLevelSegment( + text=text, + terminator=";", + filename=start.filename, + original_start_line=start.line or segment.original_start_line, + original_end_line=end.line or segment.original_end_line, + original_start_column=start.column or segment.original_start_column, + original_end_column=end.column or segment.original_end_column, + original_source_line=start.source_line, + original_end_source_line=end.source_line, + original_source_lines=segment.original_source_lines[line_slice], + original_filenames=segment.original_filenames[line_slice], + original_line_numbers=segment.original_line_numbers[line_slice], + ) + def _parse_fields( self, body: str, @@ -1571,6 +2092,7 @@ def _parse_fields( *, body_offset: int, ) -> tuple[list[CVariable], list[CDiagnostic]]: + """Parse struct/union member declarations through the shared backend.""" members: list[CVariable] = [] diagnostics: list[CDiagnostic] = [] for text, field_offset in top_level_split_with_offsets(body, ";"): @@ -1587,11 +2109,31 @@ def _parse_fields( ) continue if "{" in text or "}" in text: + nested = self._parse_tag_definition( + self._nested_field_segment(segment, text, member_offset) + ) + if nested is not None: + aggregate, functions, typedefs, variables, nested_diagnostics = nested + if not functions and not typedefs: + if variables: + members.extend(variables) + diagnostics.extend(nested_diagnostics) + continue + if isinstance(aggregate, (CStruct, CUnion)) and aggregate.name is None: + members.append( + CVariable( + name=None, + type=aggregate, + source_location=member_location, + ) + ) + diagnostics.extend(nested_diagnostics) + continue diagnostics.append( self._field_diagnostic( segment, owner_kind, - "Nested aggregate field definitions are not supported yet.", + "Unsupported nested aggregate field declaration.", offset=member_offset, ) ) @@ -1644,6 +2186,7 @@ def _parse_fields( return members, diagnostics def _parse_enumerators(self, body: str, segment: CTopLevelSegment) -> list[CEnumerator]: + """Parse enum constants while preserving explicit expression text.""" constants: list[CEnumerator] = [] for item in top_level_split(body, ","): name_text, value = top_level_partition(item, "=") @@ -1672,6 +2215,7 @@ def _parse_tag_definition( list[CVariable], list[CDiagnostic], ] | None: + """Parse a top-level struct, union, or enum definition segment.""" text = segment.text.strip() if self._has_unsupported_declaration_marker(text): return None @@ -1751,11 +2295,10 @@ def _parse_declaration( self, segment: CTopLevelSegment, ) -> tuple[list[CFunction], list[CTypedef], list[CVariable], list[CDiagnostic]]: + """Parse an ordinary top-level declaration segment.""" text = segment.text.strip() if ( not text - or "{" in text - or "}" in text or text.startswith("_Static_assert") or self._has_unsupported_declaration_marker(text) or _looks_like_cxx_declaration(text) @@ -1768,19 +2311,8 @@ def _parse_declaration( return self._declarations_from_declarators(spec_text, declarator_list, segment) - def _is_braced_initializer_declaration(self, segment: CTopLevelSegment) -> bool: - text = segment.text.strip() - if not text: - return False - if "{" in text and "}" in text and "=" in text: - return True - if segment.terminator != "block": - return False - - declaration, initializer = top_level_partition(text, "=") - return bool(declaration) and initializer is not None - def _unsupported_declaration_diagnostic(self, segment: CTopLevelSegment) -> CDiagnostic | None: + """Classify an unsupported declaration-shaped segment for diagnostics.""" text = segment.text.strip() if not text: return None @@ -1788,10 +2320,7 @@ def _unsupported_declaration_diagnostic(self, segment: CTopLevelSegment) -> CDia kind = "unsupported_declaration" message = "Unsupported C declaration form." - if self._is_braced_initializer_declaration(segment): - kind = "braced_initializer_declaration" - message = "Braced or designated initializer declarations are not supported yet." - elif _looks_like_cxx_declaration(text): + if _looks_like_cxx_declaration(text): kind = "cxx_declaration" message = "C++ declaration syntax is not supported by the C parser." elif text.startswith("struct "): @@ -1812,9 +2341,6 @@ def _unsupported_declaration_diagnostic(self, segment: CTopLevelSegment) -> CDia elif "_Alignas" in text or "alignas" in text: kind = "alignment_declaration" message = "Declaration alignment specifiers are not supported yet." - elif "_Atomic(" in text: - kind = "atomic_type_declaration" - message = "_Atomic(type) declarations are not supported yet." elif "{" in text or "}" in text: kind = "brace_declaration" message = "Unsupported declaration containing braces." @@ -1828,6 +2354,10 @@ def _unsupported_declaration_diagnostic(self, segment: CTopLevelSegment) -> CDia unit_name=None, ) + # ------------------------------------------------------------------ + # Translation-unit dispatch and project assembly + # ------------------------------------------------------------------ + def _parse_translation_unit( self, source: str, @@ -1835,6 +2365,7 @@ def _parse_translation_unit( *, function_like_macros: set[str] | None = None, object_like_macros: set[str] | None = None, + use_linemarkers: bool = False, ) -> tuple[ list[CFunction], list[CStruct], @@ -1844,7 +2375,18 @@ def _parse_translation_unit( list[CVariable], list[CDiagnostic], ]: - self._raise_for_unsupported_old_style_definitions(source, filename) + """Dispatch top-level C external declarations by grammar role. + + The ordering here is intentional: macro-dependent declarations are + deferred before ordinary parsing, aggregate definitions are parsed + before function/declaration fallback, and ordinary `;` declarations all + flow through the shared declaration backend. + """ + self._raise_for_unsupported_old_style_definitions( + source, + filename, + use_linemarkers=use_linemarkers, + ) functions: list[CFunction] = [] structs: list[CStruct] = [] @@ -1856,7 +2398,11 @@ def _parse_translation_unit( function_like_names = function_like_macros or set() object_like_names = object_like_macros or set() - for segment in split_top_level_c_source(source, filename=filename): + for segment in split_top_level_c_source( + source, + filename=filename, + use_linemarkers=use_linemarkers, + ): macro_dependency = self._segment_macro_dependency( segment, function_like_names, @@ -1890,11 +2436,6 @@ def _parse_translation_unit( variables.extend(parsed_variables) diagnostics.extend(parsed_diagnostics) continue - if self._is_braced_initializer_declaration(segment): - unsupported = self._unsupported_declaration_diagnostic(segment) - if unsupported is not None: - diagnostics.append(unsupported) - continue if segment.terminator != ";": try: function = self._parse_function(segment) @@ -1938,6 +2479,7 @@ def _parse_translation_unit( return functions, structs, unions, enums, typedefs, variables, diagnostics def _build_project(self, parsed_files: dict[str, CFile]) -> CProject: + """Build project indexes, include graph facts, and resolved type links.""" project = CProject(files=parsed_files) all_functions: list[CFunction] = [] for filename, file in parsed_files.items(): @@ -1981,6 +2523,7 @@ def _index_struct( struct: CStruct, diagnostics: list[CDiagnostic], ) -> None: + """Index a named struct tag, completing an earlier incomplete tag.""" if struct.name is None: return existing = project.structs.get(struct.name) @@ -2003,6 +2546,7 @@ def _index_union( union: CUnion, diagnostics: list[CDiagnostic], ) -> None: + """Index a named union tag, completing an earlier incomplete tag.""" if union.name is None: return existing = project.unions.get(union.name) @@ -2025,6 +2569,7 @@ def _index_enum( enum: CEnum, diagnostics: list[CDiagnostic], ) -> None: + """Index a named enum tag and report duplicate definitions.""" if enum.name is None: return existing = project.enums.get(enum.name) @@ -2048,6 +2593,7 @@ def _include_graph_target( target: str, resolved_path: str | None, ) -> str: + """Choose the project include-graph key for an include target.""" local_key = _include_key_from_current(filename, target) if local_key in parsed_files: return local_key @@ -2071,6 +2617,7 @@ def _index_file_includes( filename: str, file: CFile, ) -> None: + """Populate include-graph, system-include, and unresolved-include sets.""" local_targets: set[str] = set() system_targets: set[str] = set() unresolved_targets: set[str] = set() @@ -2095,6 +2642,7 @@ def _index_file_includes( project.unresolved_includes[filename] = unresolved_targets def _index_header_source_pairs(self, project: CProject) -> None: + """Populate reporting-only header/source relationships.""" headers = [key for key in project.files if _is_header_key(key)] sources = [key for key in project.files if _is_source_key(key)] @@ -2114,121 +2662,12 @@ def _index_header_source_pairs(self, project: CProject) -> None: if included in project.files and _is_header_key(included): project.header_source_pairs.setdefault(included, set()).add(source) - def visit_file( - self, - source_or_path: str | Path, - filename: str | None = None, - *, - macro_defines: set[str] | dict[str, int | bool | str] | None = None, - include_dirs: Sequence[str | Path] | None = None, - preprocessing: str = "raw", - encoding: str = "utf-8", - ) -> CFile: - del macro_defines - source_path: Path | None = None - if _looks_like_existing_source_path(source_or_path): - path = Path(source_or_path) - source_path = path - if filename is None: - filename = str(path) - source = path.read_text(encoding=encoding) - else: - source = str(source_or_path) - - parsed = CFile(filename=filename, parser_status="partial", preprocessing=preprocessing) - if preprocessing == "raw": - effective_include_dirs = list(include_dirs or ()) - if source_path is not None: - effective_include_dirs.insert(0, source_path.parent) - metadata = collect_preprocessor_metadata( - source, - filename=filename, - include_dirs=effective_include_dirs, - ) - parsed.includes = metadata.includes - parsed.macros = metadata.macros - parsed.raw_directives = metadata.raw_directives - function_like_macro_names = {macro.name for macro in metadata.macros if macro.function_like} - object_like_macro_names = { - macro.name - for macro in metadata.macros - if macro.directive == "define" and not macro.function_like - } - parsed.macro_dependencies = self._macro_dependencies( - source, - filename, - function_like_macro_names, - object_like_macro_names, - ) - parsed.diagnostics = metadata.diagnostics - functions, structs, unions, enums, typedefs, variables, parser_diagnostics = self._parse_translation_unit( - source, - filename, - function_like_macros=function_like_macro_names, - object_like_macros=object_like_macro_names, - ) - parsed.functions = functions - parsed.structs = structs - parsed.unions = unions - parsed.enums = enums - parsed.typedefs = typedefs - parsed.variables = variables - parsed.diagnostics.extend(parser_diagnostics) - self._normalize_redeclarations(parsed) - return parsed - - def visit_project( - self, - files: Mapping[str, str] | Sequence[str | Path] | str | Path, - *, - include_dirs: Sequence[str | Path] | None = None, - macro_defines: set[str] | dict[str, int | bool | str] | None = None, - preprocessing: str = "raw", - encoding: str = "utf-8", - ) -> CProject: - if isinstance(files, Mapping): - parsed_files = { - name: self.visit_file( - source, - filename=name, - include_dirs=include_dirs, - macro_defines=macro_defines, - preprocessing=preprocessing, - encoding=encoding, - ) - for name, source in files.items() - } - return self._build_project(parsed_files) - - paths: list[Path] = [] - root: Path | None = None - if isinstance(files, (str, Path)): - path = Path(files) - if path.is_dir(): - root = path - paths = _collect_c_paths(path) - else: - paths = [path] - else: - paths = [Path(p) for p in files] - - parsed_files: dict[str, CFile] = {} - for path in sorted(paths): - key = path.name if root is not None else str(path) - if root is not None: - key = str(path.relative_to(root)) - parsed_files[key] = self.visit_file( - path, - filename=key, - include_dirs=include_dirs, - macro_defines=macro_defines, - preprocessing=preprocessing, - encoding=encoding, - ) - return self._build_project(parsed_files) +_DEFAULT_PARSER = CParser() -_DEFAULT_PARSER = CParser() +# ----------------------------------------------------------------------------- +# Module-level convenience wrappers +# ----------------------------------------------------------------------------- def parse_c_file( @@ -2240,6 +2679,7 @@ def parse_c_file( preprocessing: str = "raw", encoding: str = "utf-8", ) -> CFile: + """Parse one C source string/path using the default parser instance.""" return _DEFAULT_PARSER.visit_file( source_or_path, filename=filename, @@ -2258,6 +2698,7 @@ def parse_c_project( preprocessing: str = "raw", encoding: str = "utf-8", ) -> CProject: + """Parse multiple C files or a directory using the default parser instance.""" return _DEFAULT_PARSER.visit_project( files, include_dirs=include_dirs, diff --git a/docs/c_parser/c_parser_architecture.md b/docs/c_parser/c_parser_architecture.md index f5c21b13a..70444a0fd 100644 --- a/docs/c_parser/c_parser_architecture.md +++ b/docs/c_parser/c_parser_architecture.md @@ -8,6 +8,11 @@ reporting, top-level source splitting, and a first simple declaration/function subset with function-definition start/end locations and aggregate declarations exist. Declarators are parsed through a recursive grammar-style path for pointer, array, function, and parenthesized combinations. +The x2py CLI also has a shared C/Fortran preprocessing option surface and can +run an exact compiler/preprocessor executable for C compiler mode. Compiler +and preprocessed C inputs preserve `#line`/GCC linemarker source locations for +parsed declarations and diagnostics. A separate compiler-derived standard-type +probe supplies target ABI facts needed by later C semantic conversion. This document records the target architecture for the C parser frontend in x2py. The initial skeleton has grown into a partial parser, and the remaining @@ -59,8 +64,7 @@ Implemented now: unexpanded object-like macros are deferred as macro dependencies rather than misreported as invalid type sequences. Selected unsupported declaration forms, including attributes, alignment specifiers, - `_Atomic(type)`, C++-shaped declarations, nested aggregate member - definitions, and static assertions, are reported as diagnostics with + C++-shaped declarations, and static assertions, are reported as diagnostics with explicit `unit_kind` values. A declarator must be fully consumed before a concrete object is returned; unknown suffixes become diagnostics. Primitive specifier order is normalized, and invalid combinations such as @@ -76,12 +80,17 @@ Implemented now: inside function bodies remain out of scope because bodies are skipped. - `c_parser.cli` provides C-specific partial report formatting. - `x2py.cli` dispatches `--language c --parse` to the C parser path. +- `x2py.c_type_probe` compiles and runs a generated C11 query for + `size_t`, `uint32_t`, `time_t`, and opaque `FILE` pointer ABI facts, + preserving compiler/runner/source provenance for semantic conversion. It + carries target-relevant include, macro, undefine, and compiler-argument flags + and records the requested project standard as provenance. - `--language c --semantics`, `--language c --pyi`, and C wrap-readiness are rejected until semantic conversion exists. - Focused partial CLI/API, declaration/function, diagnostic color, project - include/index, raw lexer/directive, project golden, error golden, and JSON - schema tests are active. Remaining parser-suite skips are limited to the - pinned corpus roadmap and compiler-preprocessed `.i`/`#line` behavior. + include/index, raw lexer/directive, project golden, error golden, preprocessed + linemarker remapping, and JSON schema tests are active. Remaining + parser-suite skips are limited to the pinned corpus roadmap. - `tests/data/c/` contains general fixtures modeled after the Fortran general fixture themes, additional C-specific API shapes, fatal diagnostic inputs, and real-world cJSON/jsmn/tinyexpr/linmath/NanoSVG/stb inputs whose partial @@ -92,13 +101,9 @@ Deferred: - full typedef/tag resolution policy beyond basic project-level link-up and callback policy metadata, for example conflict diagnostics, active conditional branches, and semantic wrappability decisions -- nested aggregate member definitions, braced initializers, compiler - attributes, alignment specifiers, and `_Atomic(type)` declarations, for - example `struct outer { struct { int x; } inner; };` and - `int values[3] = {1, 2, 3};` -- preprocessed-input support, line mapping, and macro-expanded declaration - parsing, for example `API(int) run(void);` after macro expansion -- include graph and project type resolution +- compiler attributes and alignment specifiers +- broader compiler-family validation for preprocessing; parsed declarations + already retain preprocessed origin and mapped source identity - C semantic readiness, semantic IR conversion, and `.pyi` output Documentation rule: any future C parser implementation change must update all @@ -129,6 +134,7 @@ should not wait for a separate request. - `tests/parser/test_fortran_fixture_suite.py` - `tests/parser/test_fortran_error_fixture_suite.py` - `tests/parser/test_parser_developer_tutorial.py` +- `tests/parser/c/test_c_parser_developer_tutorial.py` - `tests/parser/test_parser_public_entrypoints.py` - `tests/semantics/test_semantic_wrap_readiness.py` - `tests/parser/test_error_handling.py` @@ -200,10 +206,14 @@ Regular expressions are acceptable only as narrow helpers inside a grammar step, such as recognizing an include directive after the preprocessor collector has isolated the line. They must not become the top-level parsing strategy. -External compiler preprocessing can be used later as an optional input source -for `.i` files or macro-expanded views, but the x2py C frontend still needs its -own typed parser models, source-location handling, diagnostics, and project -indexes. Invoking a compiler must not replace the grammar-style parser. +External compiler preprocessing can be used as an optional input source for +macro-expanded views, but the x2py C frontend still needs its own typed parser +models, source-location handling, diagnostics, and project indexes. Invoking a +compiler must not replace the grammar-style parser. The current x2py CLI can +run an exact user-supplied compiler executable through `--preprocess compiler` +and parse the preprocessed stdout through the same C parser. `#line` and +GCC/Clang linemarkers are used to remap parsed locations and diagnostics back +to the original source. ## Package Layout @@ -222,6 +232,9 @@ c_parser/ project.py type_resolver.py utils.py + +x2py/ + c_type_probe.py ``` Current and planned responsibilities: @@ -235,42 +248,43 @@ Current and planned responsibilities: - `c_parser/lexer.py` - Implemented: safe comment removal that preserves line mapping, logical record folding for backslash-newline, string/character literal awareness, - lightweight tokens with source locations, top-level splitting with block - end locations, and delimiter splitting aware of nesting and literals. + lightweight tokens with source locations, preprocessed `#line`/linemarker + remapping for top-level segments, top-level splitting with block end + locations, and delimiter splitting aware of nesting and literals. - Planned: richer token helpers as extension and initializer-expression parsing require them. - `c_parser/preprocessor.py` - Implemented: lightweight raw directive metadata for includes, object-like macros, `#undef` directives, function-like macro diagnostics, and local include resolution when a matching file is available. - - Planned: compiler-assisted preprocessing metadata and `#line`/linemarker - source mapping for preprocessed input. + - Compiler-assisted recipe metadata is persisted by the shared + `x2py.preprocessing` CLI input path and attached to generated `CFile` + JSON output. - `c_parser/parser.py` - Implemented: `CParser`, `parse_c_file`, `parse_c_project`, translation-unit visiting, declaration/function visitors, grammar-shaped recursive declarator parsing, concrete `CType` construction, and aggregate member extraction. Helper methods live on `CParser` rather than as broad - module-level functions. Function models record prototype-style versus - unspecified empty parameter lists, function definitions preserve start/end - locations, K&R-style definitions are rejected with `CParseError`, and - invalid primitive-specifier combinations are rejected with `CPARSE003`. - Array and function parameters preserve `declared_type` while effective - `type` uses C parameter adjustment. Raw declarations beginning with an - object-like macro name are retained as macro-dependent diagnostics. + module-level functions. The file now follows the Fortran parser's + maintainer-facing organization pattern with a module architecture guide, + public visitors first, sectioned helper groups, and docstrings on parser + helper methods. Function models record prototype-style versus unspecified + empty parameter lists, function definitions preserve start/end locations, + K&R-style definitions are rejected with `CParseError`, and invalid + primitive-specifier combinations are rejected with `CPARSE003`. Array and + function parameters preserve `declared_type` while effective `type` uses C + parameter adjustment. Raw declarations beginning with an object-like macro + name are retained as macro-dependent diagnostics. - Planned: symbol resolution and additional declaration-specifier and extension coverage. - `c_parser/project.py` - - Placeholder now. - - Planned: file discovery for `.c`, `.h`, and possibly `.i`. - - Include graph construction. - - Header/source association. - - Cross-file type and typedef resolution. + - Compatibility export for project parsing. + - Project behavior is implemented through `CParser.visit_project`, including + `.c`/`.h`/`.i` discovery, include graphs, and header/source association. - `c_parser/type_resolver.py` - - Placeholder now. - - Planned: resolve the concrete primitive/tag/typedef types constructed by - the parser across declarations and files. - - Resolve typedef chains and aggregate references. - - Safely fold simple compile-time constant expressions. + - Resolves tag and typedef references, typedef chains/cycles, and aggregate + references across parsed project files. + - Planned: safely fold simple compile-time constant expressions. - `c_parser/cli.py` - Implemented: report formatting and serialization helpers called by `x2py.cli` behind explicit C flags. @@ -278,6 +292,11 @@ Current and planned responsibilities: - `c_parser/utils.py` - Placeholder now. - Planned: shared helpers that are not parser-state dependent. +- `x2py/c_type_probe.py` + - Implemented: compiler/target-derived JSON facts for standard-header + arithmetic aliases and opaque `FILE` pointer ABI information. + - Boundary: target ABI facts are inputs to future semantics, not declarations + guessed by raw parser mode or stored as `CFile` syntax facts. ## Public API Shape @@ -308,7 +327,9 @@ x2py API promise stable C behavior before the frontend matures. All declared types inherit from `CType`, which stores `qualifiers` and `source_text`. Type qualifiers are concrete values: `CConst`, `CVolatile`, -`CRestrict`, and `CAtomic`. +`CRestrict`, and `CAtomic`. Both `_Atomic int` and `_Atomic(type)` forms are +parsed; for a composed inner type the atomic qualifier stays on its outermost +component. The implemented primitive `CType` subclasses are: @@ -476,6 +497,7 @@ Layered pieces: - declaration specifier parser - storage classes: `extern`, `static`, `typedef`, `register`, `_Thread_local` - qualifiers: `const`, `restrict`, `volatile`, `_Atomic` + - atomic type specifier: `_Atomic(type)` - primitive base: `void`, `char`, `short`, `int`, `long`, `float`, `double`, `_Bool`, `_Complex` - signedness: `signed`, `unsigned` @@ -506,9 +528,13 @@ function names, type names, declarators, attributes, calling conventions, visibility annotations, and entire declarations. Raw mode must therefore avoid guessing what macro-expanded declarations mean. Macro-heavy APIs are still in scope, but the supported path for those APIs is compiler-assisted preprocessing -with line mapping. The parser should support both raw-source mode and a later -preprocessed-input mode, and should store the facts it learns from either mode -in C parser models before any semantic IR conversion is attempted. +with line mapping. The parser supports raw-source mode, +compiler/preprocessed-input mode, and direct `.i` input; declarations parsed +from preprocessed source carry `origin="preprocessed"`. For compiler streams +produced by the shared x2py CLI, `CFile` JSON records a +`preprocessing_recipe`: compiler executable, final argv, +include dirs, defines, undefines, standard, working directory, and optional +selected `compile_commands.json` entry. Raw-source mode target: @@ -528,14 +554,25 @@ Raw-source mode target: Compiler-assisted preprocessing target: -- Accept a preprocessed stream from `.i` files or a configured compiler command - such as `cc -E` or `clang -E`. +- Accept a preprocessed stream from a configured compiler command such as + `gcc-13 -E`, `clang-18 -E`, or an absolute compiler path. Users normally pass + `.h`/`.c` inputs and have x2py generate the stream; direct `.i` input is + accepted when a generated stream already exists. +- Use a shared x2py CLI option shape for C and Fortran: + `--preprocess compiler`, `--compiler`, `-I`, `-D`, `-U`, `--std`, and + `--compiler-arg`. +- Require exact compiler executables in direct compiler mode, for example + `gcc-13`, `clang-18`, `/usr/bin/gfortran-12`, or + `/opt/intel/oneapi/compiler/latest/bin/ifx`, instead of silently choosing a + generic default. +- Accept C `compile_commands.json` entries for project builds and strip + compile-only flags before adding `-E`. - Preserve `#line` marker information so diagnostics can map preprocessed declarations back to original files. - Treat `#line`/linemarker directives as the source of truth for `source_location` fields after preprocessing. -- Store both the original input path and the preprocessed origin metadata on - parsed models. +- Store the original input path and exact invocation recipe for + CLI-generated compiler input. - Mark declarations discovered only after preprocessing with `origin="preprocessed"` or equivalent model metadata. - Record the macro definitions/include directories/preprocessor command that @@ -576,11 +613,12 @@ Current behavior: - Basic cross-file typedef and struct/union/enum tag references are linked to project index objects after all files are parsed. Original type spelling is preserved in the model `source_text`. -- Duplicate/conflict analysis is not populated yet. +- Basic duplicate/conflict analysis is populated; broader policy remains + fixture-driven work. Planned behavior after project-resolution phases: -- Collect `.c`, `.h`, and eventually `.i` files from explicit paths or +- Collect `.c`, `.h`, and `.i` files from explicit paths or directories. - Parse headers and sources into `CFile` models. - Deepen include graph behavior where normalized paths are ambiguous. @@ -620,8 +658,12 @@ These should become parser diagnostics or parser metadata, not a parser-side For the current planning horizon, the C parser should store C-specific facts in `c_parser/models.py`. It currently stores function-pointer signatures, callback-candidate markers, type qualifiers, raw include dependencies, and -unresolved typedef/tag uses. Later phases should add preprocessing origin, -macro dependencies, ownership policy, and resolved symbol links. +unresolved typedef/tag uses. Preprocessed input records declaration origin and +mapped source identity; CLI-generated compiler input also records its +preprocessing recipe. Later phases should add ownership policy and deepen +resolved symbol/conflict handling. Standard-header aliases whose representation +matters to semantic conversion are supplied separately by `x2py.c_type_probe`, +with exact compiler, generated source, and runner provenance. Semantic IR conversion is deliberately later work. When that phase starts, the IR model may need extensions for C pointer ownership, unsigned integer types, @@ -648,6 +690,10 @@ Planned mapping: - enums -> constants or a future semantic enum representation - typedefs -> semantic aliases or metadata, depending on IR support at the time of implementation +- standard-header aliases (`size_t`, `uint32_t`, `time_t`) -> semantic + integer/real types using compiler-derived width and signedness facts +- `FILE *` -> opaque handle/pointer semantics using pointer ABI facts rather + than importing library-private layout - macros/constants -> `SemanticArgument` module variables with `Constant` where safe @@ -707,10 +753,13 @@ Until those fields exist and are supplied, any future readiness layer should report an explicit callback policy blocker rather than pretending the function is safely wrappable. -## Isolation Policy +## Merge Policy -All C parser work must be isolated from project `main` until the C frontend is -mature and stable. +The parse-only C frontend can be merged to project `main` once parser behavior, +preprocessing, source-location remapping, probe contracts, docs, and tests are +green. C semantic readiness, semantic IR conversion, and `.pyi` generation are +separate follow-up phases and should remain explicitly disabled until their +models and tests exist. Long-lived integration branch: @@ -724,8 +773,8 @@ Roadmap branch: c-parser/phase-0-roadmap ``` -Future feature branches should be created from `c-parser/main` and merged only -back into `c-parser/main`, for example: +Future C semantic feature branches can be created from the integration branch +or project `main`, depending on the merge point, for example: ```text c-parser/phase-1-cli-and-docs @@ -742,6 +791,7 @@ c-parser/phase-11-pyi c-parser/phase-12-corpus-stabilization ``` -No C parser branch should merge directly into project `main` until the -frontend has stable parser behavior, docs, CLI, tests, semantic readiness -integration, semantic conversion, and `.pyi` expectations. +Before merging parser work, run the C parser/probe tests plus the shared CLI and +Fortran regression suites. After merge, C semantics work should continue behind +the existing CLI errors for `--language c --semantics`, `--pyi`, and +`--wrap-readiness` until those stages are implemented. diff --git a/docs/c_parser/c_parser_cli_workflow.md b/docs/c_parser/c_parser_cli_workflow.md index 82492c585..18cd23f3f 100644 --- a/docs/c_parser/c_parser_cli_workflow.md +++ b/docs/c_parser/c_parser_cli_workflow.md @@ -9,7 +9,11 @@ aggregate declarations, function prototypes, prototype-style metadata, and function-definition signatures with start/end locations. Declarator output can represent parenthesized pointer/array precedence through concrete `CComposedType` components and nameless `CFunctionType` signatures; function -parameters expose both declared and C-adjusted effective type facts. +parameters expose both declared and C-adjusted effective type facts. The CLI +also exposes shared C/Fortran preprocessing flags and can run exact +compiler/preprocessor executables for compiler mode. Target-specific standard +header type facts for later C semantics are available through the separate +`python -m x2py.c_type_probe` command. This document records the implemented C parse command shape, output schema, and diagnostic contract, plus deferred CLI behavior. @@ -22,6 +26,7 @@ Implemented commands: python -m x2py path/to/api.h --language c --parse python -m x2py path/to/api.h --language c --parse --json python -m x2py path/to/api.h --language c --parse --out report.json +python -m x2py path/to/api.h --language c --parse --preprocess compiler --compiler clang-18 -I include -D API_EXPORT= --std c11 ``` The C parser accepts explicit `.c` and `.h` files, plus directories in explicit @@ -40,7 +45,12 @@ legal final flexible struct members marked with `is_flexible=True`. Array and function parameters preserve written `declared_type` forms while effective `type` values use pointer adjustment. Raw `includes`, `macros`, `raw_directives`, `macro_dependencies`, and metadata -`diagnostics` can also be populated. `parse_c_project(...)` additionally +`diagnostics` can also be populated. `--preprocess compiler` runs an exact +user-supplied compiler/preprocessor executable or uses a C +`compile_commands.json` entry, then feeds the preprocessed stdout through the +same parser with `preprocessing: "compiler"`. `#line` and GCC/Clang +linemarkers remap parsed declarations and diagnostics back to the original +source. `parse_c_project(...)` additionally populates project-level include/index fields such as `include_graph`, `system_includes`, `unresolved_includes`, `functions_by_file`, `enum_constants`, and `header_source_pairs`. Those fields require project @@ -49,7 +59,7 @@ The object class distinguishes declarations (`CFunction`, `CVariable`, `CTypedef`, `CStruct`, `CUnion`, or `CEnum`), and incomplete tag declarations set `is_incomplete=True`. Known unsupported declaration forms such as declaration attributes, alignment -specifiers, `_Atomic(type)`, nested aggregate member definitions, and static assertions are +specifiers, and static assertions are reported in diagnostics with explicit `unit_kind` values; unconsumed declarator suffixes are diagnosed instead of silently omitted. Invalid flexible array member placement and flexible union members produce @@ -177,20 +187,145 @@ C-specific flags to add only when needed: --print-limit N ``` -Potential later flags: +Implemented shared preprocessing flags: ```text ---auto-language ---project ---header-mode ---source-mode ---preprocessed ---preprocess-command PATH_OR_COMMAND ---define NAME[=VALUE] ---undef NAME +--preprocess {internal,compiler} +--compiler EXACT_EXECUTABLE +--compile-commands PATH +-I DIR / --include-dir DIR +-D NAME[=VALUE] / --define NAME[=VALUE] +-U NAME / --undef NAME +--std STANDARD +--compiler-arg ARG ``` -`--define` and `--undef` should belong to compiler-assisted preprocessing, not +`--preprocess internal` is the default. For C it means the current raw +directive metadata mode: x2py reads `.h`/`.c` input directly, records includes +and macros from the file, parses ordinary visible declarations, and does not +expand macros or select `#if` branches. For Fortran it means the existing +internal preprocessing path, including simple macro branch selection through +`-D` and `-U`. + +`--preprocess compiler` means x2py runs an external compiler/preprocessor and +parses stdout. The user must pass an exact compiler executable with +`--compiler`, unless a C `--compile-commands` entry supplies it. Do not rely on +generic defaults when multiple compiler versions are installed. + +Before this mechanism is treated as portable across supported toolchains, it +needs substantial integration testing with multiple C and Fortran compiler +families and versions, including GCC/GFortran, Clang/LLVM-family tools, and +vendor compilers where available. That validation should cover command-line +flag compatibility, include and macro behavior, preprocessed stdout parsing, +and C `#line`/linemarker source-location remapping. + +Standard-header typedefs and opaque handles require target ABI facts rather +than raw parser guesses. The standalone probe emits JSON intended for later C +semantic conversion: + +```bash +python -m x2py.c_type_probe --compiler /usr/bin/gcc-13 --std c11 + +# Cross target: run the generated target executable under an emulator. +python -m x2py.c_type_probe --compiler aarch64-linux-gnu-gcc \ + --compiler-arg=--sysroot=/opt/aarch64-sysroot \ + --runner=qemu-aarch64 --runner=-L --runner=/opt/aarch64-sysroot +``` + +It reports `size_t`, available `uint32_t`, and `time_t` width/signedness +classification, plus opaque `FILE` pointer width/alignment, together with the +generated source and exact compile/run commands. The probe carries +target-relevant user flags: `-I`, `-D`, `-U`, and every `--compiler-arg`. +The requested `--std` is recorded in the report, but the generated C probe is +compiled as C11 because it uses `_Generic` and `_Alignof`. If a standard flag is +part of the target profile and is C11-compatible, pass it through +`--compiler-arg` so it appears in the actual compile command. The probe does +not read `compile_commands.json` directly; when parser preprocessing uses a +compile database, pass the selected compiler and target-relevant flags from the +matching entry to the probe explicitly. This is separate from parser JSON +because it describes a target ABI rather than a source declaration. + +Fortran has the same target-profile issue for kind values. The Fortran semantic +path collects unresolved expressions such as `selected_real_kind(12)` and can +evaluate them through `x2py.fortran_type_probe` using the configured compiler, +`-I`, `-D`, `-U`, `--std`, and `--compiler-arg` flags. When the x2py CLI runs +Fortran `--semantics`, `--pyi`, or `--wrap-readiness` with `--preprocess +compiler --compiler ...`, those collected values are evaluated automatically +and passed into semantic conversion. + +Examples: + +```bash +# C, versioned executable from PATH. +python -m x2py include/api.h --language c --parse \ + --preprocess compiler \ + --compiler clang-18 \ + -I include \ + -D API_EXPORT= \ + -D FEATURE_X=1 \ + -U DEBUG \ + --std c11 + +# C, absolute compiler path. +python -m x2py src/api.c --language c --parse --json \ + --preprocess compiler \ + --compiler /usr/bin/gcc-13 \ + -I /opt/vendor/include \ + --compiler-arg=--sysroot=/opt/sdk + +# C, Intel or vendor compiler path. +python -m x2py include/vendor_api.h --language c --parse \ + --preprocess compiler \ + --compiler /opt/intel/oneapi/compiler/latest/bin/icx \ + -D VENDOR_PUBLIC= + +# C, project build database. The compiler and most flags come from the matching +# compile_commands.json entry for the input file. +python -m x2py src/api.c --language c --parse \ + --preprocess compiler \ + --compile-commands build/compile_commands.json + +# Fortran, current internal branch selection. +python -m x2py src/solver.F90 --parse \ + -D USE_MPI \ + -U DEBUG + +# Fortran, compiler-assisted preprocessing with an exact versioned executable. +python -m x2py src/solver.F90 --parse \ + --preprocess compiler \ + --compiler /usr/bin/gfortran-12 \ + -I include \ + -D USE_MPI \ + --std f2018 + +# Fortran, Intel compiler. +python -m x2py src/solver.F90 --parse \ + --preprocess compiler \ + --compiler /opt/intel/oneapi/compiler/latest/bin/ifx \ + -I include \ + -D USE_MPI +``` + +Flag meanings: + +- `--compiler`: exact executable to run. Use `gcc-13`, `clang-18`, + `/usr/bin/gfortran-12`, `/opt/.../ifx`, etc. x2py treats this as one argv + item, not a shell command string. +- `--compile-commands`: C project database. x2py finds the entry for the input + file, strips compile-only flags such as `-c` and `-o`, adds `-E`, and uses + that entry's compiler unless `--compiler` overrides it. +- `-I` / `--include-dir`: include path passed as `-IDIR` in compiler mode. In + C internal mode it is also used for quoted include resolution. +- `-D` / `--define`: macro definition. `-D NAME` means `NAME=1`; `-D NAME=VALUE` + preserves `VALUE`. +- `-U` / `--undef`: macro undefinition. In Fortran internal mode this selects + inactive branches for that macro. +- `--std`: language standard passed as `-std=STANDARD`, for example `c11`, + `c23`, `f2008`, or `f2018`. +- `--compiler-arg`: one raw compiler argument. For values beginning with `-`, + use the equals form, for example `--compiler-arg=-target`. + +`--define` and `--undef` belong to compiler-assisted preprocessing for C, not to raw parser-side macro evaluation. Raw C mode records directives and parses ordinary visible declarations only; it does not select `#if` branches or expand macros. A declaration prefixed by an unexpanded object-like macro is deferred @@ -283,10 +418,19 @@ of hard failures. Raw mode must not claim support for macro-generated declarations. If macros affect function names, types, parameters, attributes, storage classes, calling conventions, visibility annotations, or active conditional branches, the user -should provide compiler-preprocessed input later through a `.i` file or an -explicit preprocessor command. That preprocessed path must preserve +should use `--preprocess compiler` with an exact compiler executable and the +same `-I`, `-D`, `-U`, standard, target, and sysroot flags required by their +build. The user should not normally pass a `.i` file directly; x2py generates +the preprocessed stream internally. Compiler/preprocessed mode preserves `#line`/linemarker mappings so parser diagnostics and JSON `source_location` -fields still point back to the original `.h` or `.c` file. +fields point back to the original `.h` or `.c` file rather than the compiler +stdout stream. For streams generated by `x2py --preprocess compiler`, per-file +JSON also contains `preprocessing_recipe` with the exact compiler argv, +configuration flags, working directory, and selected `compile_commands.json` +entry when used. Parsed declarations from compiler mode carry +`origin: "preprocessed"`. Explicit or directory-discovered `.i` inputs are +also parsed as preprocessed source and record `preprocessed_source_path` plus +mapped `original_source_paths` when linemarkers supply original filenames. ## JSON Parse Schema @@ -298,6 +442,9 @@ language filename parser_status preprocessing +preprocessing_recipe # present for x2py-generated compiler input +preprocessed_source_path # present for direct .i input +original_source_paths # present when linemarkers identify original files functions structs unions @@ -476,7 +623,21 @@ Completed order: and invalid-use diagnostics, plus explicit bit-field regression coverage. 15. Added C array/function parameter adjustment while preserving written parameter type facts in `declared_type`. - -Next implementation work should continue with tag/typedef resolution, -preprocessed-input line mapping, compiler extension policy, and project -resolution while keeping the explicit `--language c` gate in place. +16. Added compiler/preprocessed `#line` and GCC/Clang linemarker remapping for + parsed source locations, parser diagnostics, and fatal parse errors. +17. Added optional JSON preprocessing recipes for x2py-generated compiler + streams in C and Fortran, plus internal Fortran `-D`/`-U` selection. +18. Added C declaration-level preprocessed origin metadata and direct `.i` + discovery/source-identity handling. +19. Preserved braced and designated initializer source text as `CInitializer` + facts on parsed file-scope variables. +20. Parsed nested anonymous struct/union members as concrete member types, + including recursively mapped preprocessed provenance. +21. Added `_Atomic(type)` type-specifier parsing on the shared declarator path + and executable parser-developer walkthrough tests. +22. Added compiler-derived standard-header ABI probing for future C semantic + mapping without hard-coded host type aliases. + +Next implementation work should continue with fixture-driven compiler +extension policy and broader project conflict policy +while keeping the explicit `--language c` gate in place. diff --git a/docs/c_parser/c_parser_implementation_checklist.md b/docs/c_parser/c_parser_implementation_checklist.md index 4eac2ca0f..9d3d5f962 100644 --- a/docs/c_parser/c_parser_implementation_checklist.md +++ b/docs/c_parser/c_parser_implementation_checklist.md @@ -1,1147 +1,41 @@ -# C Parser Implementation Checklist +# C Parser Remaining Work Checklist -Status: implementation checklist with Phase 1 skeleton, Phase 2 parser/error -golden workflow, selected Phase 3 model/error work, Phase 4 raw -lexer/directive metadata, a first Phase 5/6 partial declaration/function -subset including top-level redeclaration handling, and selected Phase 8 project -include/index work complete. The -`c_parser` package and explicit C -parse path exist, and simple variables, typedefs, function prototypes, -function-definition signatures, function-definition start/end locations, and -incomplete `struct`/`union` declarations and basic aggregate definitions are -now parsed. Declarators use a recursive grammar-style parser for pointer, -array, function, and parenthesized combinations. Declaration types are concrete -`CType` subclasses combined by `CComposedType`; aggregate members are -`CVariable` objects using the same declared-type path. Selected unsupported -extensions and C++-shaped declarations are diagnosed, and invalid -primitive-specifier combinations raise `CParseError` without treating -unresolved single typedef-name uses as invalid. -Aggregate members carry their own source locations, and flexible array -members are classified and checked for supported struct/union constraints. -Function parameters preserve written array/function forms in `declared_type` -while exposing C-adjusted pointer forms in `type`. Raw conditional directives -and macro-shaped declarations, including object-like declaration prefixes, are -stored as metadata. Project parsing now -records include graphs, system and unresolved includes, functions by file, -enum constants, header/source pairings, and basic cross-file typedef/tag -resolution with incomplete tag completion. Compatible top-level prototypes, -tentative file-scope variables, and repeated typedefs are merged; duplicate -definitions and incompatible redeclarations produce diagnostics. Local -declarations inside function bodies are intentionally ignored. +Status: forward backlog only. Completed historical implementation items were +moved into `docs/c_parser/c_parser_reference.md`; this file keeps only work +that still needs a decision, implementation, tests, or release validation. -This checklist is intentionally detailed so future work can proceed one branch, -one checklist item, and one tested capability at a time. The C parser initiative -must remain isolated from project `main` until the frontend is mature and -stable. +## Step 1: Parser Cleanup Before C Semantics -## Progress Snapshot - -- Last updated: 2026-05-24 -- Checklist progress: 630/872 checked (72.2%). -- Current parser status: partial C parser with raw directive metadata, top-level - source splitting, simple declarations/variables/typedefs, prototype-style - metadata, K&R diagnostics, simple function signatures, and start/end - locations for function definitions. Incomplete struct/union declarations are - recorded as `CStruct`/`CUnion` values with `is_incomplete=True`; named tags - are indexed at project level. Parenthesized declarators, function pointer - typedefs/parameters, callback members, and functions returning function - pointers are represented with concrete `CType` objects and - `CComposedType.components`. Primitive specifiers have concrete type classes, - valid spelling permutations are normalized, invalid combinations raise - `CPARSE003`, and functions, variables, typedefs, and aggregates are - distinguished by their concrete declaration objects rather than a kind field. - Struct and union fields now preserve per-member locations; legal final - flexible struct members are marked through `CArray.is_flexible`, with error - diagnostics for invalid placement or union use, and function signatures that - use unions by value produce conservative parser diagnostics. Array and - function parameter declarations preserve their source form in `declared_type` - while their effective `type` applies C parameter-to-pointer adjustment. Raw - conditional directives, pragmas including OpenMP declaration pragmas, and - macro-shaped declaration dependencies, including object-like declaration - prefixes, are recorded as metadata. `parse_c_project` - returns project include/index facts and - resolves basic cross-file typedef and tag references while preserving - unresolved references for later diagnostics. Top-level compatible - redeclarations are merged, matching prototypes plus definitions prefer the - definition while preserving declaration locations, C++-shaped declarations - are diagnosed instead of modeled as C objects, and duplicate/conflicting - top-level declarations produce diagnostics. - -## Global Rules - -- [ ] Keep all C parser work on `c-parser/main` and child branches until the - frontend is stable. -- [ ] Do not merge C parser work directly into project `main`. -- [ ] Keep the Fortran parser behavior unchanged unless a future task - explicitly requires shared infrastructure changes. -- [x] Put C parser implementation in a separate `c_parser` package. -- [x] Keep C parser tests separated from existing Fortran tests. -- [x] Gate all integration through explicit C flags or C-specific APIs. +- [ ] Keep Fortran parser behavior unchanged unless a future task explicitly + requires shared infrastructure changes. - [ ] Keep any C wrappability assessment in the semantic layer, not inside the parser package. -- [x] Implement C parsing as a grammar-style recursive parser with scoped - visitors, source slicing, shared declaration/declarator parsing helpers, - and typed model objects. -- [x] Store initial C-specific facts in `c_parser/models.py`; defer semantic IR - extensions until the C parser models prove what information is needed. -- [ ] Keep the C parser main-merge guard active for C parser branches and - paths. -- [ ] Require the `c-parser-ready-for-main` label only for the final approved - merge into project `main`. -- [x] Do not implement a giant regex parser. -- [x] Do not implement a whole-file scanner as the core architecture. -- [x] Do not make libclang the only parser architecture. -- [ ] Do not make compiler preprocessing a replacement for x2py parser models, - source locations, diagnostics, or project indexes. -- [x] Preserve the semantic IR layer as the source of truth. -- [x] Treat documentation as a first-class deliverable in every phase. -- [ ] Whenever C parser behavior, models, CLI behavior, tests, fixture - workflows, semantic integration, or `.pyi` behavior change, update every - affected file under `docs/c_parser/` in the same change. Do not wait for - a separate documentation request. -- [x] Update this checklist when implementation reality changes. - -## Phase 0: Repository Inspection, Branch Setup, And Roadmap - -Branch target: - -- `c-parser/main` -- `c-parser/phase-0-roadmap` - -Scope: - -- Planning only. -- Documentation only. -- No parser package. -- No parser logic. -- No CLI code changes. -- No fixture generation. - -### Branch And Isolation Tasks - -- [x] Start from project `main`. -- [x] Create long-lived integration branch `c-parser/main`. -- [x] Create planning branch `c-parser/phase-0-roadmap` from - `c-parser/main`. -- [x] Merge `c-parser/phase-0-roadmap` back into `c-parser/main`. -- [x] Confirm `main` has no C parser planning commits unless intentionally - merged later after stabilization. -- [x] Record the branch strategy in C parser docs. -- [x] Use `codex: ...` prefix for planning commit message. - -### Repository Inspection Tasks - -- [x] Inspect `README.md`. -- [x] Inspect `fortran_parser.md`. -- [x] Inspect `parser_implementation_reference.md`. -- [x] Inspect `Semantic_Multilanguage_Wrapper_Runtime_Architecture.md`. -- [x] Inspect `docs/pyi_format.md`. -- [x] Inspect `fortran_parser/lexer.py`. -- [x] Inspect `fortran_parser/parser.py`. -- [x] Inspect `fortran_parser/models.py`. -- [x] Inspect `fortran_parser/type_resolver.py`. -- [x] Inspect `fortran_parser/utils.py`. -- [x] Inspect `fortran_parser/cli.py`. -- [x] Inspect `x2py/cli.py`. -- [x] Inspect `x2py/__init__.py`. -- [x] Inspect `semantics/models.py`. -- [x] Inspect `semantics/fortran2ir.py`. -- [x] Inspect `semantics/pyi_printer.py`. -- [x] Inspect `semantics/pyi_parser.py`. -- [x] Inspect parser CLI tests. -- [x] Inspect parser public entrypoint tests. -- [x] Inspect parser developer tutorial tests. -- [x] Inspect semantic wrap-readiness tests. -- [x] Inspect parser error handling tests. -- [x] Inspect parser fixture/golden suite. -- [x] Inspect parser golden regeneration script. -- [x] Inspect parser error golden regeneration script. -- [x] Inspect semantic conversion tests. -- [x] Inspect semantic fixture generator. -- [x] Inspect `.pyi` tests. -- [x] Inspect `.pyi` fixture generator. -- [x] Avoid spending analysis on ignored Fortran source fixtures except file - layout and fixture workflow. -- [x] Avoid spending analysis on generated JSON fixtures. - -### Planning Document Tasks - -- [x] Create `docs/c_parser/`. -- [x] Create `docs/c_parser/c_parser_reference.md`. -- [x] Create `docs/c_parser/c_parser_architecture.md`. -- [x] Create `docs/c_parser/c_parser_cli_workflow.md`. -- [x] Create `docs/c_parser/c_parser_implementation_checklist.md`. -- [x] Create `docs/c_parser/c_parser_main_merge_guard.md`. -- [x] Document the branch isolation strategy. -- [x] Document the main-merge guard policy. -- [x] Document Fortran parser architecture observations. -- [x] Document proposed C parser package layout. -- [x] Document public API shape. -- [x] Document CLI command shape. -- [x] Document early skeleton CLI behavior. -- [x] Document JSON schema direction. -- [x] Document semantic readiness direction. -- [x] Document semantic IR mapping direction. -- [x] Document `.pyi` integration direction. -- [x] Document v1 non-goals. - -### Phase 0 Definition Of Done - -- [x] Planning docs exist under `docs/c_parser/`. -- [x] Docs clearly say no parser implementation exists yet. -- [x] Docs make CLI and documentation Phase 1 deliverables. -- [x] Docs preserve the grammar-style parser requirement. -- [x] Docs preserve project-main isolation. -- [x] Main-merge guard policy is documented. -- [x] Planning branch is committed. -- [x] Planning branch is merged into `c-parser/main`. - -### Phase 0 Test Expectations - -- [x] No test changes are required in Phase 0. -- [x] Run a documentation-safe sanity command such as `git status`. -- [x] Do not regenerate fixtures. -- [x] Do not run parser golden update scripts. - -### Phase 0 Risks And Open Questions - -- [x] Decide whether the future package should be named `c_parser` or another - name before code lands. -- [x] Decide whether `x2py.__init__` should expose C APIs during skeleton phase - or wait until Phase 3 models are useful. -- [x] Decide whether C debug env var should be `C_PARSER_DEBUG` or generic - `X2PY_DEBUG`. - -## Phase 1: CLI And Documentation Skeleton First - -Branch target: - -- `c-parser/phase-1-cli-and-docs` - -Scope: - -- User-visible command shape. -- Documentation skeleton. -- Placeholder C parser reports. -- CLI tests. -- No real parser logic. - -### Documentation Tasks - -- [x] Update `docs/c_parser/c_parser_cli_workflow.md` with implemented command - examples. -- [x] Update `docs/c_parser/c_parser_reference.md` with skeleton CLI behavior. -- [x] Add a "Current Status" section showing which C features are placeholder - only. -- [x] Document how C parser output differs from Fortran parser output. -- [x] Document that auto-detection is deferred. -- [x] Document that `--language c` is required initially. -- [x] Document unsupported `--semantics --language c` behavior. -- [x] Document unsupported `--pyi --language c` behavior. -- [x] Document C parser diagnostics even if only skeleton diagnostics exist. -- [x] Add examples for parse tree, JSON, and output file behavior. - -### CLI Design Tasks - -- [x] Add `--language {fortran,c}` to `x2py.cli`. -- [x] Preserve current Fortran behavior when `--language` is omitted. -- [x] Make `--language fortran` equivalent to current behavior. -- [x] Add explicit C parse path behind `--language c --parse`. -- [x] Decide not to add `--parse-c` alias in this phase. -- [ ] If `--parse-c` is added, make it an alias for `--language c --parse`. -- [x] Reject `--language c` without a supported stage flag. -- [x] Reject `--language c --semantics` until Phase 10. -- [x] Reject `--language c --pyi` until Phase 11. -- [x] Reject Fortran-only flags in C mode if they do not apply. -- [x] Keep `--json` behavior stable for parse output. -- [x] Keep `--out` behavior stable for C parse JSON. -- [x] Keep `--no-color` accepted in C mode. -- [x] Keep `--debug-traceback` accepted in C mode. -- [x] Do not change `fortran_parser.cli` unless a compatibility reason is - documented. - -### Skeleton Report Tasks - -- [x] Create a minimal C report provider without real parsing. -- [x] Ensure skeleton C report can accept `.c` and `.h` paths. -- [x] Ensure skeleton C report can accept directories only in explicit C mode. -- [x] Return `language: "c"` in C JSON output. -- [x] Return `parser_status: "skeleton"` in C JSON output. -- [x] Return empty `functions` list. -- [x] Return empty `structs` list. -- [x] Return empty `unions` list. -- [x] Return empty `enums` list. -- [x] Return empty `typedefs` list. -- [x] Return empty `variables` list. -- [x] Return `macros` list, empty until raw macro directives are found. -- [x] Return `includes` list, empty until raw include directives are found. -- [x] Return `diagnostics` list, empty unless skeleton or raw metadata - diagnostics are found. -- [x] Human tree output should show zero-count C sections and skeleton status. - -### CLI Test Tasks - -- [x] Add C CLI tests in a C-specific test file, for example - `tests/parser/test_c_cli_skeleton.py` or `tests/c_parser/test_cli.py`. -- [x] Test existing Fortran CLI behavior still passes. -- [x] Test `--help` shows `--language`. -- [x] Test `--language c --parse` accepts a temporary `.h` file. -- [x] Test `--language c --parse --json` emits valid JSON. -- [x] Test `--language c --parse --out report.json` writes JSON and suppresses - stdout. -- [x] Test `--language c --semantics` returns argparse error or clear - unsupported-stage error. -- [x] Test `--language c --pyi` returns argparse error or clear - unsupported-stage error. -- [x] Test `--language c --parse --show-vars` is rejected or ignored with - documented behavior. -- [x] Test `--parse` without `--language` remains Fortran behavior. -- [ ] If `--parse-c` is added, test it maps to C parse mode. -- [x] Test `--no-color` is accepted in C mode. -- [x] Test `NO_COLOR=1` is honored once C diagnostics exist. -- [x] Test `--debug-traceback` is accepted in C mode. - -### Phase 1 Definition Of Done - -- [x] Users can discover C mode from CLI help. -- [x] Users can run a stable C parse skeleton command. -- [x] C JSON skeleton output has a documented schema. -- [x] Fortran CLI behavior is unchanged. -- [x] Documentation includes the exact command workflow. -- [x] Tests cover the skeleton command workflow. - -### Phase 1 Risks And Open Questions - -- [x] Decide whether to implement a temporary skeleton module inside - `x2py.cli` or create `c_parser/cli.py` early. -- [x] Decide whether skeleton output should include zero-count sections in - human output or omit empty sections like Fortran. -- [x] Decide whether `--json` should eventually support semantic C output or - stay parse-only. - -## Phase 2: Testing Infrastructure - -Branch target: - -- `c-parser/phase-2-testing` - -Scope: - -- Test directories, fixtures, golden scripts, and update workflow. -- Minimal placeholder fixtures are allowed. -- Skipped roadmap tests are allowed before parser implementation exists. -- No real parser logic unless needed to support skeleton output already added. - -### Test Layout Tasks - -- [x] Create a dedicated C parser test area. -- [x] Choose between `tests/c_parser/` and `tests/parser/c/` for focused C - parser tests. -- [x] Create `tests/data/c/general/`. -- [x] Create `tests/data/c/errors/parser/`. -- [x] Create `tests/data/c/corpus/`. -- [x] Create `tests/data/c/scientific/`. -- [x] Add `tests/data/c/json/` real-world partial-parser regression inputs. -- [x] Add `tests/data/c/tinyexpr/` real-world partial-parser regression inputs. -- [x] Add `tests/data/c/linmath/` header-only partial-parser regression input. -- [x] Add `tests/data/c/nanosvg/` dependent-header partial-parser regression - inputs. -- [x] Add top-level `tests/data/c/stb/` single-file library regression inputs - without vendoring nested repository metadata as fixtures. -- [x] Create `tests/parser/c/fixtures/general/`. -- [x] Create `tests/parser/c/fixtures/json/`. -- [x] Create `tests/parser/c/fixtures/tinyexpr/`. -- [x] Create `tests/parser/c/fixtures/linmath/`. -- [x] Create `tests/parser/c/fixtures/nanosvg/`. -- [x] Create `tests/parser/c/fixtures/stb/`. -- [x] Create `tests/parser/c/fixtures/errors/`. -- [x] Keep C fixture data separate from Fortran fixture data. -- [x] Add README files explaining each C fixture directory. -- [x] Add small `.h` and `.c` fixture files for C fixture coverage. - -### Skipped Roadmap Test Policy - -- [x] Add skipped C parser roadmap tests before implementation starts. -- [x] Keep every roadmap test skipped until its implementation branch lands. -- [x] Keep `c_parser` imports inside skipped test functions, not at module - import time, so collection works before the package exists. -- [x] Use the skipped tests as an executable checklist for future branches. -- [x] Unskip tests one capability at a time. -- [x] In each implementation branch, unskip only the tests covered by that - branch. -- [x] Do not unskip broad fixture, corpus, semantic, or `.pyi` tests before - the supporting workflow exists. -- [x] When a skipped test is unblocked, replace placeholder expectations with - the exact implemented model fields if the final schema differs. -- [x] Keep the skipped C suite separate from existing Fortran tests. -- [x] Keep Fortran tests green whenever C tests are unskipped. - -### Roadmap And Active Test Files - -- [x] Create `tests/parser/c/README.md` with the staged unskip policy. -- [x] Consolidate implemented public API roadmap coverage into - `tests/parser/c/test_c_public_api_skeleton.py`. -- [x] Consolidate implemented CLI roadmap coverage into - `tests/parser/c/test_c_cli_skeleton.py`. -- [x] Create `tests/parser/c/test_c_lexer_preprocessor.py`. -- [x] Create `tests/parser/c/test_c_declarations_and_declarators.py`. -- [x] Create `tests/parser/c/test_c_functions.py`. -- [x] Create `tests/parser/c/test_c_structs_unions_enums_typedefs.py`. -- [x] Consolidate implemented project/include roadmap coverage into - `tests/parser/c/test_c_project_resolution.py`. -- [x] Create `tests/semantics/test_c_semantic_readiness.py` or equivalent - semantic-layer coverage for C wrappability once that layer exists. -- [x] Create `tests/parser/c/test_c_fixture_suite.py`. -- [x] Create `tests/parser/c/test_c_error_fixture_suite.py`. -- [x] Create `tests/parser/c/test_c_json_sanity.py`. -- [x] Create `tests/parser/c/test_c_corpus.py`. - -### Golden Workflow Tasks - -- [x] Create `tests/parser/c/generate_c_parser_goldens.py`. -- [x] Mirror the Fortran parser golden generator structure. -- [x] Serialize only dataclass/JSON-stable C parse models. -- [x] Strip parent/back-reference fields if future models need them. -- [x] Generate one `CProject` golden per same-stem fixture group, pairing - `.c` and `.h` inputs when both exist. -- [x] Order `.c` before its matched `.h` project input to mirror compilation - while include-expanded parsing remains deferred. -- [x] Support explicit dependent-header project groups ordered from included - header to dependent header. -- [x] Generate separate one-file project goldens for STB single-file library - inputs. -- [x] Regenerate all fixtures with the standalone golden script. -- [x] Regenerate selected fixtures with the standalone golden script. -- [x] Regenerate full C golden suites from comparison tests when - `C_PARSER_UPDATE_GOLDENS=1` is set. -- [x] Create a C error golden generator. -- [x] Store expected error type, message fragments, diagnostic fragments, and - parser entrypoint metadata. - -### Focused Test Buckets - -- [x] Add lexer test file. -- [x] Add preprocessor test file. -- [x] Add declaration-specifier test file. -- [x] Add declarator test file. -- [x] Add function parser test file. -- [x] Add struct/union/enum parser test file. -- [x] Add typedef parser test file. -- [x] Add macro/constant parser test file. -- [x] Add project/include parser test file. -- [x] Add semantic readiness test file when C semantic conversion exists. -- [x] Add public entrypoint test file. -- [ ] Add developer tutorial test file once internal helpers exist. -- [x] Add CLI test file. -- [x] Add fixture/golden test file. -- [x] Add error fixture/golden test file. -- [ ] Add semantic conversion tests in Phase 10. -- [ ] Add `.pyi` tests in Phase 11. - -### Phase 2 Definition Of Done - -- [x] C test directory structure is present. -- [x] C fixture directory structure is present. -- [x] C golden update workflow is documented. -- [x] Partial parser and metadata tests pass against current behavior. -- [x] Fortran tests still pass. -- [x] No real parser claims are made without tests. - -### Phase 2 Test Expectations - -- [x] Run the skipped C roadmap suite and confirm it collects without importing - `c_parser` at module import time. -- [x] Run C skeleton CLI tests. -- [x] Run existing parser CLI tests. -- [x] Run a small targeted test command, for example - `python -m pytest -q tests/parser/test_cli.py tests/parser/test_c_cli_skeleton.py`. -- [x] Do not update Fortran goldens. - -### Phase 2 Risks And Open Questions - -- [x] Decide how much C fixture data is appropriate before parser behavior - exists. -- [x] Decide whether C parser tests should live alongside Fortran parser tests - or under a new top-level C test package. - -## Phase 3: Parser Package Skeleton, Models, And Serialization Contracts - -Branch target: - -- `c-parser/phase-3-models` - -Scope: - -- Create the `c_parser` package. -- Define typed models. -- Define serialization helper contracts. -- Keep actual grammar parsing minimal or placeholder. - -### Package Skeleton Tasks - -- [x] Create `c_parser/__init__.py`. -- [x] Create `c_parser/__main__.py`. -- [x] Create `c_parser/models.py`. -- [x] Create `c_parser/parser.py`. -- [x] Create `c_parser/lexer.py`. -- [x] Create `c_parser/preprocessor.py`. -- [x] Create `c_parser/type_resolver.py`. -- [x] Create `c_parser/project.py`. -- [x] Create `c_parser/cli.py`. -- [x] Create `c_parser/utils.py`. -- [x] Add `c_parser*` to package discovery in `pyproject.toml`. -- [x] Add `c_parser` to coverage source when implementation begins. -- [x] Keep imports from `x2py.cli` explicit and isolated. -- [x] Keep parser orchestration and helper internals on `CParser`, matching the - Fortran parser class structure. - [ ] Split `CParser` internals into smaller visitor/helper classes only if the class grows past what remains readable. - -### Error Model Tasks - -- [x] Implement `CParseError` as a `ValueError` subclass. -- [x] Include `filename`. -- [x] Include `line_number`. -- [x] Include `column`. -- [x] Include `source_line`. -- [x] Include `base_message`. -- [x] Include `code`. -- [x] Include parser raise location for debug diagnostics. -- [x] Implement `format_diagnostic(color=False, debug=None)`. -- [x] Use C diagnostic code prefix such as `CPARSE001`. -- [x] Add color handling equivalent to `FortranParseError`. -- [x] Add optional C debug env var. -- [x] Test C parse error attributes. -- [x] Test compiler-style diagnostic rendering. -- [x] Test color and no-color behavior. -- [x] Test debug note behavior. - -### Model Tasks - -- [x] Define `CSourceLocation`. -- [x] Define `CDiagnostic`. -- [x] Define concrete `CType` subclasses, including all supported primitive - scalar and complex types. -- [x] Define `CQualifier` objects (`CConst`, `CVolatile`, `CRestrict`, and - `CAtomic`). -- [x] Define `CPointer`, `CArray`, `CFunctionType`, and `CComposedType`. -- [x] Define `CParameter`. -- [x] Define `CFunction`. -- [x] Use `CVariable` for struct and union members rather than a separate - field object. -- [x] Define `CStruct`. -- [x] Define `CUnion` or use `CStruct(is_union=True)`. -- [x] Define `CEnum`. -- [x] Define `CEnumerator`. -- [x] Define `CTypedef`. -- [x] Define `CVariable`. -- [x] Define `CMacro`. -- [x] Define `CInclude`. -- [x] Define `CFile`. -- [x] Define `CProject`. -- [x] Add helper properties for pointer depth. -- [x] Add helper properties for array rank. -- [x] Preserve effective declaration type source text. -- [x] Store qualifiers on the exact `CType` component they qualify. -- [x] Record incomplete aggregate tags with `is_incomplete=True`. -- [x] Add helper properties for source-location display. - -### Serialization Tasks - -- [x] Add `_to_dict` or equivalent serialization helper. -- [x] Avoid cycles in JSON. -- [x] Keep source locations JSON-serializable. -- [x] Decide whether sets serialize as sorted lists. -- [x] Ensure dataclass defaults produce stable JSON. -- [x] Add tests for empty `CFile` serialization. -- [x] Add tests for each model's minimal JSON shape. -- [x] Add tests for source-location serialization. -- [x] Add tests that unknown/unresolved metadata is preserved. - -### Public API Skeleton And Partial Parser Tasks - -- [x] Implement `CParser` class. -- [x] Implement `CParser.visit_file` returning partial parser `CFile` models. -- [x] Implement `CParser.visit_project` returning partial parser `CProject` - models. -- [x] Implement module-level `_DEFAULT_PARSER`. -- [x] Implement `parse_c_file`. -- [x] Implement `parse_c_project`. -- [x] Add public API tests for source strings. -- [x] Add public API tests for file paths. -- [x] Add public API tests for empty source. -- [x] Add public API tests for unknown suffix. -- [x] Change parser status from `skeleton` to `partial` once real declaration - and function facts are populated. -- [x] Add tests that public API output contains parsed functions and project - indexes for the supported subset. - -### Phase 3 Definition Of Done - -- [x] `c_parser` imports cleanly. -- [x] Partial public APIs return typed models. -- [x] JSON serialization is stable and tested. -- [x] C CLI uses `c_parser` rather than a temporary inline provider. -- [x] Fortran parser API remains unchanged. -- [x] Docs describe the new package and API status. - -### Phase 3 Risks And Open Questions - -- [x] Decide whether `CUnion` should subclass/share `CStruct`. -- [x] Decide how to represent anonymous structs/unions/enums. -- [ ] Decide whether macros belong in `CFile.macros` only or also symbols. -- [x] Decide on concrete `CType` objects and name-outward - `CComposedType.components` instead of a kind-driven type reference. - -## Phase 4: Lexer And Lightweight Preprocessor - -Branch target: - -- `c-parser/phase-4-lexer` - -Scope: - -- Token/source normalization. -- Comments, continuations, directives, includes, simple macro metadata. -- No internal full macro expansion. -- Raw-source directive metadata first; compiler-assisted preprocessing is the - required path when macros affect public declaration text. - -### Lexer Tasks - -- [x] Preserve original line numbers for all logical records. -- [x] Preserve original source lines for diagnostics. -- [x] Remove block comments `/* ... */` without losing line accounting. -- [x] Remove line comments `// ...`. -- [x] Avoid stripping comment markers inside string literals. -- [x] Avoid stripping comment markers inside character literals. -- [x] Handle escaped quotes inside literals. -- [x] Fold backslash-newline continuations. -- [x] Preserve preprocessor directive line locations. -- [x] Produce token records or logical line records with filename, line, column, - and text. -- [x] Track braces, parentheses, and brackets. -- [x] Add top-level split helpers aware of nesting and literals. -- [x] Add tests for comment stripping. -- [x] Add tests for multiline block comments. -- [x] Add tests for string literal comment markers. -- [x] Add tests for char literal escapes. -- [x] Add tests for backslash-newline continuations. -- [x] Add tests for line/column preservation. - -### Preprocessor Metadata Tasks - -- [x] Recognize `#include "local.h"`. -- [x] Recognize `#include `. -- [x] Store include spelling and include kind. -- [x] Resolve local includes relative to current file when possible. -- [x] Preserve unresolved includes as diagnostics, not hard errors by default. -- [x] Recognize object-like `#define NAME value`. -- [x] Recognize function-like `#define NAME(...) body`. -- [x] Store function-like macros as unsupported/deferred metadata. -- [x] Recognize `#undef`. -- [x] Record conditional directive presence (`#ifdef`, `#ifndef`, `#if`, - `#elif`, `#else`, `#endif`) as provenance metadata if needed. -- [x] Do not select active branches in raw mode. -- [x] Do not implement a parser-side `defined(NAME)`, `&&`, `||`, `!`, `0`, - and `1` evaluator for C API extraction unless a later design explicitly - justifies it. -- [x] Mark macro-shaped declarations as unsupported/deferred in raw mode. -- [x] Defer declarations prefixed by object-like macros in raw mode instead of - reporting invalid type specifier sequences. -- [x] Store macro-dependency metadata in C parser models. -- [x] Store preprocessing mode metadata in `CFile`. -- [x] Store raw directive metadata separately from compiler-preprocessor - configuration metadata. -- [x] Do not implement general macro expansion. -- [x] Do not expand token-paste or stringify macros. -- [x] Do not attempt recursive compiler-compatible macro expansion inside - x2py. -- [x] Add tests for include collection. -- [x] Add tests for object-like macro collection. -- [x] Add tests for function-like macro diagnostics. -- [x] Add tests for object-like macro declaration-prefix deferral. -- [x] Do not misclassify `#if MACRO(...)` or body `else if (...)` forms as - K&R-style definitions. -- [x] Add tests that raw conditional directives do not select active branches. -- [x] Add tests that macro-generated declarations are deferred in raw mode. - -### Compiler-Assisted Preprocessing Tasks - -- [ ] Design a preprocessed-input mode for `.i` files. -- [ ] Design an optional compiler invocation mode for `cc -E` or `clang -E`. -- [x] Document that compiler-assisted preprocessing is required when macros - affect names, types, declarators, attributes, storage classes, calling - conventions, visibility annotations, or active conditional branches. -- [ ] Preserve `#line` markers from compiler-preprocessed input. -- [ ] Map diagnostics from preprocessed declarations back to original files. -- [ ] Map parsed model `source_location` fields from preprocessed declarations - back to original files. -- [ ] Mark preprocessed declarations with origin metadata. -- [ ] Store the preprocessor command/configuration in `CFile` or `CProject`. -- [ ] Store original and preprocessed source paths when both exist. -- [ ] Store macro defines, undefines, include dirs, and compiler/preprocessor - executable used to produce the preprocessed stream. -- [ ] Add tests for parsing a simple `.i` file. -- [ ] Add tests for `#line` source mapping. -- [ ] Add tests that macro-generated declarations are parseable only when they - appear in preprocessed input. - -### Phase 4 Definition Of Done - -- [x] Lexer/preprocessor preserves source locations. -- [x] Includes and macros are collected as metadata. -- [x] Raw conditional directives are handled as metadata/provenance only, not - parser-side branch selection. -- [x] No arbitrary macro expansion is attempted. -- [x] Compiler-assisted preprocessing has a documented design path for - macro-heavy APIs. -- [ ] Tests cover comments, continuations, directive metadata, raw macro - deferral, and preprocessed line mapping. - -### Phase 4 Risks And Open Questions - -- [x] Decide whether to tokenize fully now or keep logical records until - declarator parsing requires tokens. -- [x] Decide whether system headers are recorded only or optionally searched. -- [x] Decide whether `#pragma` should become diagnostics or metadata. -- [ ] Decide whether compiler invocation belongs in Phase 4 or a later - project-resolution phase. - -## Phase 5: Declarations And Declarators - -Branch target: - -- `c-parser/phase-5-declarations` - -Scope: - -- Shared C declaration parser. -- Declarator model and type construction. -- No broad function/project behavior beyond declarations. - -### Declaration Specifier Tasks - -- [x] Parse storage class `typedef`. -- [x] Parse storage class `extern`. -- [x] Parse storage class `static`. -- [x] Parse storage class `register`. -- [x] Parse storage class `_Thread_local`. -- [x] Parse qualifier `const`. -- [x] Parse qualifier `restrict`. -- [x] Parse qualifier `volatile`. -- [x] Parse qualifier `_Atomic` as basic metadata. -- [x] Parse `void`. -- [x] Parse `char`. -- [x] Parse `signed char`. -- [x] Parse `unsigned char`. -- [x] Parse `short`. -- [x] Parse `short int`. -- [x] Parse `unsigned short`. -- [x] Parse `int`. -- [x] Parse `unsigned`. -- [x] Parse `unsigned int`. -- [x] Parse `long`. -- [x] Parse `long int`. -- [x] Parse `unsigned long`. -- [x] Parse `long long`. -- [x] Parse `unsigned long long`. -- [x] Parse `float`. -- [x] Parse `double`. -- [x] Parse `long double`. -- [x] Parse `_Bool`. -- [x] Parse `_Complex` as deferred or supported with explicit tests. -- [x] Parse `struct name`. -- [x] Parse `union name`. -- [x] Parse `enum name`. -- [x] Parse typedef-name references. -- [x] Preserve original declaration specifier text. -- [x] Diagnose invalid primitive specifier sequences while deferring unresolved - single typedef-name references to project/type resolution. - -### Declarator Tasks - -- [x] Parse identifier declarators. -- [x] Parse pointer declarators. -- [x] Parse pointer qualifiers. -- [x] Parse array declarators. -- [x] Parse multidimensional array declarators. -- [x] Parse static array parameter qualifiers, for example `int a[static 4]`. -- [x] Parse parenthesized declarators. -- [x] Parse function declarators. -- [x] Parse function pointer declarators. -- [x] Parse abstract declarators where needed for unnamed parameters. -- [x] Parse multiple declarators in one declaration. -- [x] Keep declarator entity order stable. -- [x] Preserve original declarator source text. -- [x] Add source locations for each declared entity. -- [x] Reject or diagnose unsupported declarator forms explicitly. - -### Shared Declaration Backend Tasks - -- [x] Implement a helper analogous to `_helper_parse_declaration_line`. -- [x] Feed procedure parameters through the same declaration backend. -- [x] Preserve array/function parameter `declared_type` while exposing the - C-adjusted pointer `type`. -- [x] Feed function return types through the same declaration backend. -- [x] Feed struct/union members through the same declaration backend. -- [x] Feed typedefs through the same declaration backend. -- [x] Feed file-scope variables/constants through the same declaration backend. -- [x] Apply declaration specifiers to declarator-derived type layers. -- [x] Normalize supported C type spelling into concrete `CType` subclasses. -- [x] Preserve typedef references before project resolution. -- [x] Add tests for each declaration role. -- [x] Add tests for declarations with multiple variables. -- [x] Add tests for declarations with initializers. -- [x] Add tests that local executable statements are not parsed as declarations. -- [x] Add exhaustive tests for every supported storage class. -- [x] Add exhaustive tests for every supported type qualifier. -- [x] Add exhaustive tests for every supported primitive spelling. -- [x] Add tests for typedef-name references outside `size_t`-style examples. -- [x] Add tests for `struct name`, `union name`, and `enum name` references in - variables and parameters. -- [x] Add tests for multidimensional arrays. -- [x] Add diagnostics for declarations ignored by the current partial parser. -- [ ] Add structured source facts for declarations that depend on macros. - -### Top-Level Redeclaration Tasks - -- [x] Merge compatible repeated file-scope tentative variable declarations. -- [x] Prefer initialized file-scope definitions over earlier tentative - declarations. -- [x] Diagnose duplicate initialized file-scope variable definitions. -- [x] Diagnose conflicting file-scope variable redeclarations. -- [x] Complete incomplete struct tags from later same-file definitions. -- [x] Complete incomplete union tags from later same-file definitions. -- [x] Keep local declarations inside function bodies ignored in v1. - -Known declaration implementation gaps, with representative syntax: - -- braced/designated initializer preservation: - `int values[3] = {1, 2, 3};` -- nested anonymous aggregate members: - `struct outer { struct { int x; } inner; };` -- cross-declaration resolution/conflict behavior: - `typedef unsigned long size_t; size_t count(void);` -- preprocessed declarations with line mapping: - `#define API(ret) ret` followed by `API(int) run(void);` - -Represented shapes with dedicated active regression tests: - -- multi-level qualifier placement: - `const int * const * volatile chain;` - -### Phase 5 Definition Of Done - -- [x] Shared declaration/declarator parser exists. -- [x] It is used by all declaration roles available so far. -- [x] Primitive, pointer, array, typedef-name, and tag references have tests. -- [x] Unsupported declaration-shaped input raises `CParseError` or structured - diagnostics. - -### Phase 5 Risks And Open Questions - -- [x] Represent the currently supported pointer/array/function declarator - combinations as concrete type components and diagnose unconsumed forms. -- [x] Represent unresolved typedef-name uses as `CTypedef` type objects until - project/type resolution is implemented. - -## Phase 6: Function Parsing - -Branch target: - -- `c-parser/phase-6-functions` - -Scope: - -- Function prototypes and definitions. -- Signature extraction. -- Function body skipping by balanced brace slicing. - -### Function Prototype Tasks - -- [x] Classify top-level declarations ending with `;` as possible prototypes. -- [x] Parse return type through declaration/declarator backend. -- [x] Parse function name. -- [x] Parse ordered parameter list. -- [x] Preserve parameter names. -- [x] Preserve unnamed parameter types when legal. -- [x] Parse `void` parameter list as zero parameters. -- [x] Parse variadic marker `...`. -- [x] Mark `is_variadic`. -- [x] Parse pointer parameters. -- [x] Parse array parameters. -- [x] Parse function pointer parameters. -- [x] Parse `const` parameters. -- [x] Parse `restrict` parameters. -- [x] Parse `volatile` parameters. -- [x] Parse storage class `extern`. -- [x] Parse storage class `static`. -- [x] Add source locations. -- [x] Add tests for simple prototypes. -- [x] Add tests for no-argument prototypes. -- [x] Add tests for `void` arguments. -- [x] Add tests for pointer and array parameters. -- [x] Add tests for const pointer variants. -- [x] Add tests for variadic prototypes. -- [x] Add tests for function pointer parameters. -- [x] Add model field for prototype style so `int f(void)` and `int f()` can - be distinguished. -- [x] Add tests that distinguish explicit `void` parameter lists from - unspecified empty parameter lists. -- [x] Add parser source facts for variadic functions through `is_variadic`. -- [x] Add parser source facts for callback candidates once function pointer - parameters are supported. - -### Function Definition Tasks - -- [x] Classify top-level declarator followed by `{` as function definition. -- [x] Parse signature from the definition header. -- [x] Preserve `is_definition=True`. -- [x] Preserve function-definition start/end locations. -- [x] Add direct `start`/`end` model fields before preserving definition - ranges. -- [x] Skip function body contents for wrapper metadata. -- [x] Balance braces while respecting strings, chars, and comments. -- [x] Ignore local declarations for exported signatures in v1. -- [x] Reject or diagnose K&R style function definitions initially. -- [x] Add tests for simple definitions. -- [x] Add tests for nested braces in function body. -- [x] Add tests for strings containing braces. -- [x] Add tests for K&R unsupported diagnostics. -- [x] Detect K&R definitions before body skipping hides the old-style - declaration list. - -### Function Deduplication Tasks - -- [x] Merge matching prototype and definition in the same file. -- [x] Prefer definition metadata where useful. -- [x] Preserve both source locations if helpful. -- [x] Detect conflicting declarations. -- [x] Detect duplicate definitions. +- [ ] Decide whether macros belong only in `CFile.macros` or also in project + symbol indexes. +- [ ] If `--parse-c` is added, make it an alias for `--language c --parse` and + add CLI tests for the alias. - [ ] Allow same function under mutually exclusive preprocessor branches. -- [x] Add tests for prototype plus definition. -- [x] Add tests for conflicting prototypes. -- [x] Add tests for duplicate definitions. -- [x] Preserve declaration order before deduplicating prototypes and - definitions. - -### Phase 6 Definition Of Done - -- [x] Basic C function signatures parse from `.h` and `.c`. -- [x] Function bodies are skipped safely. -- [x] Variadic and supported function pointer cases are represented as typed - source facts. -- [x] CLI human and JSON output show functions. -- [ ] Parser diagnostics report no-functions only when appropriate. - -### Phase 6 Risks And Open Questions - -- [x] Decide whether inline functions in headers are definitions or prototypes - for wrapper purposes. -- [x] Decide how to handle attributes in function declarations before full - extension support exists. - -## Phase 7: Structs, Unions, Enums, And Typedefs - -Branch target: - -- `c-parser/phase-7-structs-enums` - -Scope: - -- C composite types and typedef aliases. - -### Struct Tasks - -- [x] Parse named `struct name { ... };`. -- [x] Parse forward declaration `struct name;`. -- [x] Parse anonymous `struct { ... }`. -- [x] Parse typedef anonymous struct `typedef struct { ... } name;`. -- [x] Parse typedef named struct `typedef struct tag name;`. -- [x] Parse members with shared declaration backend. -- [x] Parse pointer members. -- [x] Parse array members, including legal flexible final struct members with - invalid-placement and union diagnostics. -- [x] Parse nested anonymous structs as unsupported or metadata. -- [x] Parse bit-fields as member metadata with semantic limitations. -- [x] Preserve member order. -- [x] Preserve precise per-member source locations. -- [x] Mark incomplete structs. -- [x] Add tests for named structs. -- [x] Add tests for forward declarations. -- [x] Add tests for typedef structs. -- [x] Add tests for pointer members. -- [x] Add tests for array members. -- [x] Add tests for named, unnamed, and zero-width bit-field source facts and - locations; defer ABI/wrappability diagnostics to the semantic layer. - -### Union Tasks - -- [x] Parse named unions. -- [x] Parse forward union declarations. -- [x] Parse anonymous unions. -- [x] Parse typedef unions. -- [x] Parse union members with shared declaration backend. -- [x] Retain union member ownership through the containing `CUnion`. -- [x] Add diagnostics for by-value unions if unsafe. -- [x] Add tests for named unions. -- [x] Add tests for typedef unions. -- [x] Add tests for union diagnostics. - -### Enum Tasks - -- [x] Parse named enums. -- [x] Parse anonymous enums. -- [x] Parse typedef enums. -- [x] Parse enumerator names. -- [x] Parse explicit enumerator values. -- [x] Preserve symbolic enumerator values. -- [ ] Safely fold simple integer expressions. -- [x] Preserve expression text when folding is unsafe. -- [x] Add tests for plain enums. -- [x] Add tests for explicit values. -- [x] Add tests for expression values. -- [x] Add tests for typedef enums. - -### Typedef Tasks - -- [x] Parse primitive typedefs. -- [x] Parse pointer typedefs. -- [x] Parse array typedefs. -- [x] Parse function pointer typedefs. -- [x] Parse struct/union/enum typedefs. -- [x] Preserve alias chains before resolution. -- [x] Detect duplicate typedefs in same scope. -- [x] Add tests for typedef chains. -- [x] Add tests for primitive typedefs. -- [x] Add tests for opaque handle typedefs. -- [x] Add tests for function pointer typedef diagnostics. - -### Phase 7 Definition Of Done - -- [x] C composite and typedef models are populated from basic fixtures. -- [x] Shared declaration backend handles members and typedefs. -- [x] Validate legal and invalid flexible-array-member placement and retain - named, unnamed, and zero-width bit-field source facts with tests. -- [x] JSON goldens cover composite type schema. -- [x] Docs list supported and unsupported composite forms. - -### Phase 7 Risks And Open Questions - -- [x] Decide when anonymous structs should become generated internal names. +- [ ] Make parser diagnostics report "no functions found" only when + appropriate. +- [ ] Safely fold simple enum integer expressions, or document the exact + boundary for preserving expression text. - [ ] Decide how much enum expression folding is safe without compiler semantics. -- [ ] Decide how unions map to semantic IR, if at all in v1. - -## Phase 8: Include And Project Resolution - -Branch target: - -- `c-parser/phase-8-project-resolution` - -Scope: - -- Multi-file project parsing. -- Include graph. -- Type and typedef resolution. - -### File Discovery Tasks +- [ ] Decide whether unions map to semantic IR at all in v1. +- [ ] Feed C standard-type probe reports into C semantic conversion once the + C semantic converter exists. -- [x] Discover `.c` files in C mode. -- [x] Discover `.h` files in C mode. -- [ ] Decide whether `.i` is included now or later. -- [x] Keep Fortran directory scanning unchanged. -- [x] Support explicit file lists. -- [x] Support directory recursion only in explicit C mode. -- [x] Preserve deterministic file ordering. -- [x] Add tests for file discovery. - -### Include Resolution Tasks - -- [x] Resolve quoted includes relative to current file. -- [x] Resolve quoted includes through `include_dirs`. -- [x] Record unresolved quoted includes. -- [x] Record system includes without requiring local resolution by default. -- [x] Build `include_graph`. -- [x] Detect include cycles without crashing. -- [x] Preserve include spelling and resolved path separately. -- [x] Add tests for local includes. -- [x] Add tests for include dirs. -- [x] Add tests for missing includes. -- [x] Add tests for include cycles. - -### Project Index Tasks - -- [x] Index functions by name. -- [x] Index functions by file. -- [x] Index typedefs by name. -- [x] Index struct tags by tag namespace. -- [x] Index union tags by tag namespace. -- [x] Index enum tags by tag namespace. -- [x] Index enum constants in ordinary identifier namespace. -- [x] Index macros/constants separately. -- [x] Index variables by name. -- [x] Detect duplicate definitions. -- [x] Distinguish compatible redeclarations from conflicts. -- [x] Add tests for duplicate handling. -- [x] Add tests for project-level function indexes. -- [x] Add tests for project-level typedef indexes. -- [x] Add tests for project-level file-scope variable indexes. -- [x] Add tests for project-level macro indexes. - -### Type Resolution Tasks - -- [x] Resolve typedef chains. -- [x] Detect typedef cycles. -- [x] Resolve struct tag references. -- [x] Resolve union tag references. -- [x] Resolve enum tag references. -- [x] Resolve opaque pointer typedefs. -- [x] Preserve unresolved references for later semantic diagnostics. -- [x] Do not lose original spelling during resolution. -- [x] Add tests for cross-file typedef resolution. -- [x] Add tests for cross-file struct resolution. -- [x] Add tests for opaque handles. -- [x] Add tests for unresolved references. - -### Header/Source Pairing Tasks - -- [x] Pair `foo.c` with `foo.h` by basename. -- [x] Pair source with headers it includes. -- [x] Preserve many-to-many relationships. -- [x] Use pairings for reporting, not for hidden behavior. -- [x] Add tests for header/source pairing. - -### Phase 8 Definition Of Done - -- [x] `parse_c_project` returns a populated `CProject`. -- [x] Include graph is stable and serialized. -- [x] Cross-file typedef/tag resolution works for basic projects. -- [x] Missing project context becomes parser or semantic diagnostics as - appropriate. -- [x] Tests cover directory and file-list parsing. - -### Phase 8 Risks And Open Questions +## Step 2: Project And Include Policy - [ ] Decide whether project parsing should parse all included system headers - when found. + when they are found locally. - [ ] Decide how to handle generated headers. -- [ ] Decide whether include graph should be path-keyed, module-keyed, or both. - -## Phase 9: Semantic Readiness Integration +- [ ] Decide whether include graph keys should be path-keyed, module-keyed, or + both. -Branch target: - -- `c-parser/phase-9-semantic-readiness` - -Scope: - -- Semantic readiness integration for C parser facts. -- File-level and unit-level blockers, but owned by the semantic layer rather - than the parser. - -### Readiness Schema Tasks +## Step 3: Semantic Readiness - [ ] Define stable C readiness dictionary keys for the semantic layer. - [ ] Include counts for functions, structs, unions, enums, typedefs, macros, @@ -1162,9 +56,6 @@ Scope: - [ ] Include `unit_blockers`. - [ ] Include `why_not_wrappable`. - [ ] Include file-level `wrappable`. - -### Diagnostic Tasks - - [ ] Report no functions found. - [ ] Report unresolved includes. - [ ] Report unresolved typedefs. @@ -1179,56 +70,33 @@ Scope: - [ ] Report function pointer parameters. - [ ] Report callback typedef parameters. - [ ] Report missing callback `.pyi` policy. -- [x] Report macro-dependent declarations. -- [x] Report unsupported attributes. -- [x] Report unsupported compiler extensions. - [ ] Report unsupported bitfields. - [ ] Report pointer ownership ambiguity. - [ ] Report non-const pointer mutability ambiguity. - [ ] Report arrays with unknown extent relationships. -- [ ] Report opaque pointers as warning or non-blocker if policy allows. - -### Unit Blocker Tasks - +- [ ] Report opaque pointers as warnings or non-blockers if policy allows. - [ ] Assign function blockers to function units. - [ ] Assign struct field blockers to struct units. - [ ] Assign union field blockers to union units. - [ ] Assign enum value blockers to enum units. - [ ] Assign typedef blockers to typedef units. -- [ ] Assign include/macro/file-scope-variable blockers to file units when no narrower owner - exists. +- [ ] Assign include, macro, and file-scope-variable blockers to file units + when no narrower owner exists. - [ ] Use qualified names where available. - [ ] Avoid per-unit ready flags; keep readiness file-level like Fortran. - [ ] Add tests for every blocker family. - [ ] Add semantic readiness formatting tests. - -### Phase 9 Definition Of Done - -- [ ] Readiness output is stable in JSON and human CLI when served by the +- [ ] Ensure readiness output is stable in JSON and human CLI when served by the semantic layer. -- [ ] Diagnostics identify exactly which units block wrapping. -- [ ] Common unsupported C constructs produce actionable messages. -- [ ] Docs list readiness codes and examples. -- [ ] Tests cover readiness families. - -### Phase 9 Risks And Open Questions - +- [ ] Ensure diagnostics identify exactly which units block wrapping. +- [ ] Ensure common unsupported C constructs produce actionable messages. +- [ ] Document readiness codes and examples. - [ ] Decide which pointer cases are blockers versus warnings. - [ ] Decide how semantic readiness should treat opaque handles. -- [ ] Decide the exact readiness code names for callback APIs that are parsed - but missing user-supplied `.pyi` policy. - -## Phase 10: Semantic IR Conversion - -Branch target: +- [ ] Decide exact readiness code names for callback APIs that are parsed but + missing user-supplied `.pyi` policy. -- `c-parser/phase-10-semantics` - -Scope: - -- Convert C parser models into language-independent semantic IR. - -### Converter Structure Tasks +## Step 4: Semantic IR Conversion - [ ] Create `semantics/c2ir.py`. - [ ] Implement `CToIRConverter`. @@ -1238,9 +106,6 @@ Scope: - [ ] Add `c_struct_to_semantic_class` where appropriate. - [ ] Add `c_project_to_semantic_modules` if project context is needed. - [ ] Keep conversion separate from parser internals. - -### Type Mapping Tasks - - [ ] Map `void` return to `None`. - [ ] Map `_Bool` to `Bool`. - [ ] Map `char` to an explicit semantic type policy. @@ -1257,9 +122,6 @@ Scope: - [ ] Map unions conservatively. - [ ] Map enums/constants. - [ ] Preserve unresolved semantic types as errors, not `Unknown` output. - -### Function Projection Tasks - - [ ] Convert C functions to `SemanticFunction`. - [ ] Preserve native function name. - [ ] Preserve parameter order. @@ -1276,39 +138,24 @@ Scope: - [ ] Add semantic tests for pointer input. - [ ] Add semantic tests for const pointer input. - [ ] Add semantic tests for arrays with explicit size parameter. -- [ ] Add semantic tests for structs/opaque handles. - -### Phase 10 Definition Of Done - -- [ ] C semantic conversion works for the supported parser subset. -- [ ] Unsupported C semantic mappings fail explicitly. -- [ ] `--language c --semantics` can be enabled with tests. -- [ ] Semantic fixture workflow exists for C if stable enough. -- [ ] Docs explain C to semantic IR mapping. - -### Phase 10 Risks And Open Questions - -- [ ] Current semantic IR may need richer pointer/ownership constraints. -- [ ] Unsigned integer semantic type names may need standardization. -- [ ] Struct/union/enum representation may require semantic model extensions. - -## Phase 11: `.pyi` Generation And Parsing Integration - -Branch target: - -- `c-parser/phase-11-pyi` - -Scope: - -- Emit/edit semantic interface stubs for C APIs. -- Extend `.pyi` syntax only through semantic IR needs. - -### Generation Tasks +- [ ] Add semantic tests for structs and opaque handles. +- [ ] Ensure C semantic conversion works for the supported parser subset. +- [ ] Ensure unsupported C semantic mappings fail explicitly. +- [ ] Enable `--language c --semantics` only after tests pass. +- [ ] Add a semantic fixture workflow for C if stable enough. +- [ ] Document C-to-semantic-IR mapping. +- [ ] Decide whether the current semantic IR needs richer pointer/ownership + constraints. +- [ ] Standardize unsigned integer semantic type names. +- [ ] Decide whether struct, union, and enum representation requires semantic + model extensions. + +## Step 5: C `.pyi` Generation And Policy - [ ] Enable `--language c --pyi` only after semantic conversion is stable. - [ ] Generate stubs from C semantic modules. - [ ] Emit scalar functions. -- [ ] Emit pointer constraints when semantic model supports them. +- [ ] Emit pointer constraints when the semantic model supports them. - [ ] Emit arrays with `ORDER_C`. - [ ] Emit constants as `Final[...]`. - [ ] Emit opaque handles as classes or semantic type annotations. @@ -1319,18 +166,12 @@ Scope: - [ ] Add tests for constant stubs. - [ ] Add tests for opaque handle stubs. - [ ] Add tests for array stubs. - -### Parser Integration Tasks - -- [ ] Confirm existing `.pyi` parser accepts generated C stubs. -- [ ] Extend `.pyi` parser only if semantic IR requires new constructs. +- [ ] Confirm the existing `.pyi` parser accepts generated C stubs. +- [ ] Extend the `.pyi` parser only if semantic IR requires new constructs. - [ ] Add round-trip tests for C-generated stubs. - [ ] Add edited-stub tests for C APIs. - [ ] Add tests that unsupported C stubs fail clearly. - [ ] Add fixture tests under `tests/pyi/fixtures/c/` if C stubs are stable. - -### Native Projection Tasks - - [ ] Represent pointer/size hidden relationships where known. - [ ] Represent returned output buffers only with explicit projection metadata. - [ ] Represent ownership/lifetime metadata if supported by IR. @@ -1348,53 +189,34 @@ Scope: - [ ] Defer callback projection until those policy fields are supplied by the user. - [ ] Defer arbitrary ABI details. - -### Phase 11 Definition Of Done - -- [ ] C `.pyi` output works for supported semantic subset. -- [ ] Generated stubs parse back into semantic IR. -- [ ] C `.pyi` tests are separate from Fortran `.pyi` tests. -- [ ] Docs describe generated C stub shape and limitations. - -### Phase 11 Risks And Open Questions - -- [ ] Existing `.pyi` syntax may not be expressive enough for ownership and - lifetimes. -- [ ] Opaque handles might require new conventions. -- [ ] C callbacks likely need dedicated `.pyi` policy syntax and later semantic - IR extensions. - -## Phase 12: Corpus Testing, Stabilization, And Regression Hardening - -Branch target: - -- `c-parser/phase-12-corpus-stabilization` - -Scope: - -- Harden parser against realistic C APIs. -- Stabilize docs, tests, schema, and CLI. -- Prepare eventual mature integration. - -### Corpus Tasks +- [ ] Ensure C `.pyi` output works for the supported semantic subset. +- [ ] Ensure generated stubs parse back into semantic IR. +- [ ] Keep C `.pyi` tests separate from Fortran `.pyi` tests. +- [ ] Document generated C stub shape and limitations. +- [ ] Decide whether existing `.pyi` syntax is expressive enough for ownership + and callback policy. +- [ ] Decide whether opaque handles need new conventions. +- [ ] Decide whether C callbacks need dedicated `.pyi` policy syntax and later + semantic model changes. + +## Step 6: Corpus And Stabilization - [ ] Use cJSON as the first pinned real-world C corpus target. - [ ] Pin cJSON to an exact tag or commit rather than tracking the moving - default branch. + upstream branch. - [ ] Store cJSON provenance in `tests/data/c/corpus/cjson/SOURCE.md`. - [ ] Store cJSON license text next to the vendored fixture files. - [ ] Add `tests/data/c/corpus/cjson/cJSON.h`. - [ ] Add `tests/data/c/corpus/cjson/cJSON.c`. - [ ] Treat cJSON corpus tests as parse-only at first. - [ ] Use cJSON to exercise typedef structs, recursive pointers, `const char *` - APIs, `size_t`, public declaration macros, numeric/string constants, - and callback hook members. -- [ ] Keep callback hook members modeled in `c_parser/models.py`, with - semantic readiness requiring explicit user `.pyi` callback policy metadata - before claiming they are wrappable. -- [ ] Add zlib or another macro-heavier C library only after - compiler-assisted preprocessing mode is available. -- [ ] Add small real-world C header corpus. + APIs, `size_t`, public declaration macros, numeric/string constants, and + callback hook members. +- [ ] Keep callback hook members modeled in `c_parser/models.py`, with semantic + readiness requiring explicit user `.pyi` callback policy metadata before + claiming they are wrappable. +- [ ] Add zlib or another macro-heavier C library only after cJSON is stable. +- [ ] Add a small real-world C header corpus. - [ ] Add scientific C API fixtures. - [ ] Add source/header project fixtures. - [ ] Add macro-heavy unsupported fixtures. @@ -1406,69 +228,35 @@ Scope: - [ ] Add parse-only corpus tests. - [ ] Add selected parser JSON goldens for representative corpus files. - [ ] Keep corpus license provenance documented. - -### Regression Hardening Tasks - -- [x] Run full parser tests. -- [ ] Run semantic tests. -- [ ] Run `.pyi` tests. -- [ ] Run C corpus parse-only tests. -- [x] Run CLI tests. -- [x] Run golden fixture tests. -- [x] Confirm Fortran tests still pass. +- [ ] Run C corpus parse-only tests. The current corpus file is still a skipped + roadmap test until the corpus workflow is enabled. - [ ] Audit JSON schema stability. - [ ] Audit error diagnostic stability. -- [x] Audit docs for implemented behavior. -- [x] Remove stale skeleton wording where implementation has matured. -- [ ] Add developer tutorial for C parser internals. -- [ ] Add public API reference examples. - -### Stabilization Tasks - -- [ ] Decide criteria for merging `c-parser/main` into project `main`. - [ ] Require green CI for Fortran and C suites. -- [ ] Require docs updated for implemented subset. -- [x] Require fixture/golden workflow documented. -- [ ] Require semantic and `.pyi` behavior documented. -- [ ] Require explicit non-goals still documented. -- [ ] Require migration notes for users. -- [ ] Consider adding CI guard requiring C parser docs updates for C parser - changes, mirroring the Fortran parser reference policy. - -### Phase 12 Definition Of Done - -- [ ] C parser handles a representative stable subset. -- [ ] CLI, JSON, semantic readiness, semantic IR, and `.pyi` workflows are - tested. -- [ ] Fixture/golden workflows are stable. -- [ ] Corpus tests catch regressions. -- [ ] Fortran behavior remains stable. -- [ ] `c-parser/main` is mature enough to consider a planned merge to project - `main`. - -### Phase 12 Risks And Open Questions - -- [ ] Scope creep toward compiler-grade parsing. -- [ ] Macro-heavy APIs require clear raw-source versus compiler-preprocessed - mode behavior. -- [ ] Ownership/lifetime semantics may need broader IR work. -- [ ] C extensions may need fixture-driven prioritization. - -## Cross-Phase Non-Goals For V1 - -- [ ] Do not support full compiler-grade C parsing. -- [ ] Do not support full C preprocessor compatibility. -- [ ] Do not support arbitrary macro expansion. -- [ ] Do not parse macro-generated declarations from raw source as if they were - ordinary C declarations. -- [ ] Do not support token-paste/stringify expansion. -- [ ] Do not support all compiler extensions. -- [ ] Do not support arbitrary GCC extensions. -- [ ] Do not support arbitrary MSVC extensions. -- [ ] Do not parse C++. -- [ ] Do not generate a full ABI model. -- [ ] Do not infer pointer ownership silently. -- [ ] Do not claim callbacks are safely wrappable before the required `.pyi` - callback policy is supplied. -- [ ] Do not modify Fortran parser behavior as part of C parser work unless a - shared change is explicitly planned, tested, and documented. +- [ ] Consider adding a CI guard that requires C parser docs updates for C + parser changes. +- [ ] Keep fixture/golden workflows stable. +- [ ] Make corpus tests catch regressions. +- [ ] Confirm the parse-only C frontend remains mature enough for the planned + merge to project `main`. + +## Guardrails For All Remaining Work + +These are non-goal constraints, not parser implementation tasks: + +- Do not support full compiler-grade C parsing. +- Do not support full C preprocessor compatibility. +- Do not support arbitrary macro expansion. +- Do not parse macro-generated declarations from raw source as ordinary C + declarations. +- Do not support token-paste or stringify expansion. +- Do not support all compiler extensions. +- Do not support arbitrary GCC extensions. +- Do not support arbitrary MSVC extensions. +- Do not parse C++. +- Do not generate a full ABI model. +- Do not infer pointer ownership silently. +- Do not claim callbacks are safely wrappable before the required `.pyi` + callback policy is supplied. +- Do not modify Fortran parser behavior as part of C parser work unless a shared + change is explicitly planned, tested, and documented. diff --git a/docs/c_parser/c_parser_reference.md b/docs/c_parser/c_parser_reference.md index 912adbe82..de5f1ae61 100644 --- a/docs/c_parser/c_parser_reference.md +++ b/docs/c_parser/c_parser_reference.md @@ -1,17 +1,11 @@ # C Parser Reference -Status: partial parser reference with raw directive metadata. The `c_parser` -package and explicit C CLI parse path exist, raw includes/simple macros are -recorded, and a first grammar-shaped subset parses simple declarations, -typedefs, variables, function prototypes, and function-definition headers with -start/end locations. Incomplete struct/union declarations and basic -struct/union/enum definitions are represented as concrete objects, and -declarators are parsed through a recursive grammar-style path for pointer, -array, function, and parenthesized combinations. - -This document is the future home for the C parser user and developer reference. -It should evolve into the C equivalent of `fortran_parser.md` as implementation -lands on `c-parser/main`. +Status: current reference for the parse-only C frontend. The `c_parser` +package, typed parser models, explicit C CLI parse path, raw directive +metadata, compiler-assisted preprocessing, source-location remapping, project +indexes, parser goldens, and C standard-type probe are implemented. C semantic +readiness, semantic IR conversion, and `.pyi` generation remain future work and +are intentionally rejected by the CLI. ## Purpose @@ -33,19 +27,17 @@ It is not intended to be: - a C++ parser - a complete ABI generator -## Planned Source Coverage +## Source Coverage -Initial source forms: +Supported source forms: - `.c` - `.h` - -Possible later source form: - - `.i` preprocessed C input -Project input should accept explicit files and directories. Directory scanning -must be explicit C mode at first to avoid changing Fortran CLI behavior. +Project input accepts explicit files and directories in explicit C mode. +Directory scanning in C mode discovers C source/header inputs without changing +Fortran's default directory behavior. ## Current Status @@ -92,6 +84,29 @@ Implemented: - simple function-definition signature extraction with body skipping - start/end locations for function definitions, from the signature start through the closing brace +- braced and designated initializer source preservation on `CVariable` +- nested anonymous struct/union member definitions as concrete member types +- `_Atomic(type)` type specifiers, preserving the qualified outermost type + component +- compiler/preprocessed input parsing through the same grammar path with + `#line`/GCC linemarker remapping for parsed declarations and diagnostics +- declaration-level `origin="preprocessed"` metadata plus generated/original + source identity for direct `.i` input where linemarkers provide it +- optional `preprocessing_recipe` JSON on `CFile` output for compiler streams + generated by the shared x2py CLI +- compiler-derived standard-library ABI probing for `size_t`, `uint32_t`, + `time_t`, and opaque `FILE` handles through `x2py.c_type_probe` +- C directory/file-list discovery for `.c`, `.h`, and direct `.i` inputs in + explicit C mode, while leaving Fortran directory scanning unchanged +- include resolution for quoted includes relative to the current file and + configured include directories, unresolved include tracking, system include + tracking, cycle-safe include graph construction, and header/source pairing +- project indexes for functions, file-scope variables, typedefs, struct tags, + union tags, enum tags, enum constants, macros/constants, and functions by + file +- basic cross-file typedef chain and struct/union/enum tag resolution, with + typedef-cycle diagnostics and unresolved references preserved for later + diagnostics - unsupported K&R function-definition diagnostics - C parser project JSON goldens and fatal diagnostic goldens generated from stable `CProject.to_dict()` and `CParseError` output @@ -103,17 +118,14 @@ Implemented: Still deferred: - callback policy metadata beyond parser-side callback candidates -- nested aggregate member definitions and broad compiler-extension declarators -- braced/designated initializer preservation -- cross-declaration and cross-file typedef/tag resolution -- project include graph and cross-file type resolution -- preprocessed-input parsing with `#line`/linemarker source mapping -- macro-expanded declaration parsing from preprocessed input +- broad compiler-extension declarators +- broader typedef/tag conflict policy beyond the implemented basic project + resolution - semantic readiness, semantic IR conversion, and `.pyi` generation -## Planned Supported C Subset +## Supported C Subset -The initial supported subset should focus on stable wrapper-relevant APIs: +The supported subset focuses on stable wrapper-relevant APIs: - function prototypes - function definitions with extractable signatures @@ -131,9 +143,9 @@ The initial supported subset should focus on stable wrapper-relevant APIs: - include dependency tracking - cross-file typedef and tag resolution within parsed project files -## Initial Unsupported Subset +## Unsupported And Deferred Subset -The initial C parser should explicitly report or defer: +The C parser explicitly reports or defers: - full compiler-grade C parsing - full preprocessor compatibility @@ -151,10 +163,10 @@ The initial C parser should explicitly report or defer: - full bitfield ABI interpretation - inline assembly - `_Generic` semantic evaluation -- complex `_Atomic` behavior +- atomic operation semantics and validation beyond parsed type facts - arbitrary attributes before fixture-driven support exists -## Planned Preprocessing Policy +## Preprocessing Policy The C parser should be preprocessor-aware, but it should not become a partial C preprocessor. Partial macro support is risky in C because macros can define @@ -182,13 +194,40 @@ Raw-source mode means source normalization plus directive metadata: declarations Compiler-assisted preprocessing is the required path when macros affect the -declaration text that the C parser needs to understand. Use preprocessed input -when macros define or alter function names, return types, parameter types, +declaration text that the C parser needs to understand. Use compiler mode when +macros define or alter function names, return types, parameter types, declarators, attributes, storage classes, calling conventions, visibility -annotations, or conditional API selection. x2py may later accept `.i` files or -invoke a configured compiler preprocessor such as `cc -E` or `clang -E`. +annotations, or conditional API selection. The user normally gives x2py `.h` +or `.c` files and has it run the configured compiler/preprocessor; direct +`.i` preprocessed inputs are also accepted and use their linemarkers for +locations and source identity. + +Examples: + +```bash +python -m x2py include/api.h --language c --parse \ + --preprocess compiler \ + --compiler clang-18 \ + -I include \ + -D API_EXPORT= \ + --std c11 + +python -m x2py src/api.c --language c --parse \ + --preprocess compiler \ + --compiler /usr/bin/gcc-13 \ + --compiler-arg=--sysroot=/opt/sdk + +python -m x2py src/api.c --language c --parse \ + --preprocess compiler \ + --compile-commands build/compile_commands.json +``` -Preprocessed mode must preserve line mapping. That means the parser reads +`--compiler` must be the exact executable x2py should run. Versioned names +such as `gcc-13`, `clang-18`, and `/usr/bin/gfortran-12` are preferred over a +generic `gcc`, `clang`, or `gfortran` when several compiler versions are +installed. + +Preprocessed mode preserves line mapping. The parser reads compiler-preprocessed text, including `#line`/linemarker directives, and maps every parsed declaration, source location, and diagnostic back to the original `.h` or `.c` file and line number where possible. Without this mapping, errors @@ -197,8 +236,53 @@ preprocessor stream instead of the user's source. This means macro-heavy APIs are still in scope. The boundary is that x2py v1 should not implement recursive, compiler-compatible macro expansion -internally; it should consume compiler-preprocessed output with preserved -origin metadata. +internally; it should consume compiler-preprocessed output with preserved line +mapping. When the shared x2py CLI generates a compiler-preprocessed stream, it +stores `preprocessing_recipe` in the per-file `CFile` JSON: compiler +executable, final argv, include dirs, defines, undefines, standard, extra +arguments, working directory, and optional selected `compile_commands.json` +entry. Parsed declarations from compiler or direct `.i` input carry +`origin="preprocessed"`; direct `.i` files also expose +`preprocessed_source_path` and mapped `original_source_paths` where available. + +## Standard Type ABI Probe + +Types introduced by standard headers are not portable primitive aliases. +`size_t`, `uint32_t`, and `time_t` may depend on the compiler target, and +`FILE` should remain an opaque library handle rather than exposing private +library layout. Raw parsing therefore preserves unresolved typedef-name uses +instead of hard-coding an ABI. + +For later C semantic conversion, `x2py.c_type_probe` compiles and runs a small +C11 query program under an exact compiler and emits target-specific JSON: + +```bash +python -m x2py.c_type_probe --compiler /usr/bin/gcc-13 --std c11 +``` + +The report records arithmetic category, underlying C spelling, bit width, and +alignment for `size_t`, available `uint32_t`, and `time_t`; it records opaque +handle and pointer ABI facts for `FILE`. It also retains the generated C source +and exact compile/run commands. + +The probe must be run with the same target profile as the source being parsed. +It carries `-I`, `-D`, `-U`, and `--compiler-arg` options into the compile +command because ABI and standard-header typedef facts can change with target +flags, sysroots, library headers, and compiler options. The requested `--std` +is retained as provenance; the generated query is compiled as C11 because it +uses C11 `_Generic` and `_Alignof`. If a standard-selection flag affects the +target profile and is compatible with the probe source, pass it through +`--compiler-arg` so it is part of the actual compile command. +The probe does not consume `compile_commands.json` directly; if parser +preprocessing uses a compile database, pass the selected compiler and +target-relevant flags from the matching entry to the probe explicitly. + +For cross targets, provide a runner, for example `--runner=qemu-aarch64 +--runner=-L --runner=/opt/aarch64-sysroot`. + +The eventual C semantic converter should accept this report as target context. +The parser model remains source-faithful and does not embed host ABI +assumptions. ## Public API @@ -249,8 +333,8 @@ All types inherit from `CType`. Implemented primitive type classes are `CFloatComplex`, `CDoubleComplex`, and `CLongDoubleComplex`. Qualifiers are `CConst`, `CVolatile`, `CRestrict`, and `CAtomic`, attached to the precise type component they qualify. `_Atomic int value;` is stored with a `CAtomic` -qualifier; the distinct `_Atomic(int) value;` type-specifier form remains -diagnosed as unsupported. Equivalent primitive orderings, such as +qualifier; `_Atomic(int) value;` is represented the same way, while +`_Atomic(int *) value;` qualifies the pointer component. Equivalent primitive orderings, such as `int unsigned` and `double long`, map to the same concrete type while invalid combinations, such as `unsigned float`, raise `CParseError` with code `CPARSE003`. A single unresolved typedef-name use remains a `CTypedef` @@ -294,8 +378,7 @@ member in a struct is marked as `CArray(is_flexible=True)`; non-final, sole-member, and union incomplete-array member forms are retained with `C_INVALID_FLEXIBLE_ARRAY_MEMBER` error diagnostics. Selected unsupported forms, such as static assertions, -attributes, alignment specifiers, `_Atomic(type)`, C++-shaped declarations, -and nested aggregate member definitions, are reported in `diagnostics` with +attributes, alignment specifiers, and C++-shaped declarations, are reported in `diagnostics` with explicit `unit_kind` values. Unconsumed declarator suffixes are also diagnosed instead of producing partial objects. Functions @@ -314,6 +397,36 @@ produce diagnostics. Local declarations inside function bodies are ignored because body contents are intentionally skipped. Re-export from `x2py` is still deferred; users should import from `c_parser`. +Example: parse one header from Python. + +```python +from c_parser import parse_c_file + +parsed = parse_c_file("include/api.h") +print([function.name for function in parsed.functions]) +print([typedef.name for typedef in parsed.typedefs]) +``` + +Example: parse a small project with include directories. + +```python +from c_parser import parse_c_project + +project = parse_c_project(["src/api.c", "include/api.h"], include_dirs=["include"]) +print(project.include_graph) +print(project.header_source_pairs) +``` + +Example: parse compiler-preprocessed text produced by the shared x2py CLI. + +```bash +python -m x2py include/api.h --language c --parse --json \ + --preprocess compiler \ + --compiler clang-18 \ + -I include \ + -D API_EXPORT= +``` + Project-level facts require `parse_c_project(...)`, not just `parse_c_file(...)`. A single file can report its own raw directives, includes, macros, declarations, diagnostics, and unresolved typedef/tag references. A @@ -332,7 +445,7 @@ the current Fortran and `.pyi` readiness boundary. ## CLI Usage -Initial explicit mode: +Explicit C mode: ```bash x2py path/to/api.h --language c --parse @@ -359,6 +472,7 @@ Per-file shape: "language": "c", "parser_status": "partial", "preprocessing": "raw", + "preprocessing_recipe": "", "functions": [ { "name": "run", @@ -400,7 +514,7 @@ JSON compatibility rules: - keep model fields stable enough for golden fixture testing - document every intentional schema break -## Planned Readiness Boundary +## Readiness Boundary The parser should not assess wrappability. @@ -450,7 +564,7 @@ invalidity does not depend on later typedef resolution. Known unsupported declaration extensions are diagnosed rather than partially modeled; additional syntax diagnostics should be added only with focused tests. -## Planned Testing Workflow +## Testing Workflow Test families should mirror the Fortran parser: @@ -471,8 +585,8 @@ Test families should mirror the Fortran parser: - error fixture/golden tests - corpus parse-only tests -The C test area now contains active partial-parser/raw-metadata tests plus -narrowly scoped roadmap skips under `tests/parser/c/`. The active tests cover +The C test area contains active partial-parser/raw-metadata tests plus narrowly +scoped roadmap skips under `tests/parser/c/`. The active tests cover public entrypoints, empty model serialization, CLI discovery, JSON/output-file behavior, unsupported C stages, comment stripping, line-continuation folding, top-level splitting, include collection, simple macro collection, macro-shaped @@ -485,11 +599,16 @@ serialization, fatal diagnostic goldens, and project-level callback typedef resolution. The `json` regression inputs intentionally retain recoverable diagnostics from unsupported constructs; they do not claim complete library parsing. Remaining parser-suite skips cover the -pinned/provenanced corpus target and compiler-preprocessed `.i`/`#line` -behavior. Golden comparison tests rewrite their baselines when +pinned/provenanced corpus target. Golden comparison tests rewrite their baselines when `C_PARSER_UPDATE_GOLDENS=1` is set. Future implementation branches should -activate only the tests for the capability they implement, then merge those -branches back into `c-parser/main`. +activate only the tests for the capability they implement. + +Recent local merge-readiness checks for the parse-only frontend: + +```bash +pytest -q tests/parser/c tests/parser/test_c_standard_type_probe.py tests/parser/test_preprocessing_cli.py tests/parser/test_cli.py tests/parser/test_fortran_type_probe.py tests/semantics tests/pyi +pytest -q +``` ### Declaration Coverage Boundary @@ -497,8 +616,8 @@ Active declaration tests currently cover: - every implemented primitive spelling and selected reordered equivalent spellings mapped to their concrete `CType` -- all qualifier objects, storage metadata, simple expression initializers, and - multiple declarators +- all qualifier objects, storage metadata, simple/braced/designated initializer + source text, and multiple declarators - pointer/array precedence, multidimensional arrays, parameter VLA/static metadata and pointer adjustment, function-declared callback adjustment, function pointers, callback arrays, and functions returning function @@ -510,9 +629,10 @@ Active declaration tests currently cover: named/unnamed/zero-width bit-field source facts - concrete-type JSON serialization, source locations, and cycle-safe aggregate references -- diagnostics for selected unsupported attributes, alignment, `_Atomic(type)`, - C++-shaped declarations, nested aggregate definitions, K&R definitions, and - trailing declarator extensions +- `_Atomic int` and `_Atomic(type)` qualifier placement on scalar and pointer + declaration forms +- diagnostics for selected unsupported attributes, alignment, C++-shaped + declarations, K&R definitions, and trailing declarator extensions - fatal diagnostics for invalid primitive-specifier combinations while unresolved single typedef-name uses remain deferred @@ -523,11 +643,9 @@ declarations. | Capability | C example | Current parser boundary | Needed behavior | | --- | --- | --- | --- | -| Braced/designated initializers | `int values[3] = {1, 2, 3};` and `struct point origin = {.x = 1, .y = 2};` | Simple initializer text such as `int answer = 42;` is preserved; braced forms are not reliably emitted as `CVariable` initializer facts. | Parse or preserve balanced initializer source without treating its braces as an aggregate declaration. | -| Nested aggregate members | `struct outer { struct { int x; } inner; };` | Produces an unsupported-member diagnostic and does not model `inner`. | Build an anonymous `CStruct`/`CUnion` type used by the member variable. | -| Typedef/tag resolution | `typedef unsigned long size_t; size_t count(void);` and `struct state { int id; }; void step(struct state *s);` | Preserves uses as unresolved `CTypedef` or incomplete tag-type objects unless attached inline. | Link uses to declarations across a file/project and diagnose conflicts. | -| Preprocessed declarations | `#define API(ret) ret` followed by `API(int) run(void);` | Raw mode records macro metadata and does not claim the expanded declaration; preprocessed input with line mapping is not implemented. | Accept compiler-expanded input and map each declaration back through `#line` markers. | -| Additional extension families | `int run(void) __attribute__((visibility("default")));` | Known attribute/alignment/`_Atomic(type)` forms are diagnosed; broader compiler extensions are not modeled. | Add fixture-driven support or a focused diagnostic for each required extension family. | +| Typedef/tag resolution | `typedef unsigned long size_t; size_t count(void);` and `struct state { int id; }; void step(struct state *s);` | Basic project parsing links typedef chains and struct/union/enum tag references while preserving unresolved objects when context is absent. | Deepen conflict and generated-header policy for broader projects. | +| Preprocessed declarations | `#define API(ret) ret` followed by `API(int) run(void);` | Raw mode records macro metadata and does not claim the expanded declaration; compiler or `.i` mode parses expanded declarations, maps locations through `#line` markers, and records `origin="preprocessed"`; x2py-generated streams also record their recipe. | Broaden fixture-driven extension and compiler-family coverage. | +| Additional extension families | `int run(void) __attribute__((visibility("default")));` | Known attribute/alignment forms are diagnosed; broader compiler extensions are not modeled. | Add fixture-driven support or a focused diagnostic for each required extension family. | ### Represented With Focused Tests @@ -540,6 +658,15 @@ const int * const * volatile chain; The current parser creates distinct qualified `CPointer` components for `chain`, preserving each qualifier on the exact component it qualifies. +Nested declarations such as `struct outer { struct { int x; } inner; };` +build an anonymous `CStruct` used by member `inner`; preprocessed forms retain +mapped nested member locations and `origin="preprocessed"` recursively. +Atomic declarations such as `_Atomic(int *) p;` qualify the pointer component, +while `_Atomic(int) *p;` qualifies the pointed-to integer component. + +For an executable maintainer walkthrough of the parser gateway and +preprocessed source path, read +`tests/parser/c/test_c_parser_developer_tutorial.py`. Fixture layout should be separate from Fortran: @@ -592,7 +719,7 @@ callback hook members. Library files currently under `tests/data/c/json/`, are regression inputs only until corresponding corpus provenance requirements are met. -## Planned Documentation Set +## Documentation Set The C parser documentation lives under: diff --git a/fortran_parser.md b/fortran_parser.md index f4c2d4b44..6a9a8055c 100644 --- a/fortran_parser.md +++ b/fortran_parser.md @@ -356,6 +356,13 @@ Expected JSON layout: - `programs` - `block_data` +When `x2py --parse --json` applies Fortran preprocessing settings, the +per-file payload also contains `preprocessing_recipe`. Internal `-D`/`-U` +branch selection records those macro settings. `--preprocess compiler` records +the exact compiler executable and argv, include paths, macro flags, standard, +extra compiler arguments, and working directory used to produce the parsed +stdout stream. + `use` import shape: - A bare module import such as `use iso_c_binding` is serialized as an empty diff --git a/tests/parser/c/README.md b/tests/parser/c/README.md index 446e796ab..33c1e3762 100644 --- a/tests/parser/c/README.md +++ b/tests/parser/c/README.md @@ -18,8 +18,8 @@ Guidelines: ## Intentional Skips The normal parser test run retains skips only for the pinned/provenanced -cJSON corpus roadmap and compiler-preprocessed `.i`/`#line` behavior, which -are not implemented yet. CLI, public API, and current project-resolution +cJSON corpus roadmap. CLI, public API, direct `.i` discovery, +compiler/preprocessed linemarker remapping, and current project-resolution coverage are active. ## Parser Goldens @@ -41,6 +41,13 @@ The third-party-library inputs are realistic regression inputs for the partial parser; diagnostics in their goldens are expected and do not claim full library support. +## Developer Walkthrough + +`test_c_parser_developer_tutorial.py` is an executable reading guide for +`c_parser/parser.py`. It shows the shared declaration/declarator gateway, the +`visit_file` dispatch of declaration roles, and the preprocessed linemarker +path without replacing the feature-focused test modules. + Each logical project produces one output, for example `math_api.json` for `math_api.c` plus `math_api.h`, `cJSON.json` for the cJSON pair, and `jsmn.json` or `linmath.json` for unpaired headers. The NanoSVG header pair diff --git a/tests/parser/c/fixtures/json/cJSON.json b/tests/parser/c/fixtures/json/cJSON.json index 1e8635c8f..eee14819e 100644 --- a/tests/parser/c/fixtures/json/cJSON.json +++ b/tests/parser/c/fixtures/json/cJSON.json @@ -4703,7 +4703,50 @@ "reference": "printbuffer" } ], - "variables": [], + "variables": [ + { + "name": "global_error", + "type": { + "reference": "error" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ NULL, 0 }" + }, + "bit_width": null, + "source_location": { + "filename": "json/cJSON.c", + "line": 92, + "column": 1, + "source_line": "static error global_error = { NULL, 0 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "global_hooks", + "type": { + "reference": "internal_hooks" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ internal_malloc, internal_free, internal_realloc }" + }, + "bit_width": null, + "source_location": { + "filename": "json/cJSON.c", + "line": 186, + "column": 1, + "source_line": "static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc };" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], "macros": [ { "name": "_CRT_SECURE_NO_DEPRECATE", @@ -5601,19 +5644,6 @@ "unit_kind": "macro", "unit_name": "cjson_min" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "json/cJSON.c", - "line": 92, - "column": 1, - "source_line": "static error global_error = { NULL, 0 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_UNSUPPORTED_DECLARATOR", "message": "Unsupported declarator syntax after parsed type layers: 'char *'.", @@ -5744,19 +5774,6 @@ "unit_kind": "declarator", "unit_name": null }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "json/cJSON.c", - "line": 186, - "column": 1, - "source_line": "static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_UNSUPPORTED_DECLARATOR", "message": "Unsupported declarator syntax after parsed type layers: 'cJSON_InitHooks(cJSON_Hooks* hooks)'.", @@ -11426,7 +11443,50 @@ "reference": "printbuffer" } }, - "variables": {}, + "variables": { + "global_error": { + "name": "global_error", + "type": { + "reference": "error" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ NULL, 0 }" + }, + "bit_width": null, + "source_location": { + "filename": "json/cJSON.c", + "line": 92, + "column": 1, + "source_line": "static error global_error = { NULL, 0 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "global_hooks": { + "name": "global_hooks", + "type": { + "reference": "internal_hooks" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ internal_malloc, internal_free, internal_realloc }" + }, + "bit_width": null, + "source_location": { + "filename": "json/cJSON.c", + "line": 186, + "column": 1, + "source_line": "static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc };" + }, + "callback_policy": null, + "declaration_locations": [] + } + }, "macros": { "_CRT_SECURE_NO_DEPRECATE": { "name": "_CRT_SECURE_NO_DEPRECATE", @@ -12209,19 +12269,6 @@ "unit_kind": "macro", "unit_name": "cjson_min" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "json/cJSON.c", - "line": 92, - "column": 1, - "source_line": "static error global_error = { NULL, 0 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_UNSUPPORTED_DECLARATOR", "message": "Unsupported declarator syntax after parsed type layers: 'char *'.", @@ -12352,19 +12399,6 @@ "unit_kind": "declarator", "unit_name": null }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "json/cJSON.c", - "line": 186, - "column": 1, - "source_line": "static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_UNSUPPORTED_DECLARATOR", "message": "Unsupported declarator syntax after parsed type layers: 'cJSON_InitHooks(cJSON_Hooks* hooks)'.", diff --git a/tests/parser/c/fixtures/nanosvg/nanosvg.json b/tests/parser/c/fixtures/nanosvg/nanosvg.json index c66be4eff..4b2eb1ed0 100644 --- a/tests/parser/c/fixtures/nanosvg/nanosvg.json +++ b/tests/parser/c/fixtures/nanosvg/nanosvg.json @@ -4060,6 +4060,82 @@ "callback_policy": null, "declaration_locations": [] }, + { + "name": null, + "type": { + "model": "CUnion", + "qualifiers": [], + "source_text": "", + "name": null, + "members": [ + { + "name": "linear", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "NSVGlinearData linear", + "name": "NSVGlinearData", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "nanosvg/nanosvg.h", + "line": 411, + "column": 3, + "source_line": "\t\tNSVGlinearData linear;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "radial", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "NSVGradialData radial", + "name": "NSVGradialData", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "nanosvg/nanosvg.h", + "line": 412, + "column": 3, + "source_line": "\t\tNSVGradialData radial;" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], + "anonymous_id": "union@nanosvg/nanosvg.h:410:2", + "is_incomplete": false, + "source_location": { + "filename": "nanosvg/nanosvg.h", + "line": 410, + "column": 2, + "source_line": "\tunion {" + } + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "nanosvg/nanosvg.h", + "line": 410, + "column": 2, + "source_line": "\tunion {" + }, + "callback_policy": null, + "declaration_locations": [] + }, { "name": "spread", "type": { @@ -16385,7 +16461,43 @@ "declaration_locations": [] } ], - "variables": [], + "variables": [ + { + "name": "nsvg__colors", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "NSVGNamedColor nsvg__colors[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "NSVGNamedColor" + } + ] + }, + "storage": [], + "initializer": { + "source_text": "{\n\n\t{ \"red\", NSVG_RGB(255, 0, 0) },\n\t{ \"green\", NSVG_RGB( 0, 128, 0) },\n\t{ \"blue\", NSVG_RGB( 0, 0, 255) },\n\t{ \"yellow\", NSVG_RGB(255, 255, 0) },\n\t{ \"cyan\", NSVG_RGB( 0, 255, 255) },\n\t{ \"magenta\", NSVG_RGB(255, 0, 255) },\n\t{ \"black\", NSVG_RGB( 0, 0, 0) },\n\t{ \"grey\", NSVG_RGB(128, 128, 128) },\n\t{ \"gray\", NSVG_RGB(128, 128, 128) },\n\t{ \"white\", NSVG_RGB(255, 255, 255) },\n\n \n\t{ \"aliceblue\", NSVG_RGB(240, 248, 255) },\n\t{ \"antiquewhite\", NSVG_RGB(250, 235, 215) },\n\t{ \"aqua\", NSVG_RGB( 0, 255, 255) },\n\t{ \"aquamarine\", NSVG_RGB(127, 255, 212) },\n\t{ \"azure\", NSVG_RGB(240, 255, 255) },\n\t{ \"beige\", NSVG_RGB(245, 245, 220) },\n\t{ \"bisque\", NSVG_RGB(255, 228, 196) },\n\t{ \"blanchedalmond\", NSVG_RGB(255, 235, 205) },\n\t{ \"blueviolet\", NSVG_RGB(138, 43, 226) },\n\t{ \"brown\", NSVG_RGB(165, 42, 42) },\n\t{ \"burlywood\", NSVG_RGB(222, 184, 135) },\n\t{ \"cadetblue\", NSVG_RGB( 95, 158, 160) },\n\t{ \"chartreuse\", NSVG_RGB(127, 255, 0) },\n\t{ \"chocolate\", NSVG_RGB(210, 105, 30) },\n\t{ \"coral\", NSVG_RGB(255, 127, 80) },\n\t{ \"cornflowerblue\", NSVG_RGB(100, 149, 237) },\n\t{ \"cornsilk\", NSVG_RGB(255, 248, 220) },\n\t{ \"crimson\", NSVG_RGB(220, 20, 60) },\n\t{ \"darkblue\", NSVG_RGB( 0, 0, 139) },\n\t{ \"darkcyan\", NSVG_RGB( 0, 139, 139) },\n\t{ \"darkgoldenrod\", NSVG_RGB(184, 134, 11) },\n\t{ \"darkgray\", NSVG_RGB(169, 169, 169) },\n\t{ \"darkgreen\", NSVG_RGB( 0, 100, 0) },\n\t{ \"darkgrey\", NSVG_RGB(169, 169, 169) },\n\t{ \"darkkhaki\", NSVG_RGB(189, 183, 107) },\n\t{ \"darkmagenta\", NSVG_RGB(139, 0, 139) },\n\t{ \"darkolivegreen\", NSVG_RGB( 85, 107, 47) },\n\t{ \"darkorange\", NSVG_RGB(255, 140, 0) },\n\t{ \"darkorchid\", NSVG_RGB(153, 50, 204) },\n\t{ \"darkred\", NSVG_RGB(139, 0, 0) },\n\t{ \"darksalmon\", NSVG_RGB(233, 150, 122) },\n\t{ \"darkseagreen\", NSVG_RGB(143, 188, 143) },\n\t{ \"darkslateblue\", NSVG_RGB( 72, 61, 139) },\n\t{ \"darkslategray\", NSVG_RGB( 47, 79, 79) },\n\t{ \"darkslategrey\", NSVG_RGB( 47, 79, 79) },\n\t{ \"darkturquoise\", NSVG_RGB( 0, 206, 209) },\n\t{ \"darkviolet\", NSVG_RGB(148, 0, 211) },\n\t{ \"deeppink\", NSVG_RGB(255, 20, 147) },\n\t{ \"deepskyblue\", NSVG_RGB( 0, 191, 255) },\n\t{ \"dimgray\", NSVG_RGB(105, 105, 105) },\n\t{ \"dimgrey\", NSVG_RGB(105, 105, 105) },\n\t{ \"dodgerblue\", NSVG_RGB( 30, 144, 255) },\n\t{ \"firebrick\", NSVG_RGB(178, 34, 34) },\n\t{ \"floralwhite\", NSVG_RGB(255, 250, 240) },\n\t{ \"forestgreen\", NSVG_RGB( 34, 139, 34) },\n\t{ \"fuchsia\", NSVG_RGB(255, 0, 255) },\n\t{ \"gainsboro\", NSVG_RGB(220, 220, 220) },\n\t{ \"ghostwhite\", NSVG_RGB(248, 248, 255) },\n\t{ \"gold\", NSVG_RGB(255, 215, 0) },\n\t{ \"goldenrod\", NSVG_RGB(218, 165, 32) },\n\t{ \"greenyellow\", NSVG_RGB(173, 255, 47) },\n\t{ \"honeydew\", NSVG_RGB(240, 255, 240) },\n\t{ \"hotpink\", NSVG_RGB(255, 105, 180) },\n\t{ \"indianred\", NSVG_RGB(205, 92, 92) },\n\t{ \"indigo\", NSVG_RGB( 75, 0, 130) },\n\t{ \"ivory\", NSVG_RGB(255, 255, 240) },\n\t{ \"khaki\", NSVG_RGB(240, 230, 140) },\n\t{ \"lavender\", NSVG_RGB(230, 230, 250) },\n\t{ \"lavenderblush\", NSVG_RGB(255, 240, 245) },\n\t{ \"lawngreen\", NSVG_RGB(124, 252, 0) },\n\t{ \"lemonchiffon\", NSVG_RGB(255, 250, 205) },\n\t{ \"lightblue\", NSVG_RGB(173, 216, 230) },\n\t{ \"lightcoral\", NSVG_RGB(240, 128, 128) },\n\t{ \"lightcyan\", NSVG_RGB(224, 255, 255) },\n\t{ \"lightgoldenrodyellow\", NSVG_RGB(250, 250, 210) },\n\t{ \"lightgray\", NSVG_RGB(211, 211, 211) },\n\t{ \"lightgreen\", NSVG_RGB(144, 238, 144) },\n\t{ \"lightgrey\", NSVG_RGB(211, 211, 211) },\n\t{ \"lightpink\", NSVG_RGB(255, 182, 193) },\n\t{ \"lightsalmon\", NSVG_RGB(255, 160, 122) },\n\t{ \"lightseagreen\", NSVG_RGB( 32, 178, 170) },\n\t{ \"lightskyblue\", NSVG_RGB(135, 206, 250) },\n\t{ \"lightslategray\", NSVG_RGB(119, 136, 153) },\n\t{ \"lightslategrey\", NSVG_RGB(119, 136, 153) },\n\t{ \"lightsteelblue\", NSVG_RGB(176, 196, 222) },\n\t{ \"lightyellow\", NSVG_RGB(255, 255, 224) },\n\t{ \"lime\", NSVG_RGB( 0, 255, 0) },\n\t{ \"limegreen\", NSVG_RGB( 50, 205, 50) },\n\t{ \"linen\", NSVG_RGB(250, 240, 230) },\n\t{ \"maroon\", NSVG_RGB(128, 0, 0) },\n\t{ \"mediumaquamarine\", NSVG_RGB(102, 205, 170) },\n\t{ \"mediumblue\", NSVG_RGB( 0, 0, 205) },\n\t{ \"mediumorchid\", NSVG_RGB(186, 85, 211) },\n\t{ \"mediumpurple\", NSVG_RGB(147, 112, 219) },\n\t{ \"mediumseagreen\", NSVG_RGB( 60, 179, 113) },\n\t{ \"mediumslateblue\", NSVG_RGB(123, 104, 238) },\n\t{ \"mediumspringgreen\", NSVG_RGB( 0, 250, 154) },\n\t{ \"mediumturquoise\", NSVG_RGB( 72, 209, 204) },\n\t{ \"mediumvioletred\", NSVG_RGB(199, 21, 133) },\n\t{ \"midnightblue\", NSVG_RGB( 25, 25, 112) },\n\t{ \"mintcream\", NSVG_RGB(245, 255, 250) },\n\t{ \"mistyrose\", NSVG_RGB(255, 228, 225) },\n\t{ \"moccasin\", NSVG_RGB(255, 228, 181) },\n\t{ \"navajowhite\", NSVG_RGB(255, 222, 173) },\n\t{ \"navy\", NSVG_RGB( 0, 0, 128) },\n\t{ \"oldlace\", NSVG_RGB(253, 245, 230) },\n\t{ \"olive\", NSVG_RGB(128, 128, 0) },\n\t{ \"olivedrab\", NSVG_RGB(107, 142, 35) },\n\t{ \"orange\", NSVG_RGB(255, 165, 0) },\n\t{ \"orangered\", NSVG_RGB(255, 69, 0) },\n\t{ \"orchid\", NSVG_RGB(218, 112, 214) },\n\t{ \"palegoldenrod\", NSVG_RGB(238, 232, 170) },\n\t{ \"palegreen\", NSVG_RGB(152, 251, 152) },\n\t{ \"paleturquoise\", NSVG_RGB(175, 238, 238) },\n\t{ \"palevioletred\", NSVG_RGB(219, 112, 147) },\n\t{ \"papayawhip\", NSVG_RGB(255, 239, 213) },\n\t{ \"peachpuff\", NSVG_RGB(255, 218, 185) },\n\t{ \"peru\", NSVG_RGB(205, 133, 63) },\n\t{ \"pink\", NSVG_RGB(255, 192, 203) },\n\t{ \"plum\", NSVG_RGB(221, 160, 221) },\n\t{ \"powderblue\", NSVG_RGB(176, 224, 230) },\n\t{ \"purple\", NSVG_RGB(128, 0, 128) },\n\t{ \"rosybrown\", NSVG_RGB(188, 143, 143) },\n\t{ \"royalblue\", NSVG_RGB( 65, 105, 225) },\n\t{ \"saddlebrown\", NSVG_RGB(139, 69, 19) },\n\t{ \"salmon\", NSVG_RGB(250, 128, 114) },\n\t{ \"sandybrown\", NSVG_RGB(244, 164, 96) },\n\t{ \"seagreen\", NSVG_RGB( 46, 139, 87) },\n\t{ \"seashell\", NSVG_RGB(255, 245, 238) },\n\t{ \"sienna\", NSVG_RGB(160, 82, 45) },\n\t{ \"silver\", NSVG_RGB(192, 192, 192) },\n\t{ \"skyblue\", NSVG_RGB(135, 206, 235) },\n\t{ \"slateblue\", NSVG_RGB(106, 90, 205) },\n\t{ \"slategray\", NSVG_RGB(112, 128, 144) },\n\t{ \"slategrey\", NSVG_RGB(112, 128, 144) },\n\t{ \"snow\", NSVG_RGB(255, 250, 250) },\n\t{ \"springgreen\", NSVG_RGB( 0, 255, 127) },\n\t{ \"steelblue\", NSVG_RGB( 70, 130, 180) },\n\t{ \"tan\", NSVG_RGB(210, 180, 140) },\n\t{ \"teal\", NSVG_RGB( 0, 128, 128) },\n\t{ \"thistle\", NSVG_RGB(216, 191, 216) },\n\t{ \"tomato\", NSVG_RGB(255, 99, 71) },\n\t{ \"turquoise\", NSVG_RGB( 64, 224, 208) },\n\t{ \"violet\", NSVG_RGB(238, 130, 238) },\n\t{ \"wheat\", NSVG_RGB(245, 222, 179) },\n\t{ \"whitesmoke\", NSVG_RGB(245, 245, 245) },\n\t{ \"yellowgreen\", NSVG_RGB(154, 205, 50) },\n \n}" + }, + "bit_width": null, + "source_location": { + "filename": "nanosvg/nanosvg.h", + "line": 1326, + "column": 1, + "source_line": "NSVGNamedColor nsvg__colors[] = {" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], "macros": [ { "name": "NANOSVG_H", @@ -16997,32 +17109,6 @@ }, "unit_kind": "macro_dependent_declaration", "unit_name": "NSVG_INLINE" - }, - { - "code": "C_UNSUPPORTED_FIELD_DECLARATION", - "message": "Nested aggregate field definitions are not supported yet.", - "severity": "warning", - "location": { - "filename": "nanosvg/nanosvg.h", - "line": 410, - "column": 2, - "source_line": "\tunion {" - }, - "unit_kind": "struct_field", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "nanosvg/nanosvg.h", - "line": 1326, - "column": 1, - "source_line": "NSVGNamedColor nsvg__colors[] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null } ] }, @@ -44773,7 +44859,43 @@ "reference": "NSVGcachedPaint" } }, - "variables": {}, + "variables": { + "nsvg__colors": { + "name": "nsvg__colors", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "NSVGNamedColor nsvg__colors[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "NSVGNamedColor" + } + ] + }, + "storage": [], + "initializer": { + "source_text": "{\n\n\t{ \"red\", NSVG_RGB(255, 0, 0) },\n\t{ \"green\", NSVG_RGB( 0, 128, 0) },\n\t{ \"blue\", NSVG_RGB( 0, 0, 255) },\n\t{ \"yellow\", NSVG_RGB(255, 255, 0) },\n\t{ \"cyan\", NSVG_RGB( 0, 255, 255) },\n\t{ \"magenta\", NSVG_RGB(255, 0, 255) },\n\t{ \"black\", NSVG_RGB( 0, 0, 0) },\n\t{ \"grey\", NSVG_RGB(128, 128, 128) },\n\t{ \"gray\", NSVG_RGB(128, 128, 128) },\n\t{ \"white\", NSVG_RGB(255, 255, 255) },\n\n \n\t{ \"aliceblue\", NSVG_RGB(240, 248, 255) },\n\t{ \"antiquewhite\", NSVG_RGB(250, 235, 215) },\n\t{ \"aqua\", NSVG_RGB( 0, 255, 255) },\n\t{ \"aquamarine\", NSVG_RGB(127, 255, 212) },\n\t{ \"azure\", NSVG_RGB(240, 255, 255) },\n\t{ \"beige\", NSVG_RGB(245, 245, 220) },\n\t{ \"bisque\", NSVG_RGB(255, 228, 196) },\n\t{ \"blanchedalmond\", NSVG_RGB(255, 235, 205) },\n\t{ \"blueviolet\", NSVG_RGB(138, 43, 226) },\n\t{ \"brown\", NSVG_RGB(165, 42, 42) },\n\t{ \"burlywood\", NSVG_RGB(222, 184, 135) },\n\t{ \"cadetblue\", NSVG_RGB( 95, 158, 160) },\n\t{ \"chartreuse\", NSVG_RGB(127, 255, 0) },\n\t{ \"chocolate\", NSVG_RGB(210, 105, 30) },\n\t{ \"coral\", NSVG_RGB(255, 127, 80) },\n\t{ \"cornflowerblue\", NSVG_RGB(100, 149, 237) },\n\t{ \"cornsilk\", NSVG_RGB(255, 248, 220) },\n\t{ \"crimson\", NSVG_RGB(220, 20, 60) },\n\t{ \"darkblue\", NSVG_RGB( 0, 0, 139) },\n\t{ \"darkcyan\", NSVG_RGB( 0, 139, 139) },\n\t{ \"darkgoldenrod\", NSVG_RGB(184, 134, 11) },\n\t{ \"darkgray\", NSVG_RGB(169, 169, 169) },\n\t{ \"darkgreen\", NSVG_RGB( 0, 100, 0) },\n\t{ \"darkgrey\", NSVG_RGB(169, 169, 169) },\n\t{ \"darkkhaki\", NSVG_RGB(189, 183, 107) },\n\t{ \"darkmagenta\", NSVG_RGB(139, 0, 139) },\n\t{ \"darkolivegreen\", NSVG_RGB( 85, 107, 47) },\n\t{ \"darkorange\", NSVG_RGB(255, 140, 0) },\n\t{ \"darkorchid\", NSVG_RGB(153, 50, 204) },\n\t{ \"darkred\", NSVG_RGB(139, 0, 0) },\n\t{ \"darksalmon\", NSVG_RGB(233, 150, 122) },\n\t{ \"darkseagreen\", NSVG_RGB(143, 188, 143) },\n\t{ \"darkslateblue\", NSVG_RGB( 72, 61, 139) },\n\t{ \"darkslategray\", NSVG_RGB( 47, 79, 79) },\n\t{ \"darkslategrey\", NSVG_RGB( 47, 79, 79) },\n\t{ \"darkturquoise\", NSVG_RGB( 0, 206, 209) },\n\t{ \"darkviolet\", NSVG_RGB(148, 0, 211) },\n\t{ \"deeppink\", NSVG_RGB(255, 20, 147) },\n\t{ \"deepskyblue\", NSVG_RGB( 0, 191, 255) },\n\t{ \"dimgray\", NSVG_RGB(105, 105, 105) },\n\t{ \"dimgrey\", NSVG_RGB(105, 105, 105) },\n\t{ \"dodgerblue\", NSVG_RGB( 30, 144, 255) },\n\t{ \"firebrick\", NSVG_RGB(178, 34, 34) },\n\t{ \"floralwhite\", NSVG_RGB(255, 250, 240) },\n\t{ \"forestgreen\", NSVG_RGB( 34, 139, 34) },\n\t{ \"fuchsia\", NSVG_RGB(255, 0, 255) },\n\t{ \"gainsboro\", NSVG_RGB(220, 220, 220) },\n\t{ \"ghostwhite\", NSVG_RGB(248, 248, 255) },\n\t{ \"gold\", NSVG_RGB(255, 215, 0) },\n\t{ \"goldenrod\", NSVG_RGB(218, 165, 32) },\n\t{ \"greenyellow\", NSVG_RGB(173, 255, 47) },\n\t{ \"honeydew\", NSVG_RGB(240, 255, 240) },\n\t{ \"hotpink\", NSVG_RGB(255, 105, 180) },\n\t{ \"indianred\", NSVG_RGB(205, 92, 92) },\n\t{ \"indigo\", NSVG_RGB( 75, 0, 130) },\n\t{ \"ivory\", NSVG_RGB(255, 255, 240) },\n\t{ \"khaki\", NSVG_RGB(240, 230, 140) },\n\t{ \"lavender\", NSVG_RGB(230, 230, 250) },\n\t{ \"lavenderblush\", NSVG_RGB(255, 240, 245) },\n\t{ \"lawngreen\", NSVG_RGB(124, 252, 0) },\n\t{ \"lemonchiffon\", NSVG_RGB(255, 250, 205) },\n\t{ \"lightblue\", NSVG_RGB(173, 216, 230) },\n\t{ \"lightcoral\", NSVG_RGB(240, 128, 128) },\n\t{ \"lightcyan\", NSVG_RGB(224, 255, 255) },\n\t{ \"lightgoldenrodyellow\", NSVG_RGB(250, 250, 210) },\n\t{ \"lightgray\", NSVG_RGB(211, 211, 211) },\n\t{ \"lightgreen\", NSVG_RGB(144, 238, 144) },\n\t{ \"lightgrey\", NSVG_RGB(211, 211, 211) },\n\t{ \"lightpink\", NSVG_RGB(255, 182, 193) },\n\t{ \"lightsalmon\", NSVG_RGB(255, 160, 122) },\n\t{ \"lightseagreen\", NSVG_RGB( 32, 178, 170) },\n\t{ \"lightskyblue\", NSVG_RGB(135, 206, 250) },\n\t{ \"lightslategray\", NSVG_RGB(119, 136, 153) },\n\t{ \"lightslategrey\", NSVG_RGB(119, 136, 153) },\n\t{ \"lightsteelblue\", NSVG_RGB(176, 196, 222) },\n\t{ \"lightyellow\", NSVG_RGB(255, 255, 224) },\n\t{ \"lime\", NSVG_RGB( 0, 255, 0) },\n\t{ \"limegreen\", NSVG_RGB( 50, 205, 50) },\n\t{ \"linen\", NSVG_RGB(250, 240, 230) },\n\t{ \"maroon\", NSVG_RGB(128, 0, 0) },\n\t{ \"mediumaquamarine\", NSVG_RGB(102, 205, 170) },\n\t{ \"mediumblue\", NSVG_RGB( 0, 0, 205) },\n\t{ \"mediumorchid\", NSVG_RGB(186, 85, 211) },\n\t{ \"mediumpurple\", NSVG_RGB(147, 112, 219) },\n\t{ \"mediumseagreen\", NSVG_RGB( 60, 179, 113) },\n\t{ \"mediumslateblue\", NSVG_RGB(123, 104, 238) },\n\t{ \"mediumspringgreen\", NSVG_RGB( 0, 250, 154) },\n\t{ \"mediumturquoise\", NSVG_RGB( 72, 209, 204) },\n\t{ \"mediumvioletred\", NSVG_RGB(199, 21, 133) },\n\t{ \"midnightblue\", NSVG_RGB( 25, 25, 112) },\n\t{ \"mintcream\", NSVG_RGB(245, 255, 250) },\n\t{ \"mistyrose\", NSVG_RGB(255, 228, 225) },\n\t{ \"moccasin\", NSVG_RGB(255, 228, 181) },\n\t{ \"navajowhite\", NSVG_RGB(255, 222, 173) },\n\t{ \"navy\", NSVG_RGB( 0, 0, 128) },\n\t{ \"oldlace\", NSVG_RGB(253, 245, 230) },\n\t{ \"olive\", NSVG_RGB(128, 128, 0) },\n\t{ \"olivedrab\", NSVG_RGB(107, 142, 35) },\n\t{ \"orange\", NSVG_RGB(255, 165, 0) },\n\t{ \"orangered\", NSVG_RGB(255, 69, 0) },\n\t{ \"orchid\", NSVG_RGB(218, 112, 214) },\n\t{ \"palegoldenrod\", NSVG_RGB(238, 232, 170) },\n\t{ \"palegreen\", NSVG_RGB(152, 251, 152) },\n\t{ \"paleturquoise\", NSVG_RGB(175, 238, 238) },\n\t{ \"palevioletred\", NSVG_RGB(219, 112, 147) },\n\t{ \"papayawhip\", NSVG_RGB(255, 239, 213) },\n\t{ \"peachpuff\", NSVG_RGB(255, 218, 185) },\n\t{ \"peru\", NSVG_RGB(205, 133, 63) },\n\t{ \"pink\", NSVG_RGB(255, 192, 203) },\n\t{ \"plum\", NSVG_RGB(221, 160, 221) },\n\t{ \"powderblue\", NSVG_RGB(176, 224, 230) },\n\t{ \"purple\", NSVG_RGB(128, 0, 128) },\n\t{ \"rosybrown\", NSVG_RGB(188, 143, 143) },\n\t{ \"royalblue\", NSVG_RGB( 65, 105, 225) },\n\t{ \"saddlebrown\", NSVG_RGB(139, 69, 19) },\n\t{ \"salmon\", NSVG_RGB(250, 128, 114) },\n\t{ \"sandybrown\", NSVG_RGB(244, 164, 96) },\n\t{ \"seagreen\", NSVG_RGB( 46, 139, 87) },\n\t{ \"seashell\", NSVG_RGB(255, 245, 238) },\n\t{ \"sienna\", NSVG_RGB(160, 82, 45) },\n\t{ \"silver\", NSVG_RGB(192, 192, 192) },\n\t{ \"skyblue\", NSVG_RGB(135, 206, 235) },\n\t{ \"slateblue\", NSVG_RGB(106, 90, 205) },\n\t{ \"slategray\", NSVG_RGB(112, 128, 144) },\n\t{ \"slategrey\", NSVG_RGB(112, 128, 144) },\n\t{ \"snow\", NSVG_RGB(255, 250, 250) },\n\t{ \"springgreen\", NSVG_RGB( 0, 255, 127) },\n\t{ \"steelblue\", NSVG_RGB( 70, 130, 180) },\n\t{ \"tan\", NSVG_RGB(210, 180, 140) },\n\t{ \"teal\", NSVG_RGB( 0, 128, 128) },\n\t{ \"thistle\", NSVG_RGB(216, 191, 216) },\n\t{ \"tomato\", NSVG_RGB(255, 99, 71) },\n\t{ \"turquoise\", NSVG_RGB( 64, 224, 208) },\n\t{ \"violet\", NSVG_RGB(238, 130, 238) },\n\t{ \"wheat\", NSVG_RGB(245, 222, 179) },\n\t{ \"whitesmoke\", NSVG_RGB(245, 245, 245) },\n\t{ \"yellowgreen\", NSVG_RGB(154, 205, 50) },\n \n}" + }, + "bit_width": null, + "source_location": { + "filename": "nanosvg/nanosvg.h", + "line": 1326, + "column": 1, + "source_line": "NSVGNamedColor nsvg__colors[] = {" + }, + "callback_policy": null, + "declaration_locations": [] + } + }, "macros": { "NANOSVG_H": { "name": "NANOSVG_H", @@ -45576,32 +45698,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "NSVG_INLINE" }, - { - "code": "C_UNSUPPORTED_FIELD_DECLARATION", - "message": "Nested aggregate field definitions are not supported yet.", - "severity": "warning", - "location": { - "filename": "nanosvg/nanosvg.h", - "line": 410, - "column": 2, - "source_line": "\tunion {" - }, - "unit_kind": "struct_field", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "nanosvg/nanosvg.h", - "line": 1326, - "column": 1, - "source_line": "NSVGNamedColor nsvg__colors[] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_UNSUPPORTED_DECLARATOR", "message": "Unsupported declarator syntax after parsed type layers: '\"C\"'.", diff --git a/tests/parser/c/fixtures/stb/stb_connected_components.json b/tests/parser/c/fixtures/stb/stb_connected_components.json index 6307c898a..4e8f2ac31 100644 --- a/tests/parser/c/fixtures/stb/stb_connected_components.json +++ b/tests/parser/c/fixtures/stb/stb_connected_components.json @@ -366,6 +366,93 @@ "source_text": "", "name": null, "members": [ + { + "name": "f", + "type": { + "model": "CStruct", + "qualifiers": [], + "source_text": "", + "name": null, + "members": [ + { + "name": "clump_index", + "type": { + "model": "CUnsignedInt", + "qualifiers": [], + "source_text": "unsigned int clump_index" + }, + "storage": [], + "initializer": null, + "bit_width": "12", + "source_location": { + "filename": "stb/stb_connected_components.h", + "line": 232, + "column": 7, + "source_line": " unsigned int clump_index:12;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "cluster_x", + "type": { + "model": "CUnsignedInt", + "qualifiers": [], + "source_text": "unsigned int cluster_x" + }, + "storage": [], + "initializer": null, + "bit_width": "10", + "source_location": { + "filename": "stb/stb_connected_components.h", + "line": 233, + "column": 7, + "source_line": " unsigned int cluster_x:10;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "cluster_y", + "type": { + "model": "CUnsignedInt", + "qualifiers": [], + "source_text": "unsigned int cluster_y" + }, + "storage": [], + "initializer": null, + "bit_width": "10", + "source_location": { + "filename": "stb/stb_connected_components.h", + "line": 234, + "column": 7, + "source_line": " unsigned int cluster_y:10;" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], + "anonymous_id": "struct@stb/stb_connected_components.h:231:4", + "is_incomplete": false, + "source_location": { + "filename": "stb/stb_connected_components.h", + "line": 231, + "column": 4, + "source_line": " struct {" + } + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_connected_components.h", + "line": 231, + "column": 4, + "source_line": " struct {" + }, + "callback_policy": null, + "declaration_locations": [] + }, { "name": "c", "type": { @@ -4021,19 +4108,6 @@ }, "unit_kind": "declarator", "unit_name": null - }, - { - "code": "C_UNSUPPORTED_FIELD_DECLARATION", - "message": "Nested aggregate field definitions are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_connected_components.h", - "line": 231, - "column": 4, - "source_line": " struct {" - }, - "unit_kind": "union_field", - "unit_name": null } ] } @@ -6799,19 +6873,6 @@ "unit_kind": "declarator", "unit_name": null }, - { - "code": "C_UNSUPPORTED_FIELD_DECLARATION", - "message": "Nested aggregate field definitions are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_connected_components.h", - "line": 231, - "column": 4, - "source_line": " struct {" - }, - "unit_kind": "union_field", - "unit_name": null - }, { "code": "C_UNION_BY_VALUE", "message": "Function 'stbcc__clump_find' uses union type(s) by value: union@stb/stb_connected_components.h:229:1. Use an explicit pointer or defer wrapper policy to the semantic layer.", diff --git a/tests/parser/c/fixtures/stb/stb_dxt.json b/tests/parser/c/fixtures/stb/stb_dxt.json index abdfef9dc..720535f15 100644 --- a/tests/parser/c/fixtures/stb/stb_dxt.json +++ b/tests/parser/c/fixtures/stb/stb_dxt.json @@ -1778,7 +1778,190 @@ "unions": [], "enums": [], "typedefs": [], - "variables": [], + "variables": [ + { + "name": "stb__OMatch5", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const unsigned char stb__OMatch5[256][2]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "256", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [ + "const" + ], + "source_text": "const unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0, 0 }, { 0, 0 }, { 0, 1 }, { 0, 1 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 1 },\n { 1, 1 }, { 1, 1 }, { 1, 2 }, { 0, 4 }, { 2, 1 }, { 2, 1 }, { 2, 1 }, { 2, 2 },\n { 2, 2 }, { 2, 2 }, { 2, 3 }, { 1, 5 }, { 3, 2 }, { 3, 2 }, { 4, 0 }, { 3, 3 },\n { 3, 3 }, { 3, 3 }, { 3, 4 }, { 3, 4 }, { 3, 4 }, { 3, 5 }, { 4, 3 }, { 4, 3 },\n { 5, 2 }, { 4, 4 }, { 4, 4 }, { 4, 5 }, { 4, 5 }, { 5, 4 }, { 5, 4 }, { 5, 4 },\n { 6, 3 }, { 5, 5 }, { 5, 5 }, { 5, 6 }, { 4, 8 }, { 6, 5 }, { 6, 5 }, { 6, 5 },\n { 6, 6 }, { 6, 6 }, { 6, 6 }, { 6, 7 }, { 5, 9 }, { 7, 6 }, { 7, 6 }, { 8, 4 },\n { 7, 7 }, { 7, 7 }, { 7, 7 }, { 7, 8 }, { 7, 8 }, { 7, 8 }, { 7, 9 }, { 8, 7 },\n { 8, 7 }, { 9, 6 }, { 8, 8 }, { 8, 8 }, { 8, 9 }, { 8, 9 }, { 9, 8 }, { 9, 8 },\n { 9, 8 }, { 10, 7 }, { 9, 9 }, { 9, 9 }, { 9, 10 }, { 8, 12 }, { 10, 9 }, { 10, 9 },\n { 10, 9 }, { 10, 10 }, { 10, 10 }, { 10, 10 }, { 10, 11 }, { 9, 13 }, { 11, 10 }, { 11, 10 },\n { 12, 8 }, { 11, 11 }, { 11, 11 }, { 11, 11 }, { 11, 12 }, { 11, 12 }, { 11, 12 }, { 11, 13 },\n { 12, 11 }, { 12, 11 }, { 13, 10 }, { 12, 12 }, { 12, 12 }, { 12, 13 }, { 12, 13 }, { 13, 12 },\n { 13, 12 }, { 13, 12 }, { 14, 11 }, { 13, 13 }, { 13, 13 }, { 13, 14 }, { 12, 16 }, { 14, 13 },\n { 14, 13 }, { 14, 13 }, { 14, 14 }, { 14, 14 }, { 14, 14 }, { 14, 15 }, { 13, 17 }, { 15, 14 },\n { 15, 14 }, { 16, 12 }, { 15, 15 }, { 15, 15 }, { 15, 15 }, { 15, 16 }, { 15, 16 }, { 15, 16 },\n { 15, 17 }, { 16, 15 }, { 16, 15 }, { 17, 14 }, { 16, 16 }, { 16, 16 }, { 16, 17 }, { 16, 17 },\n { 17, 16 }, { 17, 16 }, { 17, 16 }, { 18, 15 }, { 17, 17 }, { 17, 17 }, { 17, 18 }, { 16, 20 },\n { 18, 17 }, { 18, 17 }, { 18, 17 }, { 18, 18 }, { 18, 18 }, { 18, 18 }, { 18, 19 }, { 17, 21 },\n { 19, 18 }, { 19, 18 }, { 20, 16 }, { 19, 19 }, { 19, 19 }, { 19, 19 }, { 19, 20 }, { 19, 20 },\n { 19, 20 }, { 19, 21 }, { 20, 19 }, { 20, 19 }, { 21, 18 }, { 20, 20 }, { 20, 20 }, { 20, 21 },\n { 20, 21 }, { 21, 20 }, { 21, 20 }, { 21, 20 }, { 22, 19 }, { 21, 21 }, { 21, 21 }, { 21, 22 },\n { 20, 24 }, { 22, 21 }, { 22, 21 }, { 22, 21 }, { 22, 22 }, { 22, 22 }, { 22, 22 }, { 22, 23 },\n { 21, 25 }, { 23, 22 }, { 23, 22 }, { 24, 20 }, { 23, 23 }, { 23, 23 }, { 23, 23 }, { 23, 24 },\n { 23, 24 }, { 23, 24 }, { 23, 25 }, { 24, 23 }, { 24, 23 }, { 25, 22 }, { 24, 24 }, { 24, 24 },\n { 24, 25 }, { 24, 25 }, { 25, 24 }, { 25, 24 }, { 25, 24 }, { 26, 23 }, { 25, 25 }, { 25, 25 },\n { 25, 26 }, { 24, 28 }, { 26, 25 }, { 26, 25 }, { 26, 25 }, { 26, 26 }, { 26, 26 }, { 26, 26 },\n { 26, 27 }, { 25, 29 }, { 27, 26 }, { 27, 26 }, { 28, 24 }, { 27, 27 }, { 27, 27 }, { 27, 27 },\n { 27, 28 }, { 27, 28 }, { 27, 28 }, { 27, 29 }, { 28, 27 }, { 28, 27 }, { 29, 26 }, { 28, 28 },\n { 28, 28 }, { 28, 29 }, { 28, 29 }, { 29, 28 }, { 29, 28 }, { 29, 28 }, { 30, 27 }, { 29, 29 },\n { 29, 29 }, { 29, 30 }, { 29, 30 }, { 30, 29 }, { 30, 29 }, { 30, 29 }, { 30, 30 }, { 30, 30 },\n { 30, 30 }, { 30, 31 }, { 30, 31 }, { 31, 30 }, { 31, 30 }, { 31, 30 }, { 31, 31 }, { 31, 31 },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_dxt.h", + "line": 95, + "column": 1, + "source_line": "static const unsigned char stb__OMatch5[256][2] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stb__OMatch6", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const unsigned char stb__OMatch6[256][2]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "256", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [ + "const" + ], + "source_text": "const unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0, 0 }, { 0, 1 }, { 1, 0 }, { 1, 1 }, { 1, 1 }, { 1, 2 }, { 2, 1 }, { 2, 2 },\n { 2, 2 }, { 2, 3 }, { 3, 2 }, { 3, 3 }, { 3, 3 }, { 3, 4 }, { 4, 3 }, { 4, 4 },\n { 4, 4 }, { 4, 5 }, { 5, 4 }, { 5, 5 }, { 5, 5 }, { 5, 6 }, { 6, 5 }, { 6, 6 },\n { 6, 6 }, { 6, 7 }, { 7, 6 }, { 7, 7 }, { 7, 7 }, { 7, 8 }, { 8, 7 }, { 8, 8 },\n { 8, 8 }, { 8, 9 }, { 9, 8 }, { 9, 9 }, { 9, 9 }, { 9, 10 }, { 10, 9 }, { 10, 10 },\n { 10, 10 }, { 10, 11 }, { 11, 10 }, { 8, 16 }, { 11, 11 }, { 11, 12 }, { 12, 11 }, { 9, 17 },\n { 12, 12 }, { 12, 13 }, { 13, 12 }, { 11, 16 }, { 13, 13 }, { 13, 14 }, { 14, 13 }, { 12, 17 },\n { 14, 14 }, { 14, 15 }, { 15, 14 }, { 14, 16 }, { 15, 15 }, { 15, 16 }, { 16, 14 }, { 16, 15 },\n { 17, 14 }, { 16, 16 }, { 16, 17 }, { 17, 16 }, { 18, 15 }, { 17, 17 }, { 17, 18 }, { 18, 17 },\n { 20, 14 }, { 18, 18 }, { 18, 19 }, { 19, 18 }, { 21, 15 }, { 19, 19 }, { 19, 20 }, { 20, 19 },\n { 20, 20 }, { 20, 20 }, { 20, 21 }, { 21, 20 }, { 21, 21 }, { 21, 21 }, { 21, 22 }, { 22, 21 },\n { 22, 22 }, { 22, 22 }, { 22, 23 }, { 23, 22 }, { 23, 23 }, { 23, 23 }, { 23, 24 }, { 24, 23 },\n { 24, 24 }, { 24, 24 }, { 24, 25 }, { 25, 24 }, { 25, 25 }, { 25, 25 }, { 25, 26 }, { 26, 25 },\n { 26, 26 }, { 26, 26 }, { 26, 27 }, { 27, 26 }, { 24, 32 }, { 27, 27 }, { 27, 28 }, { 28, 27 },\n { 25, 33 }, { 28, 28 }, { 28, 29 }, { 29, 28 }, { 27, 32 }, { 29, 29 }, { 29, 30 }, { 30, 29 },\n { 28, 33 }, { 30, 30 }, { 30, 31 }, { 31, 30 }, { 30, 32 }, { 31, 31 }, { 31, 32 }, { 32, 30 },\n { 32, 31 }, { 33, 30 }, { 32, 32 }, { 32, 33 }, { 33, 32 }, { 34, 31 }, { 33, 33 }, { 33, 34 },\n { 34, 33 }, { 36, 30 }, { 34, 34 }, { 34, 35 }, { 35, 34 }, { 37, 31 }, { 35, 35 }, { 35, 36 },\n { 36, 35 }, { 36, 36 }, { 36, 36 }, { 36, 37 }, { 37, 36 }, { 37, 37 }, { 37, 37 }, { 37, 38 },\n { 38, 37 }, { 38, 38 }, { 38, 38 }, { 38, 39 }, { 39, 38 }, { 39, 39 }, { 39, 39 }, { 39, 40 },\n { 40, 39 }, { 40, 40 }, { 40, 40 }, { 40, 41 }, { 41, 40 }, { 41, 41 }, { 41, 41 }, { 41, 42 },\n { 42, 41 }, { 42, 42 }, { 42, 42 }, { 42, 43 }, { 43, 42 }, { 40, 48 }, { 43, 43 }, { 43, 44 },\n { 44, 43 }, { 41, 49 }, { 44, 44 }, { 44, 45 }, { 45, 44 }, { 43, 48 }, { 45, 45 }, { 45, 46 },\n { 46, 45 }, { 44, 49 }, { 46, 46 }, { 46, 47 }, { 47, 46 }, { 46, 48 }, { 47, 47 }, { 47, 48 },\n { 48, 46 }, { 48, 47 }, { 49, 46 }, { 48, 48 }, { 48, 49 }, { 49, 48 }, { 50, 47 }, { 49, 49 },\n { 49, 50 }, { 50, 49 }, { 52, 46 }, { 50, 50 }, { 50, 51 }, { 51, 50 }, { 53, 47 }, { 51, 51 },\n { 51, 52 }, { 52, 51 }, { 52, 52 }, { 52, 52 }, { 52, 53 }, { 53, 52 }, { 53, 53 }, { 53, 53 },\n { 53, 54 }, { 54, 53 }, { 54, 54 }, { 54, 54 }, { 54, 55 }, { 55, 54 }, { 55, 55 }, { 55, 55 },\n { 55, 56 }, { 56, 55 }, { 56, 56 }, { 56, 56 }, { 56, 57 }, { 57, 56 }, { 57, 57 }, { 57, 57 },\n { 57, 58 }, { 58, 57 }, { 58, 58 }, { 58, 58 }, { 58, 59 }, { 59, 58 }, { 59, 59 }, { 59, 59 },\n { 59, 60 }, { 60, 59 }, { 60, 60 }, { 60, 60 }, { 60, 61 }, { 61, 60 }, { 61, 61 }, { 61, 61 },\n { 61, 62 }, { 62, 61 }, { 62, 62 }, { 62, 62 }, { 62, 63 }, { 63, 62 }, { 63, 63 }, { 63, 63 },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_dxt.h", + "line": 129, + "column": 1, + "source_line": "static const unsigned char stb__OMatch6[256][2] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stb__midpoints5", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const float stb__midpoints5[32]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "32", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [ + "const" + ], + "source_text": "const float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0.015686f, 0.047059f, 0.078431f, 0.111765f, 0.145098f, 0.176471f, 0.207843f, 0.241176f, 0.274510f, 0.305882f, 0.337255f, 0.370588f, 0.403922f, 0.435294f, 0.466667f, 0.5f,\n 0.533333f, 0.564706f, 0.596078f, 0.629412f, 0.662745f, 0.694118f, 0.725490f, 0.758824f, 0.792157f, 0.823529f, 0.854902f, 0.888235f, 0.921569f, 0.952941f, 0.984314f, 1.0f\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_dxt.h", + "line": 369, + "column": 1, + "source_line": "static const float stb__midpoints5[32] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stb__midpoints6", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const float stb__midpoints6[64]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "64", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [ + "const" + ], + "source_text": "const float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0.007843f, 0.023529f, 0.039216f, 0.054902f, 0.070588f, 0.086275f, 0.101961f, 0.117647f, 0.133333f, 0.149020f, 0.164706f, 0.180392f, 0.196078f, 0.211765f, 0.227451f, 0.245098f,\n 0.262745f, 0.278431f, 0.294118f, 0.309804f, 0.325490f, 0.341176f, 0.356863f, 0.372549f, 0.388235f, 0.403922f, 0.419608f, 0.435294f, 0.450980f, 0.466667f, 0.482353f, 0.500000f,\n 0.517647f, 0.533333f, 0.549020f, 0.564706f, 0.580392f, 0.596078f, 0.611765f, 0.627451f, 0.643137f, 0.658824f, 0.674510f, 0.690196f, 0.705882f, 0.721569f, 0.737255f, 0.754902f,\n 0.772549f, 0.788235f, 0.803922f, 0.819608f, 0.835294f, 0.850980f, 0.866667f, 0.882353f, 0.898039f, 0.913725f, 0.929412f, 0.945098f, 0.960784f, 0.976471f, 0.992157f, 1.0f\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_dxt.h", + "line": 374, + "column": 1, + "source_line": "static const float stb__midpoints6[64] = {" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], "macros": [ { "name": "STB_INCLUDE_STB_DXT_H", @@ -2141,58 +2324,6 @@ }, "unit_kind": "declarator", "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_dxt.h", - "line": 95, - "column": 1, - "source_line": "static const unsigned char stb__OMatch5[256][2] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_dxt.h", - "line": 129, - "column": 1, - "source_line": "static const unsigned char stb__OMatch6[256][2] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_dxt.h", - "line": 369, - "column": 1, - "source_line": "static const float stb__midpoints5[32] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_dxt.h", - "line": 374, - "column": 1, - "source_line": "static const float stb__midpoints6[64] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null } ] } @@ -3970,7 +4101,190 @@ "unions": {}, "enums": {}, "typedefs": {}, - "variables": {}, + "variables": { + "stb__OMatch5": { + "name": "stb__OMatch5", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const unsigned char stb__OMatch5[256][2]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "256", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [ + "const" + ], + "source_text": "const unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0, 0 }, { 0, 0 }, { 0, 1 }, { 0, 1 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 1 },\n { 1, 1 }, { 1, 1 }, { 1, 2 }, { 0, 4 }, { 2, 1 }, { 2, 1 }, { 2, 1 }, { 2, 2 },\n { 2, 2 }, { 2, 2 }, { 2, 3 }, { 1, 5 }, { 3, 2 }, { 3, 2 }, { 4, 0 }, { 3, 3 },\n { 3, 3 }, { 3, 3 }, { 3, 4 }, { 3, 4 }, { 3, 4 }, { 3, 5 }, { 4, 3 }, { 4, 3 },\n { 5, 2 }, { 4, 4 }, { 4, 4 }, { 4, 5 }, { 4, 5 }, { 5, 4 }, { 5, 4 }, { 5, 4 },\n { 6, 3 }, { 5, 5 }, { 5, 5 }, { 5, 6 }, { 4, 8 }, { 6, 5 }, { 6, 5 }, { 6, 5 },\n { 6, 6 }, { 6, 6 }, { 6, 6 }, { 6, 7 }, { 5, 9 }, { 7, 6 }, { 7, 6 }, { 8, 4 },\n { 7, 7 }, { 7, 7 }, { 7, 7 }, { 7, 8 }, { 7, 8 }, { 7, 8 }, { 7, 9 }, { 8, 7 },\n { 8, 7 }, { 9, 6 }, { 8, 8 }, { 8, 8 }, { 8, 9 }, { 8, 9 }, { 9, 8 }, { 9, 8 },\n { 9, 8 }, { 10, 7 }, { 9, 9 }, { 9, 9 }, { 9, 10 }, { 8, 12 }, { 10, 9 }, { 10, 9 },\n { 10, 9 }, { 10, 10 }, { 10, 10 }, { 10, 10 }, { 10, 11 }, { 9, 13 }, { 11, 10 }, { 11, 10 },\n { 12, 8 }, { 11, 11 }, { 11, 11 }, { 11, 11 }, { 11, 12 }, { 11, 12 }, { 11, 12 }, { 11, 13 },\n { 12, 11 }, { 12, 11 }, { 13, 10 }, { 12, 12 }, { 12, 12 }, { 12, 13 }, { 12, 13 }, { 13, 12 },\n { 13, 12 }, { 13, 12 }, { 14, 11 }, { 13, 13 }, { 13, 13 }, { 13, 14 }, { 12, 16 }, { 14, 13 },\n { 14, 13 }, { 14, 13 }, { 14, 14 }, { 14, 14 }, { 14, 14 }, { 14, 15 }, { 13, 17 }, { 15, 14 },\n { 15, 14 }, { 16, 12 }, { 15, 15 }, { 15, 15 }, { 15, 15 }, { 15, 16 }, { 15, 16 }, { 15, 16 },\n { 15, 17 }, { 16, 15 }, { 16, 15 }, { 17, 14 }, { 16, 16 }, { 16, 16 }, { 16, 17 }, { 16, 17 },\n { 17, 16 }, { 17, 16 }, { 17, 16 }, { 18, 15 }, { 17, 17 }, { 17, 17 }, { 17, 18 }, { 16, 20 },\n { 18, 17 }, { 18, 17 }, { 18, 17 }, { 18, 18 }, { 18, 18 }, { 18, 18 }, { 18, 19 }, { 17, 21 },\n { 19, 18 }, { 19, 18 }, { 20, 16 }, { 19, 19 }, { 19, 19 }, { 19, 19 }, { 19, 20 }, { 19, 20 },\n { 19, 20 }, { 19, 21 }, { 20, 19 }, { 20, 19 }, { 21, 18 }, { 20, 20 }, { 20, 20 }, { 20, 21 },\n { 20, 21 }, { 21, 20 }, { 21, 20 }, { 21, 20 }, { 22, 19 }, { 21, 21 }, { 21, 21 }, { 21, 22 },\n { 20, 24 }, { 22, 21 }, { 22, 21 }, { 22, 21 }, { 22, 22 }, { 22, 22 }, { 22, 22 }, { 22, 23 },\n { 21, 25 }, { 23, 22 }, { 23, 22 }, { 24, 20 }, { 23, 23 }, { 23, 23 }, { 23, 23 }, { 23, 24 },\n { 23, 24 }, { 23, 24 }, { 23, 25 }, { 24, 23 }, { 24, 23 }, { 25, 22 }, { 24, 24 }, { 24, 24 },\n { 24, 25 }, { 24, 25 }, { 25, 24 }, { 25, 24 }, { 25, 24 }, { 26, 23 }, { 25, 25 }, { 25, 25 },\n { 25, 26 }, { 24, 28 }, { 26, 25 }, { 26, 25 }, { 26, 25 }, { 26, 26 }, { 26, 26 }, { 26, 26 },\n { 26, 27 }, { 25, 29 }, { 27, 26 }, { 27, 26 }, { 28, 24 }, { 27, 27 }, { 27, 27 }, { 27, 27 },\n { 27, 28 }, { 27, 28 }, { 27, 28 }, { 27, 29 }, { 28, 27 }, { 28, 27 }, { 29, 26 }, { 28, 28 },\n { 28, 28 }, { 28, 29 }, { 28, 29 }, { 29, 28 }, { 29, 28 }, { 29, 28 }, { 30, 27 }, { 29, 29 },\n { 29, 29 }, { 29, 30 }, { 29, 30 }, { 30, 29 }, { 30, 29 }, { 30, 29 }, { 30, 30 }, { 30, 30 },\n { 30, 30 }, { 30, 31 }, { 30, 31 }, { 31, 30 }, { 31, 30 }, { 31, 30 }, { 31, 31 }, { 31, 31 },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_dxt.h", + "line": 95, + "column": 1, + "source_line": "static const unsigned char stb__OMatch5[256][2] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stb__OMatch6": { + "name": "stb__OMatch6", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const unsigned char stb__OMatch6[256][2]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "256", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [ + "const" + ], + "source_text": "const unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0, 0 }, { 0, 1 }, { 1, 0 }, { 1, 1 }, { 1, 1 }, { 1, 2 }, { 2, 1 }, { 2, 2 },\n { 2, 2 }, { 2, 3 }, { 3, 2 }, { 3, 3 }, { 3, 3 }, { 3, 4 }, { 4, 3 }, { 4, 4 },\n { 4, 4 }, { 4, 5 }, { 5, 4 }, { 5, 5 }, { 5, 5 }, { 5, 6 }, { 6, 5 }, { 6, 6 },\n { 6, 6 }, { 6, 7 }, { 7, 6 }, { 7, 7 }, { 7, 7 }, { 7, 8 }, { 8, 7 }, { 8, 8 },\n { 8, 8 }, { 8, 9 }, { 9, 8 }, { 9, 9 }, { 9, 9 }, { 9, 10 }, { 10, 9 }, { 10, 10 },\n { 10, 10 }, { 10, 11 }, { 11, 10 }, { 8, 16 }, { 11, 11 }, { 11, 12 }, { 12, 11 }, { 9, 17 },\n { 12, 12 }, { 12, 13 }, { 13, 12 }, { 11, 16 }, { 13, 13 }, { 13, 14 }, { 14, 13 }, { 12, 17 },\n { 14, 14 }, { 14, 15 }, { 15, 14 }, { 14, 16 }, { 15, 15 }, { 15, 16 }, { 16, 14 }, { 16, 15 },\n { 17, 14 }, { 16, 16 }, { 16, 17 }, { 17, 16 }, { 18, 15 }, { 17, 17 }, { 17, 18 }, { 18, 17 },\n { 20, 14 }, { 18, 18 }, { 18, 19 }, { 19, 18 }, { 21, 15 }, { 19, 19 }, { 19, 20 }, { 20, 19 },\n { 20, 20 }, { 20, 20 }, { 20, 21 }, { 21, 20 }, { 21, 21 }, { 21, 21 }, { 21, 22 }, { 22, 21 },\n { 22, 22 }, { 22, 22 }, { 22, 23 }, { 23, 22 }, { 23, 23 }, { 23, 23 }, { 23, 24 }, { 24, 23 },\n { 24, 24 }, { 24, 24 }, { 24, 25 }, { 25, 24 }, { 25, 25 }, { 25, 25 }, { 25, 26 }, { 26, 25 },\n { 26, 26 }, { 26, 26 }, { 26, 27 }, { 27, 26 }, { 24, 32 }, { 27, 27 }, { 27, 28 }, { 28, 27 },\n { 25, 33 }, { 28, 28 }, { 28, 29 }, { 29, 28 }, { 27, 32 }, { 29, 29 }, { 29, 30 }, { 30, 29 },\n { 28, 33 }, { 30, 30 }, { 30, 31 }, { 31, 30 }, { 30, 32 }, { 31, 31 }, { 31, 32 }, { 32, 30 },\n { 32, 31 }, { 33, 30 }, { 32, 32 }, { 32, 33 }, { 33, 32 }, { 34, 31 }, { 33, 33 }, { 33, 34 },\n { 34, 33 }, { 36, 30 }, { 34, 34 }, { 34, 35 }, { 35, 34 }, { 37, 31 }, { 35, 35 }, { 35, 36 },\n { 36, 35 }, { 36, 36 }, { 36, 36 }, { 36, 37 }, { 37, 36 }, { 37, 37 }, { 37, 37 }, { 37, 38 },\n { 38, 37 }, { 38, 38 }, { 38, 38 }, { 38, 39 }, { 39, 38 }, { 39, 39 }, { 39, 39 }, { 39, 40 },\n { 40, 39 }, { 40, 40 }, { 40, 40 }, { 40, 41 }, { 41, 40 }, { 41, 41 }, { 41, 41 }, { 41, 42 },\n { 42, 41 }, { 42, 42 }, { 42, 42 }, { 42, 43 }, { 43, 42 }, { 40, 48 }, { 43, 43 }, { 43, 44 },\n { 44, 43 }, { 41, 49 }, { 44, 44 }, { 44, 45 }, { 45, 44 }, { 43, 48 }, { 45, 45 }, { 45, 46 },\n { 46, 45 }, { 44, 49 }, { 46, 46 }, { 46, 47 }, { 47, 46 }, { 46, 48 }, { 47, 47 }, { 47, 48 },\n { 48, 46 }, { 48, 47 }, { 49, 46 }, { 48, 48 }, { 48, 49 }, { 49, 48 }, { 50, 47 }, { 49, 49 },\n { 49, 50 }, { 50, 49 }, { 52, 46 }, { 50, 50 }, { 50, 51 }, { 51, 50 }, { 53, 47 }, { 51, 51 },\n { 51, 52 }, { 52, 51 }, { 52, 52 }, { 52, 52 }, { 52, 53 }, { 53, 52 }, { 53, 53 }, { 53, 53 },\n { 53, 54 }, { 54, 53 }, { 54, 54 }, { 54, 54 }, { 54, 55 }, { 55, 54 }, { 55, 55 }, { 55, 55 },\n { 55, 56 }, { 56, 55 }, { 56, 56 }, { 56, 56 }, { 56, 57 }, { 57, 56 }, { 57, 57 }, { 57, 57 },\n { 57, 58 }, { 58, 57 }, { 58, 58 }, { 58, 58 }, { 58, 59 }, { 59, 58 }, { 59, 59 }, { 59, 59 },\n { 59, 60 }, { 60, 59 }, { 60, 60 }, { 60, 60 }, { 60, 61 }, { 61, 60 }, { 61, 61 }, { 61, 61 },\n { 61, 62 }, { 62, 61 }, { 62, 62 }, { 62, 62 }, { 62, 63 }, { 63, 62 }, { 63, 63 }, { 63, 63 },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_dxt.h", + "line": 129, + "column": 1, + "source_line": "static const unsigned char stb__OMatch6[256][2] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stb__midpoints5": { + "name": "stb__midpoints5", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const float stb__midpoints5[32]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "32", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [ + "const" + ], + "source_text": "const float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0.015686f, 0.047059f, 0.078431f, 0.111765f, 0.145098f, 0.176471f, 0.207843f, 0.241176f, 0.274510f, 0.305882f, 0.337255f, 0.370588f, 0.403922f, 0.435294f, 0.466667f, 0.5f,\n 0.533333f, 0.564706f, 0.596078f, 0.629412f, 0.662745f, 0.694118f, 0.725490f, 0.758824f, 0.792157f, 0.823529f, 0.854902f, 0.888235f, 0.921569f, 0.952941f, 0.984314f, 1.0f\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_dxt.h", + "line": 369, + "column": 1, + "source_line": "static const float stb__midpoints5[32] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stb__midpoints6": { + "name": "stb__midpoints6", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const float stb__midpoints6[64]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "64", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [ + "const" + ], + "source_text": "const float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0.007843f, 0.023529f, 0.039216f, 0.054902f, 0.070588f, 0.086275f, 0.101961f, 0.117647f, 0.133333f, 0.149020f, 0.164706f, 0.180392f, 0.196078f, 0.211765f, 0.227451f, 0.245098f,\n 0.262745f, 0.278431f, 0.294118f, 0.309804f, 0.325490f, 0.341176f, 0.356863f, 0.372549f, 0.388235f, 0.403922f, 0.419608f, 0.435294f, 0.450980f, 0.466667f, 0.482353f, 0.500000f,\n 0.517647f, 0.533333f, 0.549020f, 0.564706f, 0.580392f, 0.596078f, 0.611765f, 0.627451f, 0.643137f, 0.658824f, 0.674510f, 0.690196f, 0.705882f, 0.721569f, 0.737255f, 0.754902f,\n 0.772549f, 0.788235f, 0.803922f, 0.819608f, 0.835294f, 0.850980f, 0.866667f, 0.882353f, 0.898039f, 0.913725f, 0.929412f, 0.945098f, 0.960784f, 0.976471f, 0.992157f, 1.0f\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_dxt.h", + "line": 374, + "column": 1, + "source_line": "static const float stb__midpoints6[64] = {" + }, + "callback_policy": null, + "declaration_locations": [] + } + }, "macros": { "STB_INCLUDE_STB_DXT_H": { "name": "STB_INCLUDE_STB_DXT_H", @@ -4156,58 +4470,6 @@ }, "unit_kind": "declarator", "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_dxt.h", - "line": 95, - "column": 1, - "source_line": "static const unsigned char stb__OMatch5[256][2] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_dxt.h", - "line": 129, - "column": 1, - "source_line": "static const unsigned char stb__OMatch6[256][2] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_dxt.h", - "line": 369, - "column": 1, - "source_line": "static const float stb__midpoints5[32] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_dxt.h", - "line": 374, - "column": 1, - "source_line": "static const float stb__midpoints6[64] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null } ] } diff --git a/tests/parser/c/fixtures/stb/stb_easy_font.json b/tests/parser/c/fixtures/stb/stb_easy_font.json index 470444508..81cefa970 100644 --- a/tests/parser/c/fixtures/stb/stb_easy_font.json +++ b/tests/parser/c/fixtures/stb/stb_easy_font.json @@ -945,7 +945,7 @@ "static" ], "initializer": { - "source_text": "" + "source_text": "{\n { 6, 0, 0 }, { 3, 0, 0 }, { 5, 1, 1 }, { 7, 1, 4 },\n { 7, 3, 7 }, { 7, 6, 12 }, { 7, 8, 19 }, { 4, 16, 21 },\n { 4, 17, 22 }, { 4, 19, 23 }, { 23, 21, 24 }, { 23, 22, 31 },\n { 20, 23, 34 }, { 22, 23, 36 }, { 19, 24, 36 }, { 21, 25, 36 },\n { 6, 25, 39 }, { 6, 27, 43 }, { 6, 28, 45 }, { 6, 30, 49 },\n { 6, 33, 53 }, { 6, 34, 57 }, { 6, 40, 58 }, { 6, 46, 59 },\n { 6, 47, 62 }, { 6, 55, 64 }, { 19, 57, 68 }, { 20, 59, 68 },\n { 21, 61, 69 }, { 22, 66, 69 }, { 21, 68, 69 }, { 7, 73, 69 },\n { 9, 75, 74 }, { 6, 78, 81 }, { 6, 80, 85 }, { 6, 83, 90 },\n { 6, 85, 91 }, { 6, 87, 95 }, { 6, 90, 96 }, { 7, 92, 97 },\n { 6, 96,102 }, { 5, 97,106 }, { 6, 99,107 }, { 6,100,110 },\n { 6,100,115 }, { 7,101,116 }, { 6,101,121 }, { 6,101,125 },\n { 6,102,129 }, { 7,103,133 }, { 6,104,140 }, { 6,105,145 },\n { 7,107,149 }, { 6,108,151 }, { 7,109,155 }, { 7,109,160 },\n { 7,109,165 }, { 7,118,167 }, { 6,118,172 }, { 4,120,176 },\n { 6,122,177 }, { 4,122,181 }, { 23,124,182 }, { 22,129,182 },\n { 4,130,182 }, { 22,131,183 }, { 6,133,187 }, { 22,135,191 },\n { 6,137,192 }, { 22,139,196 }, { 6,144,197 }, { 22,147,198 },\n { 6,150,202 }, { 19,151,206 }, { 21,152,207 }, { 6,155,209 },\n { 3,160,210 }, { 23,160,211 }, { 22,164,216 }, { 22,165,220 },\n { 22,167,224 }, { 22,169,228 }, { 21,171,232 }, { 21,173,233 },\n { 5,178,233 }, { 22,179,234 }, { 23,180,238 }, { 23,180,243 },\n { 23,180,248 }, { 22,189,248 }, { 22,191,252 }, { 5,196,252 },\n { 3,203,252 }, { 5,203,253 }, { 22,210,253 }, { 0,214,253 },\n}" }, "bit_width": null, "source_location": { @@ -957,6 +957,84 @@ "callback_policy": null, "declaration_locations": [] }, + { + "name": "stb_easy_font_hseg", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stb_easy_font_hseg[214]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "214", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 97,37,69,84,28,51,2,18,10,49,98,41,65,25,81,105,33,9,97,1,97,37,37,36,\n 81,10,98,107,3,100,3,99,58,51,4,99,58,8,73,81,10,50,98,8,73,81,4,10,50,\n 98,8,25,33,65,81,10,50,17,65,97,25,33,25,49,9,65,20,68,1,65,25,49,41,\n 11,105,13,101,76,10,50,10,50,98,11,99,10,98,11,50,99,11,50,11,99,8,57,\n 58,3,99,99,107,10,10,11,10,99,11,5,100,41,65,57,41,65,9,17,81,97,3,107,\n 9,97,1,97,33,25,9,25,41,100,41,26,82,42,98,27,83,42,98,26,51,82,8,41,\n 35,8,10,26,82,114,42,1,114,8,9,73,57,81,41,97,18,8,8,25,26,26,82,26,82,\n 26,82,41,25,33,82,26,49,73,35,90,17,81,41,65,57,41,65,25,81,90,114,20,\n 84,73,57,41,49,25,33,65,81,9,97,1,97,25,33,65,81,57,33,25,41,25,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_easy_font.h", + "line": 143, + "column": 1, + "source_line": "static unsigned char stb_easy_font_hseg[214] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stb_easy_font_vseg", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stb_easy_font_vseg[253]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "253", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 4,2,8,10,15,8,15,33,8,15,8,73,82,73,57,41,82,10,82,18,66,10,21,29,1,65,\n 27,8,27,9,65,8,10,50,97,74,66,42,10,21,57,41,29,25,14,81,73,57,26,8,8,\n 26,66,3,8,8,15,19,21,90,58,26,18,66,18,105,89,28,74,17,8,73,57,26,21,\n 8,42,41,42,8,28,22,8,8,30,7,8,8,26,66,21,7,8,8,29,7,7,21,8,8,8,59,7,8,\n 8,15,29,8,8,14,7,57,43,10,82,7,7,25,42,25,15,7,25,41,15,21,105,105,29,\n 7,57,57,26,21,105,73,97,89,28,97,7,57,58,26,82,18,57,57,74,8,30,6,8,8,\n 14,3,58,90,58,11,7,74,43,74,15,2,82,2,42,75,42,10,67,57,41,10,7,2,42,\n 74,106,15,2,35,8,8,29,7,8,8,59,35,51,8,8,15,35,30,35,8,8,30,7,8,8,60,\n 36,8,45,7,7,36,8,43,8,44,21,8,8,44,35,8,8,43,23,8,8,43,35,8,8,31,21,15,\n 20,8,8,28,18,58,89,58,26,21,89,73,89,29,20,8,8,30,7,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_easy_font.h", + "line": 155, + "column": 1, + "source_line": "static unsigned char stb_easy_font_vseg[253] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, { "name": "stb_easy_font_spacing_val", "type": { @@ -1062,34 +1140,7 @@ } ], "macro_dependencies": [], - "diagnostics": [ - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_easy_font.h", - "line": 143, - "column": 1, - "source_line": "static unsigned char stb_easy_font_hseg[214] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_easy_font.h", - "line": 155, - "column": 1, - "source_line": "static unsigned char stb_easy_font_vseg[253] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - } - ] + "diagnostics": [] } }, "functions": { @@ -1898,7 +1949,7 @@ "static" ], "initializer": { - "source_text": "" + "source_text": "{\n { 6, 0, 0 }, { 3, 0, 0 }, { 5, 1, 1 }, { 7, 1, 4 },\n { 7, 3, 7 }, { 7, 6, 12 }, { 7, 8, 19 }, { 4, 16, 21 },\n { 4, 17, 22 }, { 4, 19, 23 }, { 23, 21, 24 }, { 23, 22, 31 },\n { 20, 23, 34 }, { 22, 23, 36 }, { 19, 24, 36 }, { 21, 25, 36 },\n { 6, 25, 39 }, { 6, 27, 43 }, { 6, 28, 45 }, { 6, 30, 49 },\n { 6, 33, 53 }, { 6, 34, 57 }, { 6, 40, 58 }, { 6, 46, 59 },\n { 6, 47, 62 }, { 6, 55, 64 }, { 19, 57, 68 }, { 20, 59, 68 },\n { 21, 61, 69 }, { 22, 66, 69 }, { 21, 68, 69 }, { 7, 73, 69 },\n { 9, 75, 74 }, { 6, 78, 81 }, { 6, 80, 85 }, { 6, 83, 90 },\n { 6, 85, 91 }, { 6, 87, 95 }, { 6, 90, 96 }, { 7, 92, 97 },\n { 6, 96,102 }, { 5, 97,106 }, { 6, 99,107 }, { 6,100,110 },\n { 6,100,115 }, { 7,101,116 }, { 6,101,121 }, { 6,101,125 },\n { 6,102,129 }, { 7,103,133 }, { 6,104,140 }, { 6,105,145 },\n { 7,107,149 }, { 6,108,151 }, { 7,109,155 }, { 7,109,160 },\n { 7,109,165 }, { 7,118,167 }, { 6,118,172 }, { 4,120,176 },\n { 6,122,177 }, { 4,122,181 }, { 23,124,182 }, { 22,129,182 },\n { 4,130,182 }, { 22,131,183 }, { 6,133,187 }, { 22,135,191 },\n { 6,137,192 }, { 22,139,196 }, { 6,144,197 }, { 22,147,198 },\n { 6,150,202 }, { 19,151,206 }, { 21,152,207 }, { 6,155,209 },\n { 3,160,210 }, { 23,160,211 }, { 22,164,216 }, { 22,165,220 },\n { 22,167,224 }, { 22,169,228 }, { 21,171,232 }, { 21,173,233 },\n { 5,178,233 }, { 22,179,234 }, { 23,180,238 }, { 23,180,243 },\n { 23,180,248 }, { 22,189,248 }, { 22,191,252 }, { 5,196,252 },\n { 3,203,252 }, { 5,203,253 }, { 22,210,253 }, { 0,214,253 },\n}" }, "bit_width": null, "source_location": { @@ -1910,6 +1961,84 @@ "callback_policy": null, "declaration_locations": [] }, + "stb_easy_font_hseg": { + "name": "stb_easy_font_hseg", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stb_easy_font_hseg[214]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "214", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 97,37,69,84,28,51,2,18,10,49,98,41,65,25,81,105,33,9,97,1,97,37,37,36,\n 81,10,98,107,3,100,3,99,58,51,4,99,58,8,73,81,10,50,98,8,73,81,4,10,50,\n 98,8,25,33,65,81,10,50,17,65,97,25,33,25,49,9,65,20,68,1,65,25,49,41,\n 11,105,13,101,76,10,50,10,50,98,11,99,10,98,11,50,99,11,50,11,99,8,57,\n 58,3,99,99,107,10,10,11,10,99,11,5,100,41,65,57,41,65,9,17,81,97,3,107,\n 9,97,1,97,33,25,9,25,41,100,41,26,82,42,98,27,83,42,98,26,51,82,8,41,\n 35,8,10,26,82,114,42,1,114,8,9,73,57,81,41,97,18,8,8,25,26,26,82,26,82,\n 26,82,41,25,33,82,26,49,73,35,90,17,81,41,65,57,41,65,25,81,90,114,20,\n 84,73,57,41,49,25,33,65,81,9,97,1,97,25,33,65,81,57,33,25,41,25,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_easy_font.h", + "line": 143, + "column": 1, + "source_line": "static unsigned char stb_easy_font_hseg[214] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stb_easy_font_vseg": { + "name": "stb_easy_font_vseg", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stb_easy_font_vseg[253]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "253", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 4,2,8,10,15,8,15,33,8,15,8,73,82,73,57,41,82,10,82,18,66,10,21,29,1,65,\n 27,8,27,9,65,8,10,50,97,74,66,42,10,21,57,41,29,25,14,81,73,57,26,8,8,\n 26,66,3,8,8,15,19,21,90,58,26,18,66,18,105,89,28,74,17,8,73,57,26,21,\n 8,42,41,42,8,28,22,8,8,30,7,8,8,26,66,21,7,8,8,29,7,7,21,8,8,8,59,7,8,\n 8,15,29,8,8,14,7,57,43,10,82,7,7,25,42,25,15,7,25,41,15,21,105,105,29,\n 7,57,57,26,21,105,73,97,89,28,97,7,57,58,26,82,18,57,57,74,8,30,6,8,8,\n 14,3,58,90,58,11,7,74,43,74,15,2,82,2,42,75,42,10,67,57,41,10,7,2,42,\n 74,106,15,2,35,8,8,29,7,8,8,59,35,51,8,8,15,35,30,35,8,8,30,7,8,8,60,\n 36,8,45,7,7,36,8,43,8,44,21,8,8,44,35,8,8,43,23,8,8,43,35,8,8,31,21,15,\n 20,8,8,28,18,58,89,58,26,21,89,73,89,29,20,8,8,30,7,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_easy_font.h", + "line": 155, + "column": 1, + "source_line": "static unsigned char stb_easy_font_vseg[253] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, "stb_easy_font_spacing_val": { "name": "stb_easy_font_spacing_val", "type": { @@ -1998,32 +2127,5 @@ "header_source_pairs": { "stb/stb_easy_font.h": [] }, - "diagnostics": [ - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_easy_font.h", - "line": 143, - "column": 1, - "source_line": "static unsigned char stb_easy_font_hseg[214] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_easy_font.h", - "line": 155, - "column": 1, - "source_line": "static unsigned char stb_easy_font_vseg[253] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - } - ] + "diagnostics": [] } diff --git a/tests/parser/c/fixtures/stb/stb_herringbone_wang_tile.json b/tests/parser/c/fixtures/stb/stb_herringbone_wang_tile.json index 9c8c9ab1b..8b9c1e555 100644 --- a/tests/parser/c/fixtures/stb/stb_herringbone_wang_tile.json +++ b/tests/parser/c/fixtures/stb/stb_herringbone_wang_tile.json @@ -5206,6 +5206,203 @@ }, "callback_policy": null, "declaration_locations": [] + }, + { + "name": "stbhw__black", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbhw__black[3]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,0,0 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_herringbone_wang_tile.h", + "line": 978, + "column": 1, + "source_line": "static unsigned char stbhw__black[3] = { 0,0,0 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbhw__color", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbhw__color[7][8][3]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "7", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { {255,51,51} , {143,143,29}, {0,199,199}, {159,119,199}, {0,149,199} , {143, 0,143}, {255,128,0}, {64,255,0}, },\n { {235,255,30 }, {255,0,255}, {199,139,119}, {29,143, 57}, {143,0,71} , { 0,143,143}, {0,99,199}, {143,71,0}, },\n { {0,149,199} , {143, 0,143}, {255,128,0}, {64,255,0}, {255,191,0} , {51,255,153}, {0,0,143}, {199,119,159},},\n { {143,0,71} , { 0,143,143}, {0,99,199}, {143,71,0}, {255,190,153}, { 0,255,255}, {128,0,255}, {255,51,102},},\n { {255,191,0} , {51,255,153}, {0,0,143}, {199,119,159}, {255,51,51} , {143,143,29}, {0,199,199}, {159,119,199},},\n { {255,190,153}, { 0,255,255}, {128,0,255}, {255,51,102}, {235,255,30 }, {255,0,255}, {199,139,119}, {29,143, 57}, },\n\n { {40,40,40 }, { 90,90,90 }, { 150,150,150 }, { 200,200,200 },\n { 255,90,90 }, { 160,160,80}, { 50,150,150 }, { 200,50,200 } },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_herringbone_wang_tile.h", + "line": 984, + "column": 1, + "source_line": "static unsigned char stbhw__color[7][8][3] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbhw__corner_colors", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "unsigned char stbhw__corner_colors[4][4][3]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [], + "initializer": { + "source_text": "{\n { { 255,0,0 }, { 200,200,200 }, { 100,100,200 }, { 255,200,150 }, },\n { { 0,0,255 }, { 255,255,0 }, { 100,200,100 }, { 150,255,200 }, },\n { { 255,0,255 }, { 80,80,80 }, { 200,100,100 }, { 200,150,255 }, },\n { { 0,255,255 }, { 0,255,0 }, { 200,120,200 }, { 255,200,200 }, },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_herringbone_wang_tile.h", + "line": 1055, + "column": 1, + "source_line": "unsigned char stbhw__corner_colors[4][4][3] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbhw__corner_colors_to_edge_color", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "int stbhw__corner_colors_to_edge_color[4][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [], + "source_text": "int" + } + ] + }, + "storage": [], + "initializer": { + "source_text": "{\n \n { 0, 1, 4, 9, }, \n { 2, 3, 5, 10, }, \n { 6, 7, 8, 11, }, \n { 12, 13, 14, 15, }, \n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_herringbone_wang_tile.h", + "line": 1063, + "column": 1, + "source_line": "int stbhw__corner_colors_to_edge_color[4][4] =" + }, + "callback_policy": null, + "declaration_locations": [] } ], "macros": [ @@ -5870,58 +6067,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBHW_EXTERN" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_herringbone_wang_tile.h", - "line": 978, - "column": 1, - "source_line": "static unsigned char stbhw__black[3] = { 0,0,0 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_herringbone_wang_tile.h", - "line": 984, - "column": 1, - "source_line": "static unsigned char stbhw__color[7][8][3] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_herringbone_wang_tile.h", - "line": 1055, - "column": 1, - "source_line": "unsigned char stbhw__corner_colors[4][4][3] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_herringbone_wang_tile.h", - "line": 1063, - "column": 1, - "source_line": "int stbhw__corner_colors_to_edge_color[4][4] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'STBHW_EXTERN'; provide preprocessed input to parse it.", @@ -10225,6 +10370,203 @@ }, "callback_policy": null, "declaration_locations": [] + }, + "stbhw__black": { + "name": "stbhw__black", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbhw__black[3]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,0,0 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_herringbone_wang_tile.h", + "line": 978, + "column": 1, + "source_line": "static unsigned char stbhw__black[3] = { 0,0,0 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbhw__color": { + "name": "stbhw__color", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbhw__color[7][8][3]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "7", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { {255,51,51} , {143,143,29}, {0,199,199}, {159,119,199}, {0,149,199} , {143, 0,143}, {255,128,0}, {64,255,0}, },\n { {235,255,30 }, {255,0,255}, {199,139,119}, {29,143, 57}, {143,0,71} , { 0,143,143}, {0,99,199}, {143,71,0}, },\n { {0,149,199} , {143, 0,143}, {255,128,0}, {64,255,0}, {255,191,0} , {51,255,153}, {0,0,143}, {199,119,159},},\n { {143,0,71} , { 0,143,143}, {0,99,199}, {143,71,0}, {255,190,153}, { 0,255,255}, {128,0,255}, {255,51,102},},\n { {255,191,0} , {51,255,153}, {0,0,143}, {199,119,159}, {255,51,51} , {143,143,29}, {0,199,199}, {159,119,199},},\n { {255,190,153}, { 0,255,255}, {128,0,255}, {255,51,102}, {235,255,30 }, {255,0,255}, {199,139,119}, {29,143, 57}, },\n\n { {40,40,40 }, { 90,90,90 }, { 150,150,150 }, { 200,200,200 },\n { 255,90,90 }, { 160,160,80}, { 50,150,150 }, { 200,50,200 } },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_herringbone_wang_tile.h", + "line": 984, + "column": 1, + "source_line": "static unsigned char stbhw__color[7][8][3] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbhw__corner_colors": { + "name": "stbhw__corner_colors", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "unsigned char stbhw__corner_colors[4][4][3]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [], + "initializer": { + "source_text": "{\n { { 255,0,0 }, { 200,200,200 }, { 100,100,200 }, { 255,200,150 }, },\n { { 0,0,255 }, { 255,255,0 }, { 100,200,100 }, { 150,255,200 }, },\n { { 255,0,255 }, { 80,80,80 }, { 200,100,100 }, { 200,150,255 }, },\n { { 0,255,255 }, { 0,255,0 }, { 200,120,200 }, { 255,200,200 }, },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_herringbone_wang_tile.h", + "line": 1055, + "column": 1, + "source_line": "unsigned char stbhw__corner_colors[4][4][3] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbhw__corner_colors_to_edge_color": { + "name": "stbhw__corner_colors_to_edge_color", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "int stbhw__corner_colors_to_edge_color[4][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [], + "source_text": "int" + } + ] + }, + "storage": [], + "initializer": { + "source_text": "{\n \n { 0, 1, 4, 9, }, \n { 2, 3, 5, 10, }, \n { 6, 7, 8, 11, }, \n { 12, 13, 14, 15, }, \n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_herringbone_wang_tile.h", + "line": 1063, + "column": 1, + "source_line": "int stbhw__corner_colors_to_edge_color[4][4] =" + }, + "callback_policy": null, + "declaration_locations": [] } }, "macros": { @@ -10561,58 +10903,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBHW_EXTERN" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_herringbone_wang_tile.h", - "line": 978, - "column": 1, - "source_line": "static unsigned char stbhw__black[3] = { 0,0,0 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_herringbone_wang_tile.h", - "line": 984, - "column": 1, - "source_line": "static unsigned char stbhw__color[7][8][3] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_herringbone_wang_tile.h", - "line": 1055, - "column": 1, - "source_line": "unsigned char stbhw__corner_colors[4][4][3] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_herringbone_wang_tile.h", - "line": 1063, - "column": 1, - "source_line": "int stbhw__corner_colors_to_edge_color[4][4] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'STBHW_EXTERN'; provide preprocessed input to parse it.", diff --git a/tests/parser/c/fixtures/stb/stb_image.json b/tests/parser/c/fixtures/stb/stb_image.json index ba84efa99..8f49e0b91 100644 --- a/tests/parser/c/fixtures/stb/stb_image.json +++ b/tests/parser/c/fixtures/stb/stb_image.json @@ -11407,6 +11407,462 @@ "callback_policy": null, "declaration_locations": [] }, + { + "name": "img_comp", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "struct img_comp[4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CStruct", + "qualifiers": [], + "source_text": "", + "name": null, + "members": [ + { + "name": "id", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int id" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1965, + "column": 7, + "source_line": " int id;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "h", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int h" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1966, + "column": 7, + "source_line": " int h,v;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "v", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1966, + "column": 7, + "source_line": " int h,v;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "tq", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int tq" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1967, + "column": 7, + "source_line": " int tq;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "hd", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int hd" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1968, + "column": 7, + "source_line": " int hd,ha;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "ha", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int ha" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1968, + "column": 7, + "source_line": " int hd,ha;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "dc_pred", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int dc_pred" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1969, + "column": 7, + "source_line": " int dc_pred;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "x", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int x" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1971, + "column": 7, + "source_line": " int x,y,w2,h2;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "y", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int y" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1971, + "column": 7, + "source_line": " int x,y,w2,h2;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "w2", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int w2" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1971, + "column": 7, + "source_line": " int x,y,w2,h2;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "h2", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int h2" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1971, + "column": 7, + "source_line": " int x,y,w2,h2;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "data", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbi_uc *data", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbi_uc", + "name": "stbi_uc", + "type": null, + "source_location": null, + "declaration_locations": [] + } + ] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1972, + "column": 7, + "source_line": " stbi_uc *data;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "raw_data", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "void *raw_data", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + } + ] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1973, + "column": 7, + "source_line": " void *raw_data, *raw_coeff;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "raw_coeff", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "void *raw_coeff", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + } + ] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1973, + "column": 7, + "source_line": " void *raw_data, *raw_coeff;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "linebuf", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbi_uc *linebuf", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbi_uc", + "name": "stbi_uc", + "type": null, + "source_location": null, + "declaration_locations": [] + } + ] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1974, + "column": 7, + "source_line": " stbi_uc *linebuf;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "coeff", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "short *coeff", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CShort", + "qualifiers": [], + "source_text": "short" + } + ] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1975, + "column": 7, + "source_line": " short *coeff; // progressive only" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "coeff_w", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int coeff_w" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1976, + "column": 7, + "source_line": " int coeff_w, coeff_h; // number of 8x8 coefficient blocks" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "coeff_h", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int coeff_h" + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1976, + "column": 7, + "source_line": " int coeff_w, coeff_h; // number of 8x8 coefficient blocks" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], + "anonymous_id": "struct@stb/stb_image.h:1963:4", + "is_incomplete": false, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1963, + "column": 4, + "source_line": " struct" + } + } + ] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 1963, + "column": 4, + "source_line": " struct" + }, + "callback_policy": null, + "declaration_locations": [] + }, { "name": "code_buffer", "type": { @@ -24568,6 +25024,33 @@ } ], "variables": [ + { + "name": "stbi__stdio_callbacks", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "static stbi_io_callbacks stbi__stdio_callbacks", + "name": "stbi_io_callbacks", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbi__stdio_read,\n stbi__stdio_skip,\n stbi__stdio_eof,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 870, + "column": 1, + "source_line": "static stbi_io_callbacks stbi__stdio_callbacks =" + }, + "callback_policy": null, + "declaration_locations": [] + }, { "name": "stbi__vertically_flip_on_load_global", "type": { @@ -24683,6 +25166,433 @@ "callback_policy": null, "declaration_locations": [] }, + { + "name": "stbi__bmask", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbi__uint32 stbi__bmask[17]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "17", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi__uint32" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 2094, + "column": 1, + "source_line": "static const stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbi__jbias", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int stbi__jbias[16]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "16", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{0,-1,-3,-7,-15,-31,-63,-127,-255,-511,-1023,-2047,-4095,-8191,-16383,-32767}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 2149, + "column": 1, + "source_line": "static const int stbi__jbias[16] = {0,-1,-3,-7,-15,-31,-63,-127,-255,-511,-1023,-2047,-4095,-8191,-16383,-32767};" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbi__jpeg_dezigzag", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbi_uc stbi__jpeg_dezigzag[64+15]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "64+15", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi_uc" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0, 1, 8, 16, 9, 2, 3, 10,\n 17, 24, 32, 25, 18, 11, 4, 5,\n 12, 19, 26, 33, 40, 48, 41, 34,\n 27, 20, 13, 6, 7, 14, 21, 28,\n 35, 42, 49, 56, 57, 50, 43, 36,\n 29, 22, 15, 23, 30, 37, 44, 51,\n 58, 59, 52, 45, 38, 31, 39, 46,\n 53, 60, 61, 54, 47, 55, 62, 63,\n \n 63, 63, 63, 63, 63, 63, 63, 63,\n 63, 63, 63, 63, 63, 63, 63\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 2194, + "column": 1, + "source_line": "static const stbi_uc stbi__jpeg_dezigzag[64+15] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbi__zlength_base", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int stbi__zlength_base[31]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "31", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 3,4,5,6,7,8,9,10,11,13,\n 15,17,19,23,27,31,35,43,51,59,\n 67,83,99,115,131,163,195,227,258,0,0 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4295, + "column": 1, + "source_line": "static const int stbi__zlength_base[31] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbi__zlength_extra", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int stbi__zlength_extra[31]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "31", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4300, + "column": 1, + "source_line": "static const int stbi__zlength_extra[31]=" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbi__zdist_base", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int stbi__zdist_base[32]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "32", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,\n257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4303, + "column": 1, + "source_line": "static const int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193," + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbi__zdist_extra", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int stbi__zdist_extra[32]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "32", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4306, + "column": 1, + "source_line": "static const int stbi__zdist_extra[32] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbi__zdefault_length", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBI__ZNSYMS", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi_uc" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,\n 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,\n 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,\n 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,\n 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4452, + "column": 1, + "source_line": "static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbi__zdefault_distance", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbi_uc stbi__zdefault_distance[32]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "32", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi_uc" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4464, + "column": 1, + "source_line": "static const stbi_uc stbi__zdefault_distance[32] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "first_row_filter", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbi_uc first_row_filter[5]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "5", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi_uc" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBI__F_none,\n STBI__F_sub,\n STBI__F_none,\n STBI__F_avg_first,\n STBI__F_sub \n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4648, + "column": 1, + "source_line": "static stbi_uc first_row_filter[5] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbi__depth_scale_table", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbi_uc stbi__depth_scale_table[9]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "9", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi_uc" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4670, + "column": 1, + "source_line": "static const stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, { "name": "stbi__unpremultiply_on_load_global", "type": { @@ -31391,19 +32301,6 @@ "unit_kind": "declarator", "unit_name": null }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 870, - "column": 1, - "source_line": "static stbi_io_callbacks stbi__stdio_callbacks =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'STBI_THREAD_LOCAL'; provide preprocessed input to parse it.", @@ -31833,32 +32730,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbi_inline" }, - { - "code": "C_UNSUPPORTED_FIELD_DECLARATION", - "message": "Nested aggregate field definitions are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 1963, - "column": 4, - "source_line": " struct" - }, - "unit_kind": "struct_field", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 2094, - "column": 1, - "source_line": "static const stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbi_inline'; provide preprocessed input to parse it.", @@ -31872,19 +32743,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbi_inline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 2149, - "column": 1, - "source_line": "static const int stbi__jbias[16] = {0,-1,-3,-7,-15,-31,-63,-127,-255,-511,-1023,-2047,-4095,-8191,-16383,-32767};" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbi_inline'; provide preprocessed input to parse it.", @@ -31924,19 +32782,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbi_inline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 2194, - "column": 1, - "source_line": "static const stbi_uc stbi__jpeg_dezigzag[64+15] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbi_inline'; provide preprocessed input to parse it.", @@ -32028,84 +32873,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbi_inline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4295, - "column": 1, - "source_line": "static const int stbi__zlength_base[31] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4300, - "column": 1, - "source_line": "static const int stbi__zlength_extra[31]=" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4303, - "column": 1, - "source_line": "static const int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193," - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4306, - "column": 1, - "source_line": "static const int stbi__zdist_extra[32] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4452, - "column": 1, - "source_line": "static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4464, - "column": 1, - "source_line": "static const stbi_uc stbi__zdefault_distance[32] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'STBIDEF'; provide preprocessed input to parse it.", @@ -32184,32 +32951,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBIDEF" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4648, - "column": 1, - "source_line": "static stbi_uc first_row_filter[5] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4670, - "column": 1, - "source_line": "static const stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'STBIDEF'; provide preprocessed input to parse it.", @@ -53045,6 +53786,27 @@ } }, "variables": { + "stbi__stdio_callbacks": { + "name": "stbi__stdio_callbacks", + "type": { + "reference": "stbi_io_callbacks" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbi__stdio_read,\n stbi__stdio_skip,\n stbi__stdio_eof,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 870, + "column": 1, + "source_line": "static stbi_io_callbacks stbi__stdio_callbacks =" + }, + "callback_policy": null, + "declaration_locations": [] + }, "stbi__vertically_flip_on_load_global": { "name": "stbi__vertically_flip_on_load_global", "type": { @@ -53160,6 +53922,433 @@ "callback_policy": null, "declaration_locations": [] }, + "stbi__bmask": { + "name": "stbi__bmask", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbi__uint32 stbi__bmask[17]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "17", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi__uint32" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 2094, + "column": 1, + "source_line": "static const stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbi__jbias": { + "name": "stbi__jbias", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int stbi__jbias[16]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "16", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{0,-1,-3,-7,-15,-31,-63,-127,-255,-511,-1023,-2047,-4095,-8191,-16383,-32767}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 2149, + "column": 1, + "source_line": "static const int stbi__jbias[16] = {0,-1,-3,-7,-15,-31,-63,-127,-255,-511,-1023,-2047,-4095,-8191,-16383,-32767};" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbi__jpeg_dezigzag": { + "name": "stbi__jpeg_dezigzag", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbi_uc stbi__jpeg_dezigzag[64+15]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "64+15", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi_uc" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0, 1, 8, 16, 9, 2, 3, 10,\n 17, 24, 32, 25, 18, 11, 4, 5,\n 12, 19, 26, 33, 40, 48, 41, 34,\n 27, 20, 13, 6, 7, 14, 21, 28,\n 35, 42, 49, 56, 57, 50, 43, 36,\n 29, 22, 15, 23, 30, 37, 44, 51,\n 58, 59, 52, 45, 38, 31, 39, 46,\n 53, 60, 61, 54, 47, 55, 62, 63,\n \n 63, 63, 63, 63, 63, 63, 63, 63,\n 63, 63, 63, 63, 63, 63, 63\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 2194, + "column": 1, + "source_line": "static const stbi_uc stbi__jpeg_dezigzag[64+15] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbi__zlength_base": { + "name": "stbi__zlength_base", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int stbi__zlength_base[31]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "31", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 3,4,5,6,7,8,9,10,11,13,\n 15,17,19,23,27,31,35,43,51,59,\n 67,83,99,115,131,163,195,227,258,0,0 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4295, + "column": 1, + "source_line": "static const int stbi__zlength_base[31] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbi__zlength_extra": { + "name": "stbi__zlength_extra", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int stbi__zlength_extra[31]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "31", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4300, + "column": 1, + "source_line": "static const int stbi__zlength_extra[31]=" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbi__zdist_base": { + "name": "stbi__zdist_base", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int stbi__zdist_base[32]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "32", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,\n257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4303, + "column": 1, + "source_line": "static const int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193," + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbi__zdist_extra": { + "name": "stbi__zdist_extra", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int stbi__zdist_extra[32]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "32", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4306, + "column": 1, + "source_line": "static const int stbi__zdist_extra[32] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbi__zdefault_length": { + "name": "stbi__zdefault_length", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBI__ZNSYMS", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi_uc" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,\n 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,\n 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,\n 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,\n 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4452, + "column": 1, + "source_line": "static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbi__zdefault_distance": { + "name": "stbi__zdefault_distance", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbi_uc stbi__zdefault_distance[32]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "32", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi_uc" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4464, + "column": 1, + "source_line": "static const stbi_uc stbi__zdefault_distance[32] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "first_row_filter": { + "name": "first_row_filter", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbi_uc first_row_filter[5]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "5", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi_uc" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBI__F_none,\n STBI__F_sub,\n STBI__F_none,\n STBI__F_avg_first,\n STBI__F_sub \n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4648, + "column": 1, + "source_line": "static stbi_uc first_row_filter[5] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbi__depth_scale_table": { + "name": "stbi__depth_scale_table", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbi_uc stbi__depth_scale_table[9]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "9", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbi_uc" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image.h", + "line": 4670, + "column": 1, + "source_line": "static const stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, "stbi__unpremultiply_on_load_global": { "name": "stbi__unpremultiply_on_load_global", "type": { @@ -55438,19 +56627,6 @@ "unit_kind": "declarator", "unit_name": null }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 870, - "column": 1, - "source_line": "static stbi_io_callbacks stbi__stdio_callbacks =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'STBI_THREAD_LOCAL'; provide preprocessed input to parse it.", @@ -55880,32 +57056,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbi_inline" }, - { - "code": "C_UNSUPPORTED_FIELD_DECLARATION", - "message": "Nested aggregate field definitions are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 1963, - "column": 4, - "source_line": " struct" - }, - "unit_kind": "struct_field", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 2094, - "column": 1, - "source_line": "static const stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbi_inline'; provide preprocessed input to parse it.", @@ -55919,19 +57069,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbi_inline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 2149, - "column": 1, - "source_line": "static const int stbi__jbias[16] = {0,-1,-3,-7,-15,-31,-63,-127,-255,-511,-1023,-2047,-4095,-8191,-16383,-32767};" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbi_inline'; provide preprocessed input to parse it.", @@ -55971,19 +57108,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbi_inline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 2194, - "column": 1, - "source_line": "static const stbi_uc stbi__jpeg_dezigzag[64+15] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbi_inline'; provide preprocessed input to parse it.", @@ -56075,84 +57199,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbi_inline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4295, - "column": 1, - "source_line": "static const int stbi__zlength_base[31] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4300, - "column": 1, - "source_line": "static const int stbi__zlength_extra[31]=" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4303, - "column": 1, - "source_line": "static const int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193," - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4306, - "column": 1, - "source_line": "static const int stbi__zdist_extra[32] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4452, - "column": 1, - "source_line": "static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4464, - "column": 1, - "source_line": "static const stbi_uc stbi__zdefault_distance[32] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'STBIDEF'; provide preprocessed input to parse it.", @@ -56231,32 +57277,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBIDEF" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4648, - "column": 1, - "source_line": "static stbi_uc first_row_filter[5] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image.h", - "line": 4670, - "column": 1, - "source_line": "static const stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'STBIDEF'; provide preprocessed input to parse it.", diff --git a/tests/parser/c/fixtures/stb/stb_image_resize2.json b/tests/parser/c/fixtures/stb/stb_image_resize2.json index 7dbaa2772..361628c59 100644 --- a/tests/parser/c/fixtures/stb/stb_image_resize2.json +++ b/tests/parser/c/fixtures/stb/stb_image_resize2.json @@ -5641,6 +5641,266 @@ "source_text": "", "name": "stbir__info", "members": [ + { + "name": "profile", + "type": { + "model": "CUnion", + "qualifiers": [], + "source_text": "", + "name": null, + "members": [ + { + "name": "named", + "type": { + "model": "CStruct", + "qualifiers": [], + "source_text": "", + "name": null, + "members": [ + { + "name": "total", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 total", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1015, + "column": 14, + "source_line": " struct { stbir_uint64 total, build, alloc, horizontal, vertical, cleanup, pivot; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "build", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 build", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1015, + "column": 14, + "source_line": " struct { stbir_uint64 total, build, alloc, horizontal, vertical, cleanup, pivot; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "alloc", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 alloc", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1015, + "column": 14, + "source_line": " struct { stbir_uint64 total, build, alloc, horizontal, vertical, cleanup, pivot; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "horizontal", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 horizontal", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1015, + "column": 14, + "source_line": " struct { stbir_uint64 total, build, alloc, horizontal, vertical, cleanup, pivot; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "vertical", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 vertical", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1015, + "column": 14, + "source_line": " struct { stbir_uint64 total, build, alloc, horizontal, vertical, cleanup, pivot; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "cleanup", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 cleanup", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1015, + "column": 14, + "source_line": " struct { stbir_uint64 total, build, alloc, horizontal, vertical, cleanup, pivot; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "pivot", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 pivot", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1015, + "column": 14, + "source_line": " struct { stbir_uint64 total, build, alloc, horizontal, vertical, cleanup, pivot; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], + "anonymous_id": "struct@stb/stb_image_resize2.h:1015:5", + "is_incomplete": false, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1015, + "column": 5, + "source_line": " struct { stbir_uint64 total, build, alloc, horizontal, vertical, cleanup, pivot; } named;" + } + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1015, + "column": 5, + "source_line": " struct { stbir_uint64 total, build, alloc, horizontal, vertical, cleanup, pivot; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "array", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbir_uint64 array[7]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "7", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + } + ] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1016, + "column": 5, + "source_line": " stbir_uint64 array[7];" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], + "anonymous_id": "union@stb/stb_image_resize2.h:1013:3", + "is_incomplete": false, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1013, + "column": 3, + "source_line": " union" + } + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1013, + "column": 3, + "source_line": " union" + }, + "callback_policy": null, + "declaration_locations": [] + }, { "name": "current_zone_excluded_ptr", "type": { @@ -6318,6 +6578,289 @@ "source_text": "", "name": null, "members": [ + { + "name": "profile", + "type": { + "model": "CUnion", + "qualifiers": [], + "source_text": "", + "name": null, + "members": [ + { + "name": "named", + "type": { + "model": "CStruct", + "qualifiers": [], + "source_text": "", + "name": null, + "members": [ + { + "name": "total", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 total", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 979, + "column": 14, + "source_line": " struct { stbir_uint64 total, looping, vertical, horizontal, decode, encode, alpha, unalpha; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "looping", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 looping", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 979, + "column": 14, + "source_line": " struct { stbir_uint64 total, looping, vertical, horizontal, decode, encode, alpha, unalpha; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "vertical", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 vertical", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 979, + "column": 14, + "source_line": " struct { stbir_uint64 total, looping, vertical, horizontal, decode, encode, alpha, unalpha; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "horizontal", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 horizontal", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 979, + "column": 14, + "source_line": " struct { stbir_uint64 total, looping, vertical, horizontal, decode, encode, alpha, unalpha; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "decode", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 decode", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 979, + "column": 14, + "source_line": " struct { stbir_uint64 total, looping, vertical, horizontal, decode, encode, alpha, unalpha; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "encode", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 encode", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 979, + "column": 14, + "source_line": " struct { stbir_uint64 total, looping, vertical, horizontal, decode, encode, alpha, unalpha; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "alpha", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 alpha", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 979, + "column": 14, + "source_line": " struct { stbir_uint64 total, looping, vertical, horizontal, decode, encode, alpha, unalpha; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "unalpha", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64 unalpha", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 979, + "column": 14, + "source_line": " struct { stbir_uint64 total, looping, vertical, horizontal, decode, encode, alpha, unalpha; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], + "anonymous_id": "struct@stb/stb_image_resize2.h:979:5", + "is_incomplete": false, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 979, + "column": 5, + "source_line": " struct { stbir_uint64 total, looping, vertical, horizontal, decode, encode, alpha, unalpha; } named;" + } + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 979, + "column": 5, + "source_line": " struct { stbir_uint64 total, looping, vertical, horizontal, decode, encode, alpha, unalpha; } named;" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "array", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbir_uint64 array[8]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbir_uint64", + "name": "stbir_uint64", + "type": null, + "source_location": null, + "declaration_locations": [] + } + ] + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 980, + "column": 5, + "source_line": " stbir_uint64 array[8];" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], + "anonymous_id": "union@stb/stb_image_resize2.h:977:3", + "is_incomplete": false, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 977, + "column": 3, + "source_line": " union" + } + }, + "storage": [], + "initializer": null, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 977, + "column": 3, + "source_line": " union" + }, + "callback_policy": null, + "declaration_locations": [] + }, { "name": "current_zone_excluded_ptr", "type": { @@ -13045,149 +13588,956 @@ "reference": "STBIR__V_FIRST_INFO" } ], - "variables": [], - "macros": [ + "variables": [ { - "name": "STBIR_INCLUDE_STB_IMAGE_RESIZE2_H", - "value": null, - "function_like": false, - "directive": "define", + "name": "stbir__type_size", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbir__type_size[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1,1,1,2,4,2 \n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 389, + "line": 904, "column": 1, - "source_line": "#define STBIR_INCLUDE_STB_IMAGE_RESIZE2_H" - } + "source_line": "static unsigned char stbir__type_size[] = {" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBIRDEF", - "value": "static", - "function_like": false, - "directive": "define", + "name": "stbir__srgb_uchar_to_linear_float", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float stbir__srgb_uchar_to_linear_float[256]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "256", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0.000000f, 0.000304f, 0.000607f, 0.000911f, 0.001214f, 0.001518f, 0.001821f, 0.002125f, 0.002428f, 0.002732f, 0.003035f,\n 0.003347f, 0.003677f, 0.004025f, 0.004391f, 0.004777f, 0.005182f, 0.005605f, 0.006049f, 0.006512f, 0.006995f, 0.007499f,\n 0.008023f, 0.008568f, 0.009134f, 0.009721f, 0.010330f, 0.010960f, 0.011612f, 0.012286f, 0.012983f, 0.013702f, 0.014444f,\n 0.015209f, 0.015996f, 0.016807f, 0.017642f, 0.018500f, 0.019382f, 0.020289f, 0.021219f, 0.022174f, 0.023153f, 0.024158f,\n 0.025187f, 0.026241f, 0.027321f, 0.028426f, 0.029557f, 0.030713f, 0.031896f, 0.033105f, 0.034340f, 0.035601f, 0.036889f,\n 0.038204f, 0.039546f, 0.040915f, 0.042311f, 0.043735f, 0.045186f, 0.046665f, 0.048172f, 0.049707f, 0.051269f, 0.052861f,\n 0.054480f, 0.056128f, 0.057805f, 0.059511f, 0.061246f, 0.063010f, 0.064803f, 0.066626f, 0.068478f, 0.070360f, 0.072272f,\n 0.074214f, 0.076185f, 0.078187f, 0.080220f, 0.082283f, 0.084376f, 0.086500f, 0.088656f, 0.090842f, 0.093059f, 0.095307f,\n 0.097587f, 0.099899f, 0.102242f, 0.104616f, 0.107023f, 0.109462f, 0.111932f, 0.114435f, 0.116971f, 0.119538f, 0.122139f,\n 0.124772f, 0.127438f, 0.130136f, 0.132868f, 0.135633f, 0.138432f, 0.141263f, 0.144128f, 0.147027f, 0.149960f, 0.152926f,\n 0.155926f, 0.158961f, 0.162029f, 0.165132f, 0.168269f, 0.171441f, 0.174647f, 0.177888f, 0.181164f, 0.184475f, 0.187821f,\n 0.191202f, 0.194618f, 0.198069f, 0.201556f, 0.205079f, 0.208637f, 0.212231f, 0.215861f, 0.219526f, 0.223228f, 0.226966f,\n 0.230740f, 0.234551f, 0.238398f, 0.242281f, 0.246201f, 0.250158f, 0.254152f, 0.258183f, 0.262251f, 0.266356f, 0.270498f,\n 0.274677f, 0.278894f, 0.283149f, 0.287441f, 0.291771f, 0.296138f, 0.300544f, 0.304987f, 0.309469f, 0.313989f, 0.318547f,\n 0.323143f, 0.327778f, 0.332452f, 0.337164f, 0.341914f, 0.346704f, 0.351533f, 0.356400f, 0.361307f, 0.366253f, 0.371238f,\n 0.376262f, 0.381326f, 0.386430f, 0.391573f, 0.396755f, 0.401978f, 0.407240f, 0.412543f, 0.417885f, 0.423268f, 0.428691f,\n 0.434154f, 0.439657f, 0.445201f, 0.450786f, 0.456411f, 0.462077f, 0.467784f, 0.473532f, 0.479320f, 0.485150f, 0.491021f,\n 0.496933f, 0.502887f, 0.508881f, 0.514918f, 0.520996f, 0.527115f, 0.533276f, 0.539480f, 0.545725f, 0.552011f, 0.558340f,\n 0.564712f, 0.571125f, 0.577581f, 0.584078f, 0.590619f, 0.597202f, 0.603827f, 0.610496f, 0.617207f, 0.623960f, 0.630757f,\n 0.637597f, 0.644480f, 0.651406f, 0.658375f, 0.665387f, 0.672443f, 0.679543f, 0.686685f, 0.693872f, 0.701102f, 0.708376f,\n 0.715694f, 0.723055f, 0.730461f, 0.737911f, 0.745404f, 0.752942f, 0.760525f, 0.768151f, 0.775822f, 0.783538f, 0.791298f,\n 0.799103f, 0.806952f, 0.814847f, 0.822786f, 0.830770f, 0.838799f, 0.846873f, 0.854993f, 0.863157f, 0.871367f, 0.879622f,\n 0.887923f, 0.896269f, 0.904661f, 0.913099f, 0.921582f, 0.930111f, 0.938686f, 0.947307f, 0.955974f, 0.964686f, 0.973445f,\n 0.982251f, 0.991102f, 1.0f\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 407, + "line": 1087, "column": 1, - "source_line": "#define STBIRDEF static" - } + "source_line": "static float stbir__srgb_uchar_to_linear_float[256] = {" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBIRDEF", - "value": "extern \"C\"", - "function_like": false, - "directive": "define", + "name": "fp32_to_srgb8_tab4", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbir_uint32 fp32_to_srgb8_tab4[104]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "104", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbir_uint32" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0x0073000d, 0x007a000d, 0x0080000d, 0x0087000d, 0x008d000d, 0x0094000d, 0x009a000d, 0x00a1000d,\n 0x00a7001a, 0x00b4001a, 0x00c1001a, 0x00ce001a, 0x00da001a, 0x00e7001a, 0x00f4001a, 0x0101001a,\n 0x010e0033, 0x01280033, 0x01410033, 0x015b0033, 0x01750033, 0x018f0033, 0x01a80033, 0x01c20033,\n 0x01dc0067, 0x020f0067, 0x02430067, 0x02760067, 0x02aa0067, 0x02dd0067, 0x03110067, 0x03440067,\n 0x037800ce, 0x03df00ce, 0x044600ce, 0x04ad00ce, 0x051400ce, 0x057b00c5, 0x05dd00bc, 0x063b00b5,\n 0x06970158, 0x07420142, 0x07e30130, 0x087b0120, 0x090b0112, 0x09940106, 0x0a1700fc, 0x0a9500f2,\n 0x0b0f01cb, 0x0bf401ae, 0x0ccb0195, 0x0d950180, 0x0e56016e, 0x0f0d015e, 0x0fbc0150, 0x10630143,\n 0x11070264, 0x1238023e, 0x1357021d, 0x14660201, 0x156601e9, 0x165a01d3, 0x174401c0, 0x182401af,\n 0x18fe0331, 0x1a9602fe, 0x1c1502d2, 0x1d7e02ad, 0x1ed4028d, 0x201a0270, 0x21520256, 0x227d0240,\n 0x239f0443, 0x25c003fe, 0x27bf03c4, 0x29a10392, 0x2b6a0367, 0x2d1d0341, 0x2ebe031f, 0x304d0300,\n 0x31d105b0, 0x34a80555, 0x37520507, 0x39d504c5, 0x3c37048b, 0x3e7c0458, 0x40a8042a, 0x42bd0401,\n 0x44c20798, 0x488e071e, 0x4c1c06b6, 0x4f76065d, 0x52a50610, 0x55ac05cc, 0x5892058f, 0x5b590559,\n 0x5e0c0a23, 0x631c0980, 0x67db08f6, 0x6c55087f, 0x70940818, 0x74a007bd, 0x787d076c, 0x7c330723,\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 410, + "line": 1122, "column": 1, - "source_line": "#define STBIRDEF extern \"C\"" - } + "source_line": "static const stbir_uint32 fp32_to_srgb8_tab4[104] = {" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBIRDEF", - "value": "extern", - "function_like": false, - "directive": "define", + "name": "stbir_00001111", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "static __m256i stbir_00001111", + "name": "__m256i", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ STBIR__CONST_4d_32i( 0, 0, 0, 0 ), STBIR__CONST_4d_32i( 1, 1, 1, 1 ) }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 412, - "column": 1, - "source_line": "#define STBIRDEF extern" - } + "line": 1625, + "column": 5, + "source_line": " static __m256i stbir_00001111 = { STBIR__CONST_4d_32i( 0, 0, 0, 0 ), STBIR__CONST_4d_32i( 1, 1, 1, 1 ) };" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBIR_ASSERT", - "value": "assert(x)", - "function_like": true, - "directive": "define", + "name": "stbir_22223333", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "static __m256i stbir_22223333", + "name": "__m256i", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ STBIR__CONST_4d_32i( 2, 2, 2, 2 ), STBIR__CONST_4d_32i( 3, 3, 3, 3 ) }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 787, - "column": 1, - "source_line": "#define STBIR_ASSERT(x) assert(x)" - } + "line": 1628, + "column": 5, + "source_line": " static __m256i stbir_22223333 = { STBIR__CONST_4d_32i( 2, 2, 2, 2 ), STBIR__CONST_4d_32i( 3, 3, 3, 3 ) };" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBIR_MALLOC", - "value": "((void)(user_data), malloc(size))", - "function_like": true, - "directive": "define", + "name": "stbir_00112233", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "static __m256i stbir_00112233", + "name": "__m256i", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ STBIR__CONST_4d_32i( 0, 0, 1, 1 ), STBIR__CONST_4d_32i( 2, 2, 3, 3 ) }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 792, - "column": 1, - "source_line": "#define STBIR_MALLOC(size,user_data) ((void)(user_data), malloc(size))" - } + "line": 1635, + "column": 5, + "source_line": " static __m256i stbir_00112233 = { STBIR__CONST_4d_32i( 0, 0, 1, 1 ), STBIR__CONST_4d_32i( 2, 2, 3, 3 ) };" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBIR_FREE", - "value": "((void)(user_data), free(ptr))", - "function_like": true, - "directive": "define", + "name": "stbir_load6", + "type": { + "model": "CTypedef", + "qualifiers": [], + "source_text": "static __m256i stbir_load6", + "name": "__m256i", + "type": null, + "source_location": null, + "declaration_locations": [] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ STBIR__CONST_4_32i( 0x80000000 ), STBIR__CONST_4d_32i( 0x80000000, 0x80000000, 0, 0 ) }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 793, - "column": 1, - "source_line": "#define STBIR_FREE(ptr,user_data) ((void)(user_data), free(ptr))" - } + "line": 1639, + "column": 5, + "source_line": " static __m256i stbir_load6 = { STBIR__CONST_4_32i( 0x80000000 ), STBIR__CONST_4d_32i( 0x80000000, 0x80000000, 0, 0 ) };" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "stbir__inline", - "value": "__forceinline", - "function_like": false, - "directive": "define", + "name": "STBIR_mask", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int STBIR_mask[9]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "9", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,0,0,-1,-1,-1,0,0,0 }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 799, + "line": 2564, "column": 1, - "source_line": "#define stbir__inline __forceinline" - } + "source_line": "static const int STBIR_mask[9] = { 0,0,0,-1,-1,-1,0,0,0 };" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "stbir__inline", - "value": "__inline__", - "function_like": false, - "directive": "define", + "name": "stbir__edge_wrap_slow", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir__edge_wrap_func * stbir__edge_wrap_slow[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbir__edge_wrap_func" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbir__edge_clamp_full, \n stbir__edge_reflect_full, \n stbir__edge_wrap_full, \n stbir__edge_zero_full, \n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 803, + "line": 3102, "column": 1, - "source_line": "#define stbir__inline __inline__" - } + "source_line": "static stbir__edge_wrap_func * stbir__edge_wrap_slow[] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBIR__SEPARATE_ALLOCATIONS", - "value": null, - "function_like": false, - "directive": "define", + "name": "stbir__vertical_gathers", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers[ 8 ]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "STBIR_VERTICAL_GATHERFUNC" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbir__vertical_gather_with_1_coeffs,stbir__vertical_gather_with_2_coeffs,stbir__vertical_gather_with_3_coeffs,stbir__vertical_gather_with_4_coeffs,stbir__vertical_gather_with_5_coeffs,stbir__vertical_gather_with_6_coeffs,stbir__vertical_gather_with_7_coeffs,stbir__vertical_gather_with_8_coeffs\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 809, - "column": 7, - "source_line": " #define STBIR__SEPARATE_ALLOCATIONS" - } + "line": 6161, + "column": 1, + "source_line": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers[ 8 ] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBIR__SEPARATE_ALLOCATIONS", - "value": null, - "function_like": false, - "directive": "define", + "name": "stbir__vertical_gathers_continues", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers_continues[ 8 ]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "STBIR_VERTICAL_GATHERFUNC" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbir__vertical_gather_with_1_coeffs_cont,stbir__vertical_gather_with_2_coeffs_cont,stbir__vertical_gather_with_3_coeffs_cont,stbir__vertical_gather_with_4_coeffs_cont,stbir__vertical_gather_with_5_coeffs_cont,stbir__vertical_gather_with_6_coeffs_cont,stbir__vertical_gather_with_7_coeffs_cont,stbir__vertical_gather_with_8_coeffs_cont\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 819, - "column": 5, - "source_line": " #define STBIR__SEPARATE_ALLOCATIONS" - } + "line": 6166, + "column": 1, + "source_line": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers_continues[ 8 ] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBIR__UNUSED", - "value": "(void)(v)", - "function_like": true, - "directive": "define", - "source_location": { - "filename": "stb/stb_image_resize2.h", - "line": 838, - "column": 1, + "name": "stbir__vertical_scatter_sets", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_sets[ 8 ]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "STBIR_VERTICAL_SCATTERFUNC" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbir__vertical_scatter_with_1_coeffs,stbir__vertical_scatter_with_2_coeffs,stbir__vertical_scatter_with_3_coeffs,stbir__vertical_scatter_with_4_coeffs,stbir__vertical_scatter_with_5_coeffs,stbir__vertical_scatter_with_6_coeffs,stbir__vertical_scatter_with_7_coeffs,stbir__vertical_scatter_with_8_coeffs\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6173, + "column": 1, + "source_line": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_sets[ 8 ] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbir__vertical_scatter_blends", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_blends[ 8 ]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "STBIR_VERTICAL_SCATTERFUNC" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbir__vertical_scatter_with_1_coeffs_cont,stbir__vertical_scatter_with_2_coeffs_cont,stbir__vertical_scatter_with_3_coeffs_cont,stbir__vertical_scatter_with_4_coeffs_cont,stbir__vertical_scatter_with_5_coeffs_cont,stbir__vertical_scatter_with_6_coeffs_cont,stbir__vertical_scatter_with_7_coeffs_cont,stbir__vertical_scatter_with_8_coeffs_cont\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6178, + "column": 1, + "source_line": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_blends[ 8 ] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbir__builtin_kernels", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir__kernel_callback * stbir__builtin_kernels[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbir__kernel_callback" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0, stbir__filter_trapezoid, stbir__filter_triangle, stbir__filter_cubic, stbir__filter_catmullrom, stbir__filter_mitchell, stbir__filter_point }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6570, + "column": 1, + "source_line": "static stbir__kernel_callback * stbir__builtin_kernels[] = { 0, stbir__filter_trapezoid, stbir__filter_triangle, stbir__filter_cubic, stbir__filter_catmullrom, stbir__filter_mitchell, stbir__filter_point };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbir__builtin_supports", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir__support_callback * stbir__builtin_supports[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbir__support_callback" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0, stbir__support_trapezoid, stbir__support_one, stbir__support_two, stbir__support_two, stbir__support_two, stbir__support_zeropoint5 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6571, + "column": 1, + "source_line": "static stbir__support_callback * stbir__builtin_supports[] = { 0, stbir__support_trapezoid, stbir__support_one, stbir__support_two, stbir__support_two, stbir__support_two, stbir__support_zeropoint5 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbir__horizontal_gather_n_coeffs_funcs", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_n_coeffs_funcs[8]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbir__horizontal_gather_channels_func" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0, stbir__horizontal_gather_1_channels_with_n_coeffs_funcs, stbir__horizontal_gather_2_channels_with_n_coeffs_funcs, stbir__horizontal_gather_3_channels_with_n_coeffs_funcs, stbir__horizontal_gather_4_channels_with_n_coeffs_funcs, 0,0, stbir__horizontal_gather_7_channels_with_n_coeffs_funcs\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6883, + "column": 1, + "source_line": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_n_coeffs_funcs[8] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbir__horizontal_gather_channels_funcs", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_channels_funcs[8]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbir__horizontal_gather_channels_func" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0, stbir__horizontal_gather_1_channels_funcs, stbir__horizontal_gather_2_channels_funcs, stbir__horizontal_gather_3_channels_funcs, stbir__horizontal_gather_4_channels_funcs, 0,0, stbir__horizontal_gather_7_channels_funcs\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6888, + "column": 1, + "source_line": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_channels_funcs[8] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbir__compute_weights", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float stbir__compute_weights[5][STBIR_RESIZE_CLASSIFICATIONS][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "5", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBIR_RESIZE_CLASSIFICATIONS", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n {\n { 1.00000f, 1.00000f, 0.31250f, 1.00000f },\n { 0.56250f, 0.59375f, 0.00000f, 0.96875f },\n { 1.00000f, 0.06250f, 0.00000f, 1.00000f },\n { 0.00000f, 0.09375f, 1.00000f, 1.00000f },\n { 1.00000f, 1.00000f, 0.31250f, 1.00000f },\n { 0.03125f, 0.12500f, 1.00000f, 1.00000f },\n { 1.00000f, 1.00000f, 0.06250f, 1.00000f },\n { 0.00000f, 1.00000f, 0.00000f, 0.03125f },\n }, {\n { 0.00000f, 0.84375f, 0.00000f, 0.03125f },\n { 0.09375f, 0.93750f, 0.00000f, 0.78125f },\n { 0.87500f, 0.21875f, 0.00000f, 0.96875f },\n { 0.09375f, 0.09375f, 1.00000f, 1.00000f },\n { 0.00000f, 0.84375f, 0.00000f, 0.03125f },\n { 0.03125f, 0.12500f, 1.00000f, 1.00000f },\n { 1.00000f, 1.00000f, 0.06250f, 1.00000f },\n { 0.00000f, 1.00000f, 0.00000f, 0.53125f },\n }, {\n { 0.00000f, 0.53125f, 0.00000f, 0.03125f },\n { 0.06250f, 0.96875f, 0.00000f, 0.53125f },\n { 0.87500f, 0.18750f, 0.00000f, 0.93750f },\n { 0.00000f, 0.09375f, 1.00000f, 1.00000f },\n { 0.00000f, 0.53125f, 0.00000f, 0.03125f },\n { 0.03125f, 0.12500f, 1.00000f, 1.00000f },\n { 1.00000f, 1.00000f, 0.06250f, 1.00000f },\n { 0.00000f, 1.00000f, 0.00000f, 0.56250f },\n }, {\n { 0.00000f, 0.50000f, 0.00000f, 0.71875f },\n { 0.06250f, 0.84375f, 0.00000f, 0.87500f },\n { 1.00000f, 0.50000f, 0.50000f, 0.96875f },\n { 1.00000f, 0.09375f, 0.31250f, 0.50000f },\n { 0.00000f, 0.50000f, 0.00000f, 0.71875f },\n { 1.00000f, 0.03125f, 0.03125f, 0.53125f },\n { 1.00000f, 1.00000f, 0.06250f, 1.00000f },\n { 0.00000f, 1.00000f, 0.03125f, 0.18750f },\n }, {\n { 0.00000f, 0.59375f, 0.00000f, 0.96875f },\n { 0.06250f, 0.81250f, 0.06250f, 0.59375f },\n { 0.75000f, 0.43750f, 0.12500f, 0.96875f },\n { 0.87500f, 0.06250f, 0.18750f, 0.43750f },\n { 0.00000f, 0.59375f, 0.00000f, 0.96875f },\n { 0.15625f, 0.12500f, 1.00000f, 1.00000f },\n { 1.00000f, 1.00000f, 0.06250f, 1.00000f },\n { 0.00000f, 1.00000f, 0.03125f, 0.34375f },\n }\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6896, + "column": 1, + "source_line": "static float stbir__compute_weights[5][STBIR_RESIZE_CLASSIFICATIONS][4]= // 5 = 0=1chan, 1=2chan, 2=3chan, 3=4chan, 4=7chan" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "STBIR__V_FIRST_INFO_BUFFER", + "type": { + "reference": "STBIR__V_FIRST_INFO" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{0}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6957, + "column": 1, + "source_line": "static STBIR__V_FIRST_INFO STBIR__V_FIRST_INFO_BUFFER = {0};" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbir__pixel_channels", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbir__pixel_channels[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1,2,3,3,4, \n 4,4,4,4,2,2, \n 4,4,4,4,2,2, \n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 7034, + "column": 1, + "source_line": "static unsigned char stbir__pixel_channels[] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbir__pixel_layout_convert_public_to_internal", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir_internal_pixel_layout stbir__pixel_layout_convert_public_to_internal[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbir_internal_pixel_layout" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBIRI_BGR, STBIRI_1CHANNEL, STBIRI_2CHANNEL, STBIRI_RGB, STBIRI_RGBA,\n STBIRI_4CHANNEL, STBIRI_BGRA, STBIRI_ARGB, STBIRI_ABGR, STBIRI_RA, STBIRI_AR,\n STBIRI_RGBA_PM, STBIRI_BGRA_PM, STBIRI_ARGB_PM, STBIRI_ABGR_PM, STBIRI_RA_PM, STBIRI_AR_PM,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 7042, + "column": 1, + "source_line": "static stbir_internal_pixel_layout stbir__pixel_layout_convert_public_to_internal[] = {" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], + "macros": [ + { + "name": "STBIR_INCLUDE_STB_IMAGE_RESIZE2_H", + "value": null, + "function_like": false, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 389, + "column": 1, + "source_line": "#define STBIR_INCLUDE_STB_IMAGE_RESIZE2_H" + } + }, + { + "name": "STBIRDEF", + "value": "static", + "function_like": false, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 407, + "column": 1, + "source_line": "#define STBIRDEF static" + } + }, + { + "name": "STBIRDEF", + "value": "extern \"C\"", + "function_like": false, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 410, + "column": 1, + "source_line": "#define STBIRDEF extern \"C\"" + } + }, + { + "name": "STBIRDEF", + "value": "extern", + "function_like": false, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 412, + "column": 1, + "source_line": "#define STBIRDEF extern" + } + }, + { + "name": "STBIR_ASSERT", + "value": "assert(x)", + "function_like": true, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 787, + "column": 1, + "source_line": "#define STBIR_ASSERT(x) assert(x)" + } + }, + { + "name": "STBIR_MALLOC", + "value": "((void)(user_data), malloc(size))", + "function_like": true, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 792, + "column": 1, + "source_line": "#define STBIR_MALLOC(size,user_data) ((void)(user_data), malloc(size))" + } + }, + { + "name": "STBIR_FREE", + "value": "((void)(user_data), free(ptr))", + "function_like": true, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 793, + "column": 1, + "source_line": "#define STBIR_FREE(ptr,user_data) ((void)(user_data), free(ptr))" + } + }, + { + "name": "stbir__inline", + "value": "__forceinline", + "function_like": false, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 799, + "column": 1, + "source_line": "#define stbir__inline __forceinline" + } + }, + { + "name": "stbir__inline", + "value": "__inline__", + "function_like": false, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 803, + "column": 1, + "source_line": "#define stbir__inline __inline__" + } + }, + { + "name": "STBIR__SEPARATE_ALLOCATIONS", + "value": null, + "function_like": false, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 809, + "column": 7, + "source_line": " #define STBIR__SEPARATE_ALLOCATIONS" + } + }, + { + "name": "STBIR__SEPARATE_ALLOCATIONS", + "value": null, + "function_like": false, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 819, + "column": 5, + "source_line": " #define STBIR__SEPARATE_ALLOCATIONS" + } + }, + { + "name": "STBIR__UNUSED", + "value": "(void)(v)", + "function_like": true, + "directive": "define", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 838, + "column": 1, "source_line": "#define STBIR__UNUSED(v) (void)(v)" } }, @@ -30907,7 +32257,7 @@ "column": 3, "source_line": " static const stbir__simdf STBIR_zeroones = { 0.0f,1.0f,0.0f,1.0f };" }, - "source_text": "static const stbir__simdf STBIR_zeroones =" + "source_text": "static const stbir__simdf STBIR_zeroones = { 0.0f,1.0f,0.0f,1.0f }" }, { "name": "stbir__simdf", @@ -30918,7 +32268,7 @@ "column": 3, "source_line": " static const stbir__simdf STBIR_onezeros = { 1.0f,0.0f,1.0f,0.0f };" }, - "source_text": "static const stbir__simdf STBIR_onezeros =" + "source_text": "static const stbir__simdf STBIR_onezeros = { 1.0f,0.0f,1.0f,0.0f }" }, { "name": "STBIR__SIMDI_CONST", @@ -31039,7 +32389,7 @@ "column": 3, "source_line": " static const stbir__simdf8 STBIR_max_uint16_as_float_inverted8 = { stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted };" }, - "source_text": "static const stbir__simdf8 STBIR_max_uint16_as_float_inverted8 =" + "source_text": "static const stbir__simdf8 STBIR_max_uint16_as_float_inverted8 = { stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted,stbir__max_uint16_as_float_inverted }" }, { "name": "stbir__simdf8", @@ -31050,7 +32400,7 @@ "column": 3, "source_line": " static const stbir__simdf8 STBIR_max_uint8_as_float_inverted8 = { stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted };" }, - "source_text": "static const stbir__simdf8 STBIR_max_uint8_as_float_inverted8 =" + "source_text": "static const stbir__simdf8 STBIR_max_uint8_as_float_inverted8 = { stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted,stbir__max_uint8_as_float_inverted }" }, { "name": "stbir__simdf8", @@ -31061,7 +32411,7 @@ "column": 3, "source_line": " static const stbir__simdf8 STBIR_ones8 = { 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 };" }, - "source_text": "static const stbir__simdf8 STBIR_ones8 =" + "source_text": "static const stbir__simdf8 STBIR_ones8 = { 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0 }" }, { "name": "stbir__simdf8", @@ -31072,7 +32422,7 @@ "column": 3, "source_line": " static const stbir__simdf8 STBIR_simd_point58 = { 0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5 };" }, - "source_text": "static const stbir__simdf8 STBIR_simd_point58 =" + "source_text": "static const stbir__simdf8 STBIR_simd_point58 = { 0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5 }" }, { "name": "stbir__simdf8", @@ -31083,7 +32433,7 @@ "column": 3, "source_line": " static const stbir__simdf8 STBIR_max_uint8_as_float8 = { stbir__max_uint8_as_float,stbir__max_uint8_as_float,stbir__max_uint8_as_float,stbir__max_uint8_as_float, stbir__max_uint8_as_float,stbir__max_uint8_as_float,stbir__max_uint8_as_float,stbir__max_uint8_as_float };" }, - "source_text": "static const stbir__simdf8 STBIR_max_uint8_as_float8 =" + "source_text": "static const stbir__simdf8 STBIR_max_uint8_as_float8 = { stbir__max_uint8_as_float,stbir__max_uint8_as_float,stbir__max_uint8_as_float,stbir__max_uint8_as_float, stbir__max_uint8_as_float,stbir__max_uint8_as_float,stbir__max_uint8_as_float,stbir__max_uint8_as_float }" }, { "name": "stbir__simdf8", @@ -31094,7 +32444,7 @@ "column": 3, "source_line": " static const stbir__simdf8 STBIR_max_uint16_as_float8 = { stbir__max_uint16_as_float,stbir__max_uint16_as_float,stbir__max_uint16_as_float,stbir__max_uint16_as_float, stbir__max_uint16_as_float,stbir__max_uint16_as_float,stbir__max_uint16_as_float,stbir__max_uint16_as_float };" }, - "source_text": "static const stbir__simdf8 STBIR_max_uint16_as_float8 =" + "source_text": "static const stbir__simdf8 STBIR_max_uint16_as_float8 = { stbir__max_uint16_as_float,stbir__max_uint16_as_float,stbir__max_uint16_as_float,stbir__max_uint16_as_float, stbir__max_uint16_as_float,stbir__max_uint16_as_float,stbir__max_uint16_as_float,stbir__max_uint16_as_float }" }, { "name": "stbir__inline", @@ -32128,7 +33478,7 @@ "column": 1, "source_line": "static stbir__horizontal_gather_channels_func * STBIR_chans(stbir__horizontal_gather_,_channels_with_n_coeffs_funcs)[4]=" }, - "source_text": "static stbir__horizontal_gather_channels_func * STBIR_chans(stbir__horizontal_gather_,_channels_with_n_coeffs_funcs)[4]=" + "source_text": "static stbir__horizontal_gather_channels_func * STBIR_chans(stbir__horizontal_gather_,_channels_with_n_coeffs_funcs)[4]=\n{\n STBIR_chans(stbir__horizontal_gather_,_channels_with_n_coeffs_mod0),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_n_coeffs_mod1),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_n_coeffs_mod2),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_n_coeffs_mod3),\n}" }, { "name": "STBIR_chans", @@ -32139,7 +33489,7 @@ "column": 1, "source_line": "static stbir__horizontal_gather_channels_func * STBIR_chans(stbir__horizontal_gather_,_channels_funcs)[12]=" }, - "source_text": "static stbir__horizontal_gather_channels_func * STBIR_chans(stbir__horizontal_gather_,_channels_funcs)[12]=" + "source_text": "static stbir__horizontal_gather_channels_func * STBIR_chans(stbir__horizontal_gather_,_channels_funcs)[12]=\n{\n STBIR_chans(stbir__horizontal_gather_,_channels_with_1_coeff),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_2_coeffs),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_3_coeffs),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_4_coeffs),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_5_coeffs),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_6_coeffs),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_7_coeffs),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_8_coeffs),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_9_coeffs),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_10_coeffs),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_11_coeffs),\n STBIR_chans(stbir__horizontal_gather_,_channels_with_12_coeffs),\n}" } ], "diagnostics": [ @@ -39501,45 +40851,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBIRDEF" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 904, - "column": 1, - "source_line": "static unsigned char stbir__type_size[] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_FIELD_DECLARATION", - "message": "Nested aggregate field definitions are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 977, - "column": 3, - "source_line": " union" - }, - "unit_kind": "struct_field", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_FIELD_DECLARATION", - "message": "Nested aggregate field definitions are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1013, - "column": 3, - "source_line": " union" - }, - "unit_kind": "struct_field", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbir__inline'; provide preprocessed input to parse it.", @@ -39566,32 +40877,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbir__inline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1087, - "column": 1, - "source_line": "static float stbir__srgb_uchar_to_linear_float[256] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1122, - "column": 1, - "source_line": "static const stbir_uint32 fp32_to_srgb8_tab4[104] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbir__inline'; provide preprocessed input to parse it.", @@ -39657,58 +40942,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBIR__SIMDI_CONST" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1625, - "column": 5, - "source_line": " static __m256i stbir_00001111 = { STBIR__CONST_4d_32i( 0, 0, 0, 0 ), STBIR__CONST_4d_32i( 1, 1, 1, 1 ) };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1628, - "column": 5, - "source_line": " static __m256i stbir_22223333 = { STBIR__CONST_4d_32i( 2, 2, 2, 2 ), STBIR__CONST_4d_32i( 3, 3, 3, 3 ) };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1635, - "column": 5, - "source_line": " static __m256i stbir_00112233 = { STBIR__CONST_4d_32i( 0, 0, 1, 1 ), STBIR__CONST_4d_32i( 2, 2, 3, 3 ) };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1639, - "column": 5, - "source_line": " static __m256i stbir_load6 = { STBIR__CONST_4_32i( 0x80000000 ), STBIR__CONST_4d_32i( 0x80000000, 0x80000000, 0, 0 ) };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbir__inline'; provide preprocessed input to parse it.", @@ -40138,19 +41371,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbir__inline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 2564, - "column": 1, - "source_line": "static const int STBIR_mask[9] = { 0,0,0,-1,-1,-1,0,0,0 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on function-like macro 'STBIR__SIMDF_CONST'; provide preprocessed input to parse it.", @@ -40320,19 +41540,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBIR_PROFILE_FUNC" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 3102, - "column": 1, - "source_line": "static stbir__edge_wrap_func * stbir__edge_wrap_slow[] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbir__inline'; provide preprocessed input to parse it.", @@ -40372,58 +41579,6 @@ "unit_kind": "declarator", "unit_name": null }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6161, - "column": 1, - "source_line": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers[ 8 ] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6166, - "column": 1, - "source_line": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers_continues[ 8 ] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6173, - "column": 1, - "source_line": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_sets[ 8 ] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6178, - "column": 1, - "source_line": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_blends[ 8 ] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_UNSUPPORTED_DECLARATOR", "message": "Unsupported declarator syntax after parsed type layers: 'STBIR_ONLY_PROFILE_GET_SPLIT_INFO'.", @@ -40450,110 +41605,6 @@ "unit_kind": "declarator", "unit_name": null }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6570, - "column": 1, - "source_line": "static stbir__kernel_callback * stbir__builtin_kernels[] = { 0, stbir__filter_trapezoid, stbir__filter_triangle, stbir__filter_cubic, stbir__filter_catmullrom, stbir__filter_mitchell, stbir__filter_point };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6571, - "column": 1, - "source_line": "static stbir__support_callback * stbir__builtin_supports[] = { 0, stbir__support_trapezoid, stbir__support_one, stbir__support_two, stbir__support_two, stbir__support_two, stbir__support_zeropoint5 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6883, - "column": 1, - "source_line": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_n_coeffs_funcs[8] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6888, - "column": 1, - "source_line": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_channels_funcs[8] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6896, - "column": 1, - "source_line": "static float stbir__compute_weights[5][STBIR_RESIZE_CLASSIFICATIONS][4]= // 5 = 0=1chan, 1=2chan, 2=3chan, 3=4chan, 4=7chan" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6957, - "column": 1, - "source_line": "static STBIR__V_FIRST_INFO STBIR__V_FIRST_INFO_BUFFER = {0};" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 7034, - "column": 1, - "source_line": "static unsigned char stbir__pixel_channels[] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 7042, - "column": 1, - "source_line": "static stbir_internal_pixel_layout stbir__pixel_layout_convert_public_to_internal[] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_UNSUPPORTED_DECLARATOR", "message": "Unsupported declarator syntax after parsed type layers: 'STBIR_ONLY_PROFILE_BUILD_GET_INFO'.", @@ -49139,197 +50190,980 @@ "declared_type": { "reference": "stbir_datatype" }, - "source_location": null, - "callback_policy": null - }, - { - "name": "edge", - "type": { - "reference": "stbir_edge" + "source_location": null, + "callback_policy": null + }, + { + "name": "edge", + "type": { + "reference": "stbir_edge" + }, + "declared_type": { + "reference": "stbir_edge" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "filter", + "type": { + "reference": "stbir_filter" + }, + "declared_type": { + "reference": "stbir_filter" + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [ + "static" + ], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 8044, + "column": 1, + "source_line": "static void * stbir_quick_resize_helper( const void *input_pixels , int input_w , int input_h, int input_stride_in_bytes," + }, + "start": { + "filename": "stb/stb_image_resize2.h", + "line": 8044, + "column": 1, + "source_line": "static void * stbir_quick_resize_helper( const void *input_pixels , int input_w , int input_h, int input_stride_in_bytes," + }, + "end": { + "filename": "stb/stb_image_resize2.h", + "line": 8116, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + } + }, + "structs": { + "STBIR_RESIZE": { + "reference": "struct STBIR_RESIZE" + }, + "STBIR_PROFILE_INFO": { + "reference": "struct STBIR_PROFILE_INFO" + }, + "stbir__scale_info": { + "reference": "struct stbir__scale_info" + }, + "stbir__info": { + "reference": "struct stbir__info" + }, + "STBIR__V_FIRST_INFO": { + "reference": "struct STBIR__V_FIRST_INFO" + } + }, + "unions": { + "stbir__FP16": { + "reference": "union stbir__FP16" + }, + "stbir__simdi_u32": { + "reference": "union stbir__simdi_u32" + } + }, + "enums": {}, + "typedefs": { + "stbir_uint8": { + "reference": "stbir_uint8" + }, + "stbir_uint16": { + "reference": "stbir_uint16" + }, + "stbir_uint32": { + "reference": "stbir_uint32" + }, + "stbir_uint64": { + "reference": "stbir_uint64" + }, + "stbir_pixel_layout": { + "reference": "stbir_pixel_layout" + }, + "stbir_edge": { + "reference": "stbir_edge" + }, + "stbir_filter": { + "reference": "stbir_filter" + }, + "stbir_datatype": { + "reference": "stbir_datatype" + }, + "stbir_input_callback": { + "reference": "stbir_input_callback" + }, + "stbir_output_callback": { + "reference": "stbir_output_callback" + }, + "stbir__kernel_callback": { + "reference": "stbir__kernel_callback" + }, + "stbir__support_callback": { + "reference": "stbir__support_callback" + }, + "stbir__info": { + "reference": "stbir__info" + }, + "STBIR_RESIZE": { + "reference": "STBIR_RESIZE" + }, + "STBIR_PROFILE_INFO": { + "reference": "STBIR_PROFILE_INFO" + }, + "stbir_internal_pixel_layout": { + "reference": "stbir_internal_pixel_layout" + }, + "stbir__contributors": { + "reference": "stbir__contributors" + }, + "stbir__filter_extent_info": { + "reference": "stbir__filter_extent_info" + }, + "stbir__span": { + "reference": "stbir__span" + }, + "stbir__scale_info": { + "reference": "stbir__scale_info" + }, + "stbir__sampler": { + "reference": "stbir__sampler" + }, + "stbir__extents": { + "reference": "stbir__extents" + }, + "stbir__per_split_info": { + "reference": "stbir__per_split_info" + }, + "stbir__decode_pixels_func": { + "reference": "stbir__decode_pixels_func" + }, + "stbir__alpha_weight_func": { + "reference": "stbir__alpha_weight_func" + }, + "stbir__horizontal_gather_channels_func": { + "reference": "stbir__horizontal_gather_channels_func" + }, + "stbir__alpha_unweight_func": { + "reference": "stbir__alpha_unweight_func" + }, + "stbir__encode_pixels_func": { + "reference": "stbir__encode_pixels_func" + }, + "stbir__FP32": { + "reference": "stbir__FP32" + }, + "stbir__FP16": { + "reference": "stbir__FP16" + }, + "stbir__simdi_u32": { + "reference": "stbir__simdi_u32" + }, + "stbir__edge_wrap_func": { + "reference": "stbir__edge_wrap_func" + }, + "STBIR_VERTICAL_GATHERFUNC": { + "reference": "STBIR_VERTICAL_GATHERFUNC" + }, + "STBIR_VERTICAL_SCATTERFUNC": { + "reference": "STBIR_VERTICAL_SCATTERFUNC" + }, + "stbir__handle_scanline_for_scatter_func": { + "reference": "stbir__handle_scanline_for_scatter_func" + }, + "STBIR__V_FIRST_INFO": { + "reference": "STBIR__V_FIRST_INFO" + } + }, + "variables": { + "stbir__type_size": { + "name": "stbir__type_size", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbir__type_size[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1,1,1,2,4,2 \n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 904, + "column": 1, + "source_line": "static unsigned char stbir__type_size[] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__srgb_uchar_to_linear_float": { + "name": "stbir__srgb_uchar_to_linear_float", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float stbir__srgb_uchar_to_linear_float[256]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "256", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0.000000f, 0.000304f, 0.000607f, 0.000911f, 0.001214f, 0.001518f, 0.001821f, 0.002125f, 0.002428f, 0.002732f, 0.003035f,\n 0.003347f, 0.003677f, 0.004025f, 0.004391f, 0.004777f, 0.005182f, 0.005605f, 0.006049f, 0.006512f, 0.006995f, 0.007499f,\n 0.008023f, 0.008568f, 0.009134f, 0.009721f, 0.010330f, 0.010960f, 0.011612f, 0.012286f, 0.012983f, 0.013702f, 0.014444f,\n 0.015209f, 0.015996f, 0.016807f, 0.017642f, 0.018500f, 0.019382f, 0.020289f, 0.021219f, 0.022174f, 0.023153f, 0.024158f,\n 0.025187f, 0.026241f, 0.027321f, 0.028426f, 0.029557f, 0.030713f, 0.031896f, 0.033105f, 0.034340f, 0.035601f, 0.036889f,\n 0.038204f, 0.039546f, 0.040915f, 0.042311f, 0.043735f, 0.045186f, 0.046665f, 0.048172f, 0.049707f, 0.051269f, 0.052861f,\n 0.054480f, 0.056128f, 0.057805f, 0.059511f, 0.061246f, 0.063010f, 0.064803f, 0.066626f, 0.068478f, 0.070360f, 0.072272f,\n 0.074214f, 0.076185f, 0.078187f, 0.080220f, 0.082283f, 0.084376f, 0.086500f, 0.088656f, 0.090842f, 0.093059f, 0.095307f,\n 0.097587f, 0.099899f, 0.102242f, 0.104616f, 0.107023f, 0.109462f, 0.111932f, 0.114435f, 0.116971f, 0.119538f, 0.122139f,\n 0.124772f, 0.127438f, 0.130136f, 0.132868f, 0.135633f, 0.138432f, 0.141263f, 0.144128f, 0.147027f, 0.149960f, 0.152926f,\n 0.155926f, 0.158961f, 0.162029f, 0.165132f, 0.168269f, 0.171441f, 0.174647f, 0.177888f, 0.181164f, 0.184475f, 0.187821f,\n 0.191202f, 0.194618f, 0.198069f, 0.201556f, 0.205079f, 0.208637f, 0.212231f, 0.215861f, 0.219526f, 0.223228f, 0.226966f,\n 0.230740f, 0.234551f, 0.238398f, 0.242281f, 0.246201f, 0.250158f, 0.254152f, 0.258183f, 0.262251f, 0.266356f, 0.270498f,\n 0.274677f, 0.278894f, 0.283149f, 0.287441f, 0.291771f, 0.296138f, 0.300544f, 0.304987f, 0.309469f, 0.313989f, 0.318547f,\n 0.323143f, 0.327778f, 0.332452f, 0.337164f, 0.341914f, 0.346704f, 0.351533f, 0.356400f, 0.361307f, 0.366253f, 0.371238f,\n 0.376262f, 0.381326f, 0.386430f, 0.391573f, 0.396755f, 0.401978f, 0.407240f, 0.412543f, 0.417885f, 0.423268f, 0.428691f,\n 0.434154f, 0.439657f, 0.445201f, 0.450786f, 0.456411f, 0.462077f, 0.467784f, 0.473532f, 0.479320f, 0.485150f, 0.491021f,\n 0.496933f, 0.502887f, 0.508881f, 0.514918f, 0.520996f, 0.527115f, 0.533276f, 0.539480f, 0.545725f, 0.552011f, 0.558340f,\n 0.564712f, 0.571125f, 0.577581f, 0.584078f, 0.590619f, 0.597202f, 0.603827f, 0.610496f, 0.617207f, 0.623960f, 0.630757f,\n 0.637597f, 0.644480f, 0.651406f, 0.658375f, 0.665387f, 0.672443f, 0.679543f, 0.686685f, 0.693872f, 0.701102f, 0.708376f,\n 0.715694f, 0.723055f, 0.730461f, 0.737911f, 0.745404f, 0.752942f, 0.760525f, 0.768151f, 0.775822f, 0.783538f, 0.791298f,\n 0.799103f, 0.806952f, 0.814847f, 0.822786f, 0.830770f, 0.838799f, 0.846873f, 0.854993f, 0.863157f, 0.871367f, 0.879622f,\n 0.887923f, 0.896269f, 0.904661f, 0.913099f, 0.921582f, 0.930111f, 0.938686f, 0.947307f, 0.955974f, 0.964686f, 0.973445f,\n 0.982251f, 0.991102f, 1.0f\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1087, + "column": 1, + "source_line": "static float stbir__srgb_uchar_to_linear_float[256] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "fp32_to_srgb8_tab4": { + "name": "fp32_to_srgb8_tab4", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const stbir_uint32 fp32_to_srgb8_tab4[104]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "104", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbir_uint32" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0x0073000d, 0x007a000d, 0x0080000d, 0x0087000d, 0x008d000d, 0x0094000d, 0x009a000d, 0x00a1000d,\n 0x00a7001a, 0x00b4001a, 0x00c1001a, 0x00ce001a, 0x00da001a, 0x00e7001a, 0x00f4001a, 0x0101001a,\n 0x010e0033, 0x01280033, 0x01410033, 0x015b0033, 0x01750033, 0x018f0033, 0x01a80033, 0x01c20033,\n 0x01dc0067, 0x020f0067, 0x02430067, 0x02760067, 0x02aa0067, 0x02dd0067, 0x03110067, 0x03440067,\n 0x037800ce, 0x03df00ce, 0x044600ce, 0x04ad00ce, 0x051400ce, 0x057b00c5, 0x05dd00bc, 0x063b00b5,\n 0x06970158, 0x07420142, 0x07e30130, 0x087b0120, 0x090b0112, 0x09940106, 0x0a1700fc, 0x0a9500f2,\n 0x0b0f01cb, 0x0bf401ae, 0x0ccb0195, 0x0d950180, 0x0e56016e, 0x0f0d015e, 0x0fbc0150, 0x10630143,\n 0x11070264, 0x1238023e, 0x1357021d, 0x14660201, 0x156601e9, 0x165a01d3, 0x174401c0, 0x182401af,\n 0x18fe0331, 0x1a9602fe, 0x1c1502d2, 0x1d7e02ad, 0x1ed4028d, 0x201a0270, 0x21520256, 0x227d0240,\n 0x239f0443, 0x25c003fe, 0x27bf03c4, 0x29a10392, 0x2b6a0367, 0x2d1d0341, 0x2ebe031f, 0x304d0300,\n 0x31d105b0, 0x34a80555, 0x37520507, 0x39d504c5, 0x3c37048b, 0x3e7c0458, 0x40a8042a, 0x42bd0401,\n 0x44c20798, 0x488e071e, 0x4c1c06b6, 0x4f76065d, 0x52a50610, 0x55ac05cc, 0x5892058f, 0x5b590559,\n 0x5e0c0a23, 0x631c0980, 0x67db08f6, 0x6c55087f, 0x70940818, 0x74a007bd, 0x787d076c, 0x7c330723,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1122, + "column": 1, + "source_line": "static const stbir_uint32 fp32_to_srgb8_tab4[104] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir_00001111": { + "name": "stbir_00001111", + "type": { + "reference": "__m256i" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ STBIR__CONST_4d_32i( 0, 0, 0, 0 ), STBIR__CONST_4d_32i( 1, 1, 1, 1 ) }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1625, + "column": 5, + "source_line": " static __m256i stbir_00001111 = { STBIR__CONST_4d_32i( 0, 0, 0, 0 ), STBIR__CONST_4d_32i( 1, 1, 1, 1 ) };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir_22223333": { + "name": "stbir_22223333", + "type": { + "reference": "__m256i" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ STBIR__CONST_4d_32i( 2, 2, 2, 2 ), STBIR__CONST_4d_32i( 3, 3, 3, 3 ) }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1628, + "column": 5, + "source_line": " static __m256i stbir_22223333 = { STBIR__CONST_4d_32i( 2, 2, 2, 2 ), STBIR__CONST_4d_32i( 3, 3, 3, 3 ) };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir_00112233": { + "name": "stbir_00112233", + "type": { + "reference": "__m256i" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ STBIR__CONST_4d_32i( 0, 0, 1, 1 ), STBIR__CONST_4d_32i( 2, 2, 3, 3 ) }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1635, + "column": 5, + "source_line": " static __m256i stbir_00112233 = { STBIR__CONST_4d_32i( 0, 0, 1, 1 ), STBIR__CONST_4d_32i( 2, 2, 3, 3 ) };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir_load6": { + "name": "stbir_load6", + "type": { + "reference": "__m256i" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ STBIR__CONST_4_32i( 0x80000000 ), STBIR__CONST_4d_32i( 0x80000000, 0x80000000, 0, 0 ) }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 1639, + "column": 5, + "source_line": " static __m256i stbir_load6 = { STBIR__CONST_4_32i( 0x80000000 ), STBIR__CONST_4d_32i( 0x80000000, 0x80000000, 0, 0 ) };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "STBIR_mask": { + "name": "STBIR_mask", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const int STBIR_mask[9]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "9", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [ + "const" + ], + "source_text": "const int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,0,0,-1,-1,-1,0,0,0 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 2564, + "column": 1, + "source_line": "static const int STBIR_mask[9] = { 0,0,0,-1,-1,-1,0,0,0 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__edge_wrap_slow": { + "name": "stbir__edge_wrap_slow", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir__edge_wrap_func * stbir__edge_wrap_slow[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbir__edge_wrap_func" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbir__edge_clamp_full, \n stbir__edge_reflect_full, \n stbir__edge_wrap_full, \n stbir__edge_zero_full, \n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 3102, + "column": 1, + "source_line": "static stbir__edge_wrap_func * stbir__edge_wrap_slow[] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__vertical_gathers": { + "name": "stbir__vertical_gathers", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers[ 8 ]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "STBIR_VERTICAL_GATHERFUNC" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbir__vertical_gather_with_1_coeffs,stbir__vertical_gather_with_2_coeffs,stbir__vertical_gather_with_3_coeffs,stbir__vertical_gather_with_4_coeffs,stbir__vertical_gather_with_5_coeffs,stbir__vertical_gather_with_6_coeffs,stbir__vertical_gather_with_7_coeffs,stbir__vertical_gather_with_8_coeffs\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6161, + "column": 1, + "source_line": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers[ 8 ] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__vertical_gathers_continues": { + "name": "stbir__vertical_gathers_continues", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers_continues[ 8 ]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "STBIR_VERTICAL_GATHERFUNC" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbir__vertical_gather_with_1_coeffs_cont,stbir__vertical_gather_with_2_coeffs_cont,stbir__vertical_gather_with_3_coeffs_cont,stbir__vertical_gather_with_4_coeffs_cont,stbir__vertical_gather_with_5_coeffs_cont,stbir__vertical_gather_with_6_coeffs_cont,stbir__vertical_gather_with_7_coeffs_cont,stbir__vertical_gather_with_8_coeffs_cont\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6166, + "column": 1, + "source_line": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers_continues[ 8 ] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__vertical_scatter_sets": { + "name": "stbir__vertical_scatter_sets", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_sets[ 8 ]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "STBIR_VERTICAL_SCATTERFUNC" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbir__vertical_scatter_with_1_coeffs,stbir__vertical_scatter_with_2_coeffs,stbir__vertical_scatter_with_3_coeffs,stbir__vertical_scatter_with_4_coeffs,stbir__vertical_scatter_with_5_coeffs,stbir__vertical_scatter_with_6_coeffs,stbir__vertical_scatter_with_7_coeffs,stbir__vertical_scatter_with_8_coeffs\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6173, + "column": 1, + "source_line": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_sets[ 8 ] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__vertical_scatter_blends": { + "name": "stbir__vertical_scatter_blends", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_blends[ 8 ]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "STBIR_VERTICAL_SCATTERFUNC" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n stbir__vertical_scatter_with_1_coeffs_cont,stbir__vertical_scatter_with_2_coeffs_cont,stbir__vertical_scatter_with_3_coeffs_cont,stbir__vertical_scatter_with_4_coeffs_cont,stbir__vertical_scatter_with_5_coeffs_cont,stbir__vertical_scatter_with_6_coeffs_cont,stbir__vertical_scatter_with_7_coeffs_cont,stbir__vertical_scatter_with_8_coeffs_cont\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6178, + "column": 1, + "source_line": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_blends[ 8 ] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__builtin_kernels": { + "name": "stbir__builtin_kernels", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir__kernel_callback * stbir__builtin_kernels[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbir__kernel_callback" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0, stbir__filter_trapezoid, stbir__filter_triangle, stbir__filter_cubic, stbir__filter_catmullrom, stbir__filter_mitchell, stbir__filter_point }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6570, + "column": 1, + "source_line": "static stbir__kernel_callback * stbir__builtin_kernels[] = { 0, stbir__filter_trapezoid, stbir__filter_triangle, stbir__filter_cubic, stbir__filter_catmullrom, stbir__filter_mitchell, stbir__filter_point };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__builtin_supports": { + "name": "stbir__builtin_supports", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir__support_callback * stbir__builtin_supports[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbir__support_callback" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0, stbir__support_trapezoid, stbir__support_one, stbir__support_two, stbir__support_two, stbir__support_two, stbir__support_zeropoint5 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6571, + "column": 1, + "source_line": "static stbir__support_callback * stbir__builtin_supports[] = { 0, stbir__support_trapezoid, stbir__support_one, stbir__support_two, stbir__support_two, stbir__support_two, stbir__support_zeropoint5 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__horizontal_gather_n_coeffs_funcs": { + "name": "stbir__horizontal_gather_n_coeffs_funcs", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_n_coeffs_funcs[8]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbir__horizontal_gather_channels_func" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0, stbir__horizontal_gather_1_channels_with_n_coeffs_funcs, stbir__horizontal_gather_2_channels_with_n_coeffs_funcs, stbir__horizontal_gather_3_channels_with_n_coeffs_funcs, stbir__horizontal_gather_4_channels_with_n_coeffs_funcs, 0,0, stbir__horizontal_gather_7_channels_with_n_coeffs_funcs\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6883, + "column": 1, + "source_line": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_n_coeffs_funcs[8] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__horizontal_gather_channels_funcs": { + "name": "stbir__horizontal_gather_channels_funcs", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_channels_funcs[8]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" }, - "declared_type": { - "reference": "stbir_edge" + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" }, - "source_location": null, - "callback_policy": null - }, - { - "name": "filter", - "type": { - "reference": "stbir_filter" + { + "reference": "stbir__horizontal_gather_channels_func" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 0, stbir__horizontal_gather_1_channels_funcs, stbir__horizontal_gather_2_channels_funcs, stbir__horizontal_gather_3_channels_funcs, stbir__horizontal_gather_4_channels_funcs, 0,0, stbir__horizontal_gather_7_channels_funcs\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 6888, + "column": 1, + "source_line": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_channels_funcs[8] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__compute_weights": { + "name": "stbir__compute_weights", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float stbir__compute_weights[5][STBIR_RESIZE_CLASSIFICATIONS][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "5", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "reference": "stbir_filter" + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBIR_RESIZE_CLASSIFICATIONS", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - } - ], + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, "storage": [ "static" ], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", + "initializer": { + "source_text": "{\n {\n { 1.00000f, 1.00000f, 0.31250f, 1.00000f },\n { 0.56250f, 0.59375f, 0.00000f, 0.96875f },\n { 1.00000f, 0.06250f, 0.00000f, 1.00000f },\n { 0.00000f, 0.09375f, 1.00000f, 1.00000f },\n { 1.00000f, 1.00000f, 0.31250f, 1.00000f },\n { 0.03125f, 0.12500f, 1.00000f, 1.00000f },\n { 1.00000f, 1.00000f, 0.06250f, 1.00000f },\n { 0.00000f, 1.00000f, 0.00000f, 0.03125f },\n }, {\n { 0.00000f, 0.84375f, 0.00000f, 0.03125f },\n { 0.09375f, 0.93750f, 0.00000f, 0.78125f },\n { 0.87500f, 0.21875f, 0.00000f, 0.96875f },\n { 0.09375f, 0.09375f, 1.00000f, 1.00000f },\n { 0.00000f, 0.84375f, 0.00000f, 0.03125f },\n { 0.03125f, 0.12500f, 1.00000f, 1.00000f },\n { 1.00000f, 1.00000f, 0.06250f, 1.00000f },\n { 0.00000f, 1.00000f, 0.00000f, 0.53125f },\n }, {\n { 0.00000f, 0.53125f, 0.00000f, 0.03125f },\n { 0.06250f, 0.96875f, 0.00000f, 0.53125f },\n { 0.87500f, 0.18750f, 0.00000f, 0.93750f },\n { 0.00000f, 0.09375f, 1.00000f, 1.00000f },\n { 0.00000f, 0.53125f, 0.00000f, 0.03125f },\n { 0.03125f, 0.12500f, 1.00000f, 1.00000f },\n { 1.00000f, 1.00000f, 0.06250f, 1.00000f },\n { 0.00000f, 1.00000f, 0.00000f, 0.56250f },\n }, {\n { 0.00000f, 0.50000f, 0.00000f, 0.71875f },\n { 0.06250f, 0.84375f, 0.00000f, 0.87500f },\n { 1.00000f, 0.50000f, 0.50000f, 0.96875f },\n { 1.00000f, 0.09375f, 0.31250f, 0.50000f },\n { 0.00000f, 0.50000f, 0.00000f, 0.71875f },\n { 1.00000f, 0.03125f, 0.03125f, 0.53125f },\n { 1.00000f, 1.00000f, 0.06250f, 1.00000f },\n { 0.00000f, 1.00000f, 0.03125f, 0.18750f },\n }, {\n { 0.00000f, 0.59375f, 0.00000f, 0.96875f },\n { 0.06250f, 0.81250f, 0.06250f, 0.59375f },\n { 0.75000f, 0.43750f, 0.12500f, 0.96875f },\n { 0.87500f, 0.06250f, 0.18750f, 0.43750f },\n { 0.00000f, 0.59375f, 0.00000f, 0.96875f },\n { 0.15625f, 0.12500f, 1.00000f, 1.00000f },\n { 1.00000f, 1.00000f, 0.06250f, 1.00000f },\n { 0.00000f, 1.00000f, 0.03125f, 0.34375f },\n }\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 8044, + "line": 6896, "column": 1, - "source_line": "static void * stbir_quick_resize_helper( const void *input_pixels , int input_w , int input_h, int input_stride_in_bytes," + "source_line": "static float stbir__compute_weights[5][STBIR_RESIZE_CLASSIFICATIONS][4]= // 5 = 0=1chan, 1=2chan, 2=3chan, 3=4chan, 4=7chan" }, - "start": { + "callback_policy": null, + "declaration_locations": [] + }, + "STBIR__V_FIRST_INFO_BUFFER": { + "name": "STBIR__V_FIRST_INFO_BUFFER", + "type": { + "reference": "STBIR__V_FIRST_INFO" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{0}" + }, + "bit_width": null, + "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 8044, + "line": 6957, "column": 1, - "source_line": "static void * stbir_quick_resize_helper( const void *input_pixels , int input_w , int input_h, int input_stride_in_bytes," + "source_line": "static STBIR__V_FIRST_INFO STBIR__V_FIRST_INFO_BUFFER = {0};" }, - "end": { + "callback_policy": null, + "declaration_locations": [] + }, + "stbir__pixel_channels": { + "name": "stbir__pixel_channels", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbir__pixel_channels[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1,2,3,3,4, \n 4,4,4,4,2,2, \n 4,4,4,4,2,2, \n}" + }, + "bit_width": null, + "source_location": { "filename": "stb/stb_image_resize2.h", - "line": 8116, + "line": 7034, "column": 1, - "source_line": "}" + "source_line": "static unsigned char stbir__pixel_channels[] = {" }, + "callback_policy": null, "declaration_locations": [] - } - }, - "structs": { - "STBIR_RESIZE": { - "reference": "struct STBIR_RESIZE" - }, - "STBIR_PROFILE_INFO": { - "reference": "struct STBIR_PROFILE_INFO" - }, - "stbir__scale_info": { - "reference": "struct stbir__scale_info" - }, - "stbir__info": { - "reference": "struct stbir__info" - }, - "STBIR__V_FIRST_INFO": { - "reference": "struct STBIR__V_FIRST_INFO" - } - }, - "unions": { - "stbir__FP16": { - "reference": "union stbir__FP16" - }, - "stbir__simdi_u32": { - "reference": "union stbir__simdi_u32" - } - }, - "enums": {}, - "typedefs": { - "stbir_uint8": { - "reference": "stbir_uint8" - }, - "stbir_uint16": { - "reference": "stbir_uint16" - }, - "stbir_uint32": { - "reference": "stbir_uint32" - }, - "stbir_uint64": { - "reference": "stbir_uint64" - }, - "stbir_pixel_layout": { - "reference": "stbir_pixel_layout" - }, - "stbir_edge": { - "reference": "stbir_edge" - }, - "stbir_filter": { - "reference": "stbir_filter" - }, - "stbir_datatype": { - "reference": "stbir_datatype" - }, - "stbir_input_callback": { - "reference": "stbir_input_callback" - }, - "stbir_output_callback": { - "reference": "stbir_output_callback" - }, - "stbir__kernel_callback": { - "reference": "stbir__kernel_callback" - }, - "stbir__support_callback": { - "reference": "stbir__support_callback" - }, - "stbir__info": { - "reference": "stbir__info" - }, - "STBIR_RESIZE": { - "reference": "STBIR_RESIZE" - }, - "STBIR_PROFILE_INFO": { - "reference": "STBIR_PROFILE_INFO" - }, - "stbir_internal_pixel_layout": { - "reference": "stbir_internal_pixel_layout" - }, - "stbir__contributors": { - "reference": "stbir__contributors" - }, - "stbir__filter_extent_info": { - "reference": "stbir__filter_extent_info" - }, - "stbir__span": { - "reference": "stbir__span" - }, - "stbir__scale_info": { - "reference": "stbir__scale_info" - }, - "stbir__sampler": { - "reference": "stbir__sampler" - }, - "stbir__extents": { - "reference": "stbir__extents" - }, - "stbir__per_split_info": { - "reference": "stbir__per_split_info" - }, - "stbir__decode_pixels_func": { - "reference": "stbir__decode_pixels_func" - }, - "stbir__alpha_weight_func": { - "reference": "stbir__alpha_weight_func" - }, - "stbir__horizontal_gather_channels_func": { - "reference": "stbir__horizontal_gather_channels_func" - }, - "stbir__alpha_unweight_func": { - "reference": "stbir__alpha_unweight_func" - }, - "stbir__encode_pixels_func": { - "reference": "stbir__encode_pixels_func" - }, - "stbir__FP32": { - "reference": "stbir__FP32" }, - "stbir__FP16": { - "reference": "stbir__FP16" - }, - "stbir__simdi_u32": { - "reference": "stbir__simdi_u32" - }, - "stbir__edge_wrap_func": { - "reference": "stbir__edge_wrap_func" - }, - "STBIR_VERTICAL_GATHERFUNC": { - "reference": "STBIR_VERTICAL_GATHERFUNC" - }, - "STBIR_VERTICAL_SCATTERFUNC": { - "reference": "STBIR_VERTICAL_SCATTERFUNC" - }, - "stbir__handle_scanline_for_scatter_func": { - "reference": "stbir__handle_scanline_for_scatter_func" - }, - "STBIR__V_FIRST_INFO": { - "reference": "STBIR__V_FIRST_INFO" + "stbir__pixel_layout_convert_public_to_internal": { + "name": "stbir__pixel_layout_convert_public_to_internal", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbir_internal_pixel_layout stbir__pixel_layout_convert_public_to_internal[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbir_internal_pixel_layout" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBIRI_BGR, STBIRI_1CHANNEL, STBIRI_2CHANNEL, STBIRI_RGB, STBIRI_RGBA,\n STBIRI_4CHANNEL, STBIRI_BGRA, STBIRI_ARGB, STBIRI_ABGR, STBIRI_RA, STBIRI_AR,\n STBIRI_RGBA_PM, STBIRI_BGRA_PM, STBIRI_ARGB_PM, STBIRI_ABGR_PM, STBIRI_RA_PM, STBIRI_AR_PM,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_resize2.h", + "line": 7042, + "column": 1, + "source_line": "static stbir_internal_pixel_layout stbir__pixel_layout_convert_public_to_internal[] = {" + }, + "callback_policy": null, + "declaration_locations": [] } }, - "variables": {}, "macros": { "STBIR_INCLUDE_STB_IMAGE_RESIZE2_H": { "name": "STBIR_INCLUDE_STB_IMAGE_RESIZE2_H", @@ -61335,45 +63169,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBIRDEF" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 904, - "column": 1, - "source_line": "static unsigned char stbir__type_size[] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_FIELD_DECLARATION", - "message": "Nested aggregate field definitions are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 977, - "column": 3, - "source_line": " union" - }, - "unit_kind": "struct_field", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_FIELD_DECLARATION", - "message": "Nested aggregate field definitions are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1013, - "column": 3, - "source_line": " union" - }, - "unit_kind": "struct_field", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbir__inline'; provide preprocessed input to parse it.", @@ -61400,32 +63195,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbir__inline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1087, - "column": 1, - "source_line": "static float stbir__srgb_uchar_to_linear_float[256] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1122, - "column": 1, - "source_line": "static const stbir_uint32 fp32_to_srgb8_tab4[104] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbir__inline'; provide preprocessed input to parse it.", @@ -61491,58 +63260,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBIR__SIMDI_CONST" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1625, - "column": 5, - "source_line": " static __m256i stbir_00001111 = { STBIR__CONST_4d_32i( 0, 0, 0, 0 ), STBIR__CONST_4d_32i( 1, 1, 1, 1 ) };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1628, - "column": 5, - "source_line": " static __m256i stbir_22223333 = { STBIR__CONST_4d_32i( 2, 2, 2, 2 ), STBIR__CONST_4d_32i( 3, 3, 3, 3 ) };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1635, - "column": 5, - "source_line": " static __m256i stbir_00112233 = { STBIR__CONST_4d_32i( 0, 0, 1, 1 ), STBIR__CONST_4d_32i( 2, 2, 3, 3 ) };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 1639, - "column": 5, - "source_line": " static __m256i stbir_load6 = { STBIR__CONST_4_32i( 0x80000000 ), STBIR__CONST_4d_32i( 0x80000000, 0x80000000, 0, 0 ) };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbir__inline'; provide preprocessed input to parse it.", @@ -61972,19 +63689,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbir__inline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 2564, - "column": 1, - "source_line": "static const int STBIR_mask[9] = { 0,0,0,-1,-1,-1,0,0,0 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on function-like macro 'STBIR__SIMDF_CONST'; provide preprocessed input to parse it.", @@ -62154,19 +63858,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBIR_PROFILE_FUNC" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 3102, - "column": 1, - "source_line": "static stbir__edge_wrap_func * stbir__edge_wrap_slow[] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbir__inline'; provide preprocessed input to parse it.", @@ -62206,58 +63897,6 @@ "unit_kind": "declarator", "unit_name": null }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6161, - "column": 1, - "source_line": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers[ 8 ] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6166, - "column": 1, - "source_line": "static STBIR_VERTICAL_GATHERFUNC * stbir__vertical_gathers_continues[ 8 ] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6173, - "column": 1, - "source_line": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_sets[ 8 ] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6178, - "column": 1, - "source_line": "static STBIR_VERTICAL_SCATTERFUNC * stbir__vertical_scatter_blends[ 8 ] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_UNSUPPORTED_DECLARATOR", "message": "Unsupported declarator syntax after parsed type layers: 'STBIR_ONLY_PROFILE_GET_SPLIT_INFO'.", @@ -62284,110 +63923,6 @@ "unit_kind": "declarator", "unit_name": null }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6570, - "column": 1, - "source_line": "static stbir__kernel_callback * stbir__builtin_kernels[] = { 0, stbir__filter_trapezoid, stbir__filter_triangle, stbir__filter_cubic, stbir__filter_catmullrom, stbir__filter_mitchell, stbir__filter_point };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6571, - "column": 1, - "source_line": "static stbir__support_callback * stbir__builtin_supports[] = { 0, stbir__support_trapezoid, stbir__support_one, stbir__support_two, stbir__support_two, stbir__support_two, stbir__support_zeropoint5 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6883, - "column": 1, - "source_line": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_n_coeffs_funcs[8] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6888, - "column": 1, - "source_line": "static stbir__horizontal_gather_channels_func ** stbir__horizontal_gather_channels_funcs[8] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6896, - "column": 1, - "source_line": "static float stbir__compute_weights[5][STBIR_RESIZE_CLASSIFICATIONS][4]= // 5 = 0=1chan, 1=2chan, 2=3chan, 3=4chan, 4=7chan" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 6957, - "column": 1, - "source_line": "static STBIR__V_FIRST_INFO STBIR__V_FIRST_INFO_BUFFER = {0};" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 7034, - "column": 1, - "source_line": "static unsigned char stbir__pixel_channels[] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_resize2.h", - "line": 7042, - "column": 1, - "source_line": "static stbir_internal_pixel_layout stbir__pixel_layout_convert_public_to_internal[] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_UNSUPPORTED_DECLARATOR", "message": "Unsupported declarator syntax after parsed type layers: 'STBIR_ONLY_PROFILE_BUILD_GET_INFO'.", diff --git a/tests/parser/c/fixtures/stb/stb_image_write.json b/tests/parser/c/fixtures/stb/stb_image_write.json index 55a2a306f..f6e4a8d59 100644 --- a/tests/parser/c/fixtures/stb/stb_image_write.json +++ b/tests/parser/c/fixtures/stb/stb_image_write.json @@ -5463,6 +5463,47 @@ }, "callback_policy": null, "declaration_locations": [] + }, + { + "name": "stbiw__jpg_ZigZag", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const unsigned char stbiw__jpg_ZigZag[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [ + "const" + ], + "source_text": "const unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,\n 24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_write.h", + "line": 1250, + "column": 1, + "source_line": "static const unsigned char stbiw__jpg_ZigZag[] = { 0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18," + }, + "callback_policy": null, + "declaration_locations": [] } ], "macros": [ @@ -7862,19 +7903,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBIWDEF" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_write.h", - "line": 1250, - "column": 1, - "source_line": "static const unsigned char stbiw__jpg_ZigZag[] = { 0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18," - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'STBIWDEF'; provide preprocessed input to parse it.", @@ -13136,6 +13164,47 @@ }, "callback_policy": null, "declaration_locations": [] + }, + "stbiw__jpg_ZigZag": { + "name": "stbiw__jpg_ZigZag", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const unsigned char stbiw__jpg_ZigZag[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [ + "const" + ], + "source_text": "const unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,\n 24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_image_write.h", + "line": 1250, + "column": 1, + "source_line": "static const unsigned char stbiw__jpg_ZigZag[] = { 0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18," + }, + "callback_policy": null, + "declaration_locations": [] } }, "macros": { @@ -14442,19 +14511,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "STBIWDEF" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_image_write.h", - "line": 1250, - "column": 1, - "source_line": "static const unsigned char stbiw__jpg_ZigZag[] = { 0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18," - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'STBIWDEF'; provide preprocessed input to parse it.", diff --git a/tests/parser/c/fixtures/stb/stb_perlin.json b/tests/parser/c/fixtures/stb/stb_perlin.json index f70863ac5..6d3141a3c 100644 --- a/tests/parser/c/fixtures/stb/stb_perlin.json +++ b/tests/parser/c/fixtures/stb/stb_perlin.json @@ -1167,7 +1167,86 @@ "unions": [], "enums": [], "typedefs": [], - "variables": [], + "variables": [ + { + "name": "stb__perlin_randtab", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stb__perlin_randtab[512]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "512", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 23, 125, 161, 52, 103, 117, 70, 37, 247, 101, 203, 169, 124, 126, 44, 123,\n 152, 238, 145, 45, 171, 114, 253, 10, 192, 136, 4, 157, 249, 30, 35, 72,\n 175, 63, 77, 90, 181, 16, 96, 111, 133, 104, 75, 162, 93, 56, 66, 240,\n 8, 50, 84, 229, 49, 210, 173, 239, 141, 1, 87, 18, 2, 198, 143, 57,\n 225, 160, 58, 217, 168, 206, 245, 204, 199, 6, 73, 60, 20, 230, 211, 233,\n 94, 200, 88, 9, 74, 155, 33, 15, 219, 130, 226, 202, 83, 236, 42, 172,\n 165, 218, 55, 222, 46, 107, 98, 154, 109, 67, 196, 178, 127, 158, 13, 243,\n 65, 79, 166, 248, 25, 224, 115, 80, 68, 51, 184, 128, 232, 208, 151, 122,\n 26, 212, 105, 43, 179, 213, 235, 148, 146, 89, 14, 195, 28, 78, 112, 76,\n 250, 47, 24, 251, 140, 108, 186, 190, 228, 170, 183, 139, 39, 188, 244, 246,\n 132, 48, 119, 144, 180, 138, 134, 193, 82, 182, 120, 121, 86, 220, 209, 3,\n 91, 241, 149, 85, 205, 150, 113, 216, 31, 100, 41, 164, 177, 214, 153, 231,\n 38, 71, 185, 174, 97, 201, 29, 95, 7, 92, 54, 254, 191, 118, 34, 221,\n 131, 11, 163, 99, 234, 81, 227, 147, 156, 176, 17, 142, 69, 12, 110, 62,\n 27, 255, 0, 194, 59, 116, 242, 252, 19, 21, 187, 53, 207, 129, 64, 135,\n 61, 40, 167, 237, 102, 223, 106, 159, 197, 189, 215, 137, 36, 32, 22, 5,\n\n \n 23, 125, 161, 52, 103, 117, 70, 37, 247, 101, 203, 169, 124, 126, 44, 123,\n 152, 238, 145, 45, 171, 114, 253, 10, 192, 136, 4, 157, 249, 30, 35, 72,\n 175, 63, 77, 90, 181, 16, 96, 111, 133, 104, 75, 162, 93, 56, 66, 240,\n 8, 50, 84, 229, 49, 210, 173, 239, 141, 1, 87, 18, 2, 198, 143, 57,\n 225, 160, 58, 217, 168, 206, 245, 204, 199, 6, 73, 60, 20, 230, 211, 233,\n 94, 200, 88, 9, 74, 155, 33, 15, 219, 130, 226, 202, 83, 236, 42, 172,\n 165, 218, 55, 222, 46, 107, 98, 154, 109, 67, 196, 178, 127, 158, 13, 243,\n 65, 79, 166, 248, 25, 224, 115, 80, 68, 51, 184, 128, 232, 208, 151, 122,\n 26, 212, 105, 43, 179, 213, 235, 148, 146, 89, 14, 195, 28, 78, 112, 76,\n 250, 47, 24, 251, 140, 108, 186, 190, 228, 170, 183, 139, 39, 188, 244, 246,\n 132, 48, 119, 144, 180, 138, 134, 193, 82, 182, 120, 121, 86, 220, 209, 3,\n 91, 241, 149, 85, 205, 150, 113, 216, 31, 100, 41, 164, 177, 214, 153, 231,\n 38, 71, 185, 174, 97, 201, 29, 95, 7, 92, 54, 254, 191, 118, 34, 221,\n 131, 11, 163, 99, 234, 81, 227, 147, 156, 176, 17, 142, 69, 12, 110, 62,\n 27, 255, 0, 194, 59, 116, 242, 252, 19, 21, 187, 53, 207, 129, 64, 135,\n 61, 40, 167, 237, 102, 223, 106, 159, 197, 189, 215, 137, 36, 32, 22, 5,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_perlin.h", + "line": 96, + "column": 1, + "source_line": "static unsigned char stb__perlin_randtab[512] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stb__perlin_randtab_grad_idx", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stb__perlin_randtab_grad_idx[512]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "512", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 7, 9, 5, 0, 11, 1, 6, 9, 3, 9, 11, 1, 8, 10, 4, 7,\n 8, 6, 1, 5, 3, 10, 9, 10, 0, 8, 4, 1, 5, 2, 7, 8,\n 7, 11, 9, 10, 1, 0, 4, 7, 5, 0, 11, 6, 1, 4, 2, 8,\n 8, 10, 4, 9, 9, 2, 5, 7, 9, 1, 7, 2, 2, 6, 11, 5,\n 5, 4, 6, 9, 0, 1, 1, 0, 7, 6, 9, 8, 4, 10, 3, 1,\n 2, 8, 8, 9, 10, 11, 5, 11, 11, 2, 6, 10, 3, 4, 2, 4,\n 9, 10, 3, 2, 6, 3, 6, 10, 5, 3, 4, 10, 11, 2, 9, 11,\n 1, 11, 10, 4, 9, 4, 11, 0, 4, 11, 4, 0, 0, 0, 7, 6,\n 10, 4, 1, 3, 11, 5, 3, 4, 2, 9, 1, 3, 0, 1, 8, 0,\n 6, 7, 8, 7, 0, 4, 6, 10, 8, 2, 3, 11, 11, 8, 0, 2,\n 4, 8, 3, 0, 0, 10, 6, 1, 2, 2, 4, 5, 6, 0, 1, 3,\n 11, 9, 5, 5, 9, 6, 9, 8, 3, 8, 1, 8, 9, 6, 9, 11,\n 10, 7, 5, 6, 5, 9, 1, 3, 7, 0, 2, 10, 11, 2, 6, 1,\n 3, 11, 7, 7, 2, 1, 7, 3, 0, 8, 1, 1, 5, 0, 6, 10,\n 11, 11, 0, 2, 7, 0, 10, 8, 3, 5, 7, 1, 11, 1, 0, 7,\n 9, 0, 11, 5, 10, 3, 2, 3, 5, 9, 7, 9, 8, 4, 6, 5,\n\n \n 7, 9, 5, 0, 11, 1, 6, 9, 3, 9, 11, 1, 8, 10, 4, 7,\n 8, 6, 1, 5, 3, 10, 9, 10, 0, 8, 4, 1, 5, 2, 7, 8,\n 7, 11, 9, 10, 1, 0, 4, 7, 5, 0, 11, 6, 1, 4, 2, 8,\n 8, 10, 4, 9, 9, 2, 5, 7, 9, 1, 7, 2, 2, 6, 11, 5,\n 5, 4, 6, 9, 0, 1, 1, 0, 7, 6, 9, 8, 4, 10, 3, 1,\n 2, 8, 8, 9, 10, 11, 5, 11, 11, 2, 6, 10, 3, 4, 2, 4,\n 9, 10, 3, 2, 6, 3, 6, 10, 5, 3, 4, 10, 11, 2, 9, 11,\n 1, 11, 10, 4, 9, 4, 11, 0, 4, 11, 4, 0, 0, 0, 7, 6,\n 10, 4, 1, 3, 11, 5, 3, 4, 2, 9, 1, 3, 0, 1, 8, 0,\n 6, 7, 8, 7, 0, 4, 6, 10, 8, 2, 3, 11, 11, 8, 0, 2,\n 4, 8, 3, 0, 0, 10, 6, 1, 2, 2, 4, 5, 6, 0, 1, 3,\n 11, 9, 5, 5, 9, 6, 9, 8, 3, 8, 1, 8, 9, 6, 9, 11,\n 10, 7, 5, 6, 5, 9, 1, 3, 7, 0, 2, 10, 11, 2, 6, 1,\n 3, 11, 7, 7, 2, 1, 7, 3, 0, 8, 1, 1, 5, 0, 6, 10,\n 11, 11, 0, 2, 7, 0, 10, 8, 3, 5, 7, 1, 11, 1, 0, 7,\n 9, 0, 11, 5, 10, 3, 2, 3, 5, 9, 7, 9, 8, 4, 6, 5,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_perlin.h", + "line": 141, + "column": 1, + "source_line": "static unsigned char stb__perlin_randtab_grad_idx[512] =" + }, + "callback_policy": null, + "declaration_locations": [] + } + ], "macros": [ { "name": "stb__perlin_ease", @@ -1309,32 +1388,6 @@ }, "unit_kind": "declarator", "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_perlin.h", - "line": 96, - "column": 1, - "source_line": "static unsigned char stb__perlin_randtab[512] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_perlin.h", - "line": 141, - "column": 1, - "source_line": "static unsigned char stb__perlin_randtab_grad_idx[512] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null } ] } @@ -2501,7 +2554,86 @@ "unions": {}, "enums": {}, "typedefs": {}, - "variables": {}, + "variables": { + "stb__perlin_randtab": { + "name": "stb__perlin_randtab", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stb__perlin_randtab[512]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "512", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 23, 125, 161, 52, 103, 117, 70, 37, 247, 101, 203, 169, 124, 126, 44, 123,\n 152, 238, 145, 45, 171, 114, 253, 10, 192, 136, 4, 157, 249, 30, 35, 72,\n 175, 63, 77, 90, 181, 16, 96, 111, 133, 104, 75, 162, 93, 56, 66, 240,\n 8, 50, 84, 229, 49, 210, 173, 239, 141, 1, 87, 18, 2, 198, 143, 57,\n 225, 160, 58, 217, 168, 206, 245, 204, 199, 6, 73, 60, 20, 230, 211, 233,\n 94, 200, 88, 9, 74, 155, 33, 15, 219, 130, 226, 202, 83, 236, 42, 172,\n 165, 218, 55, 222, 46, 107, 98, 154, 109, 67, 196, 178, 127, 158, 13, 243,\n 65, 79, 166, 248, 25, 224, 115, 80, 68, 51, 184, 128, 232, 208, 151, 122,\n 26, 212, 105, 43, 179, 213, 235, 148, 146, 89, 14, 195, 28, 78, 112, 76,\n 250, 47, 24, 251, 140, 108, 186, 190, 228, 170, 183, 139, 39, 188, 244, 246,\n 132, 48, 119, 144, 180, 138, 134, 193, 82, 182, 120, 121, 86, 220, 209, 3,\n 91, 241, 149, 85, 205, 150, 113, 216, 31, 100, 41, 164, 177, 214, 153, 231,\n 38, 71, 185, 174, 97, 201, 29, 95, 7, 92, 54, 254, 191, 118, 34, 221,\n 131, 11, 163, 99, 234, 81, 227, 147, 156, 176, 17, 142, 69, 12, 110, 62,\n 27, 255, 0, 194, 59, 116, 242, 252, 19, 21, 187, 53, 207, 129, 64, 135,\n 61, 40, 167, 237, 102, 223, 106, 159, 197, 189, 215, 137, 36, 32, 22, 5,\n\n \n 23, 125, 161, 52, 103, 117, 70, 37, 247, 101, 203, 169, 124, 126, 44, 123,\n 152, 238, 145, 45, 171, 114, 253, 10, 192, 136, 4, 157, 249, 30, 35, 72,\n 175, 63, 77, 90, 181, 16, 96, 111, 133, 104, 75, 162, 93, 56, 66, 240,\n 8, 50, 84, 229, 49, 210, 173, 239, 141, 1, 87, 18, 2, 198, 143, 57,\n 225, 160, 58, 217, 168, 206, 245, 204, 199, 6, 73, 60, 20, 230, 211, 233,\n 94, 200, 88, 9, 74, 155, 33, 15, 219, 130, 226, 202, 83, 236, 42, 172,\n 165, 218, 55, 222, 46, 107, 98, 154, 109, 67, 196, 178, 127, 158, 13, 243,\n 65, 79, 166, 248, 25, 224, 115, 80, 68, 51, 184, 128, 232, 208, 151, 122,\n 26, 212, 105, 43, 179, 213, 235, 148, 146, 89, 14, 195, 28, 78, 112, 76,\n 250, 47, 24, 251, 140, 108, 186, 190, 228, 170, 183, 139, 39, 188, 244, 246,\n 132, 48, 119, 144, 180, 138, 134, 193, 82, 182, 120, 121, 86, 220, 209, 3,\n 91, 241, 149, 85, 205, 150, 113, 216, 31, 100, 41, 164, 177, 214, 153, 231,\n 38, 71, 185, 174, 97, 201, 29, 95, 7, 92, 54, 254, 191, 118, 34, 221,\n 131, 11, 163, 99, 234, 81, 227, 147, 156, 176, 17, 142, 69, 12, 110, 62,\n 27, 255, 0, 194, 59, 116, 242, 252, 19, 21, 187, 53, 207, 129, 64, 135,\n 61, 40, 167, 237, 102, 223, 106, 159, 197, 189, 215, 137, 36, 32, 22, 5,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_perlin.h", + "line": 96, + "column": 1, + "source_line": "static unsigned char stb__perlin_randtab[512] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stb__perlin_randtab_grad_idx": { + "name": "stb__perlin_randtab_grad_idx", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stb__perlin_randtab_grad_idx[512]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "512", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 7, 9, 5, 0, 11, 1, 6, 9, 3, 9, 11, 1, 8, 10, 4, 7,\n 8, 6, 1, 5, 3, 10, 9, 10, 0, 8, 4, 1, 5, 2, 7, 8,\n 7, 11, 9, 10, 1, 0, 4, 7, 5, 0, 11, 6, 1, 4, 2, 8,\n 8, 10, 4, 9, 9, 2, 5, 7, 9, 1, 7, 2, 2, 6, 11, 5,\n 5, 4, 6, 9, 0, 1, 1, 0, 7, 6, 9, 8, 4, 10, 3, 1,\n 2, 8, 8, 9, 10, 11, 5, 11, 11, 2, 6, 10, 3, 4, 2, 4,\n 9, 10, 3, 2, 6, 3, 6, 10, 5, 3, 4, 10, 11, 2, 9, 11,\n 1, 11, 10, 4, 9, 4, 11, 0, 4, 11, 4, 0, 0, 0, 7, 6,\n 10, 4, 1, 3, 11, 5, 3, 4, 2, 9, 1, 3, 0, 1, 8, 0,\n 6, 7, 8, 7, 0, 4, 6, 10, 8, 2, 3, 11, 11, 8, 0, 2,\n 4, 8, 3, 0, 0, 10, 6, 1, 2, 2, 4, 5, 6, 0, 1, 3,\n 11, 9, 5, 5, 9, 6, 9, 8, 3, 8, 1, 8, 9, 6, 9, 11,\n 10, 7, 5, 6, 5, 9, 1, 3, 7, 0, 2, 10, 11, 2, 6, 1,\n 3, 11, 7, 7, 2, 1, 7, 3, 0, 8, 1, 1, 5, 0, 6, 10,\n 11, 11, 0, 2, 7, 0, 10, 8, 3, 5, 7, 1, 11, 1, 0, 7,\n 9, 0, 11, 5, 10, 3, 2, 3, 5, 9, 7, 9, 8, 4, 6, 5,\n\n \n 7, 9, 5, 0, 11, 1, 6, 9, 3, 9, 11, 1, 8, 10, 4, 7,\n 8, 6, 1, 5, 3, 10, 9, 10, 0, 8, 4, 1, 5, 2, 7, 8,\n 7, 11, 9, 10, 1, 0, 4, 7, 5, 0, 11, 6, 1, 4, 2, 8,\n 8, 10, 4, 9, 9, 2, 5, 7, 9, 1, 7, 2, 2, 6, 11, 5,\n 5, 4, 6, 9, 0, 1, 1, 0, 7, 6, 9, 8, 4, 10, 3, 1,\n 2, 8, 8, 9, 10, 11, 5, 11, 11, 2, 6, 10, 3, 4, 2, 4,\n 9, 10, 3, 2, 6, 3, 6, 10, 5, 3, 4, 10, 11, 2, 9, 11,\n 1, 11, 10, 4, 9, 4, 11, 0, 4, 11, 4, 0, 0, 0, 7, 6,\n 10, 4, 1, 3, 11, 5, 3, 4, 2, 9, 1, 3, 0, 1, 8, 0,\n 6, 7, 8, 7, 0, 4, 6, 10, 8, 2, 3, 11, 11, 8, 0, 2,\n 4, 8, 3, 0, 0, 10, 6, 1, 2, 2, 4, 5, 6, 0, 1, 3,\n 11, 9, 5, 5, 9, 6, 9, 8, 3, 8, 1, 8, 9, 6, 9, 11,\n 10, 7, 5, 6, 5, 9, 1, 3, 7, 0, 2, 10, 11, 2, 6, 1,\n 3, 11, 7, 7, 2, 1, 7, 3, 0, 8, 1, 1, 5, 0, 6, 10,\n 11, 11, 0, 2, 7, 0, 10, 8, 3, 5, 7, 1, 11, 1, 0, 7,\n 9, 0, 11, 5, 10, 3, 2, 3, 5, 9, 7, 9, 8, 4, 6, 5,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_perlin.h", + "line": 141, + "column": 1, + "source_line": "static unsigned char stb__perlin_randtab_grad_idx[512] =" + }, + "callback_policy": null, + "declaration_locations": [] + } + }, "macros": { "stb__perlin_ease": { "name": "stb__perlin_ease", @@ -2597,32 +2729,6 @@ }, "unit_kind": "declarator", "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_perlin.h", - "line": 96, - "column": 1, - "source_line": "static unsigned char stb__perlin_randtab[512] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_perlin.h", - "line": 141, - "column": 1, - "source_line": "static unsigned char stb__perlin_randtab_grad_idx[512] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null } ] } diff --git a/tests/parser/c/fixtures/stb/stb_sprintf.json b/tests/parser/c/fixtures/stb/stb_sprintf.json index ee2a7f095..e182c8dc8 100644 --- a/tests/parser/c/fixtures/stb/stb_sprintf.json +++ b/tests/parser/c/fixtures/stb/stb_sprintf.json @@ -883,7 +883,7 @@ "static" ], "initializer": { - "source_text": "" + "source_text": "{\n 0,\n \"00010203040506070809101112131415161718192021222324\"\n \"25262728293031323334353637383940414243444546474849\"\n \"50515253545556575859606162636465666768697071727374\"\n \"75767778798081828384858687888990919293949596979899\"\n}" }, "bit_width": null, "source_location": { @@ -894,6 +894,293 @@ }, "callback_policy": null, "declaration_locations": [] + }, + { + "name": "stbsp__bot", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__bot[23]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "23", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1e+000, 1e+001, 1e+002, 1e+003, 1e+004, 1e+005, 1e+006, 1e+007, 1e+008, 1e+009, 1e+010, 1e+011,\n 1e+012, 1e+013, 1e+014, 1e+015, 1e+016, 1e+017, 1e+018, 1e+019, 1e+020, 1e+021, 1e+022\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1507, + "column": 1, + "source_line": "static double const stbsp__bot[23] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbsp__negbot", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__negbot[22]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "22", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1e-001, 1e-002, 1e-003, 1e-004, 1e-005, 1e-006, 1e-007, 1e-008, 1e-009, 1e-010, 1e-011,\n 1e-012, 1e-013, 1e-014, 1e-015, 1e-016, 1e-017, 1e-018, 1e-019, 1e-020, 1e-021, 1e-022\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1511, + "column": 1, + "source_line": "static double const stbsp__negbot[22] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbsp__negboterr", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__negboterr[22]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "22", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n -5.551115123125783e-018, -2.0816681711721684e-019, -2.0816681711721686e-020, -4.7921736023859299e-021, -8.1803053914031305e-022, 4.5251888174113741e-023,\n 4.5251888174113739e-024, -2.0922560830128471e-025, -6.2281591457779853e-026, -3.6432197315497743e-027, 6.0503030718060191e-028, 2.0113352370744385e-029,\n -3.0373745563400371e-030, 1.1806906454401013e-032, -7.7705399876661076e-032, 2.0902213275965398e-033, -7.1542424054621921e-034, -7.1542424054621926e-035,\n 2.4754073164739869e-036, 5.4846728545790429e-037, 9.2462547772103625e-038, -4.8596774326570872e-039\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1515, + "column": 1, + "source_line": "static double const stbsp__negboterr[22] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbsp__top", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__top[13]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "13", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1e+023, 1e+046, 1e+069, 1e+092, 1e+115, 1e+138, 1e+161, 1e+184, 1e+207, 1e+230, 1e+253, 1e+276, 1e+299\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1521, + "column": 1, + "source_line": "static double const stbsp__top[13] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbsp__negtop", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__negtop[13]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "13", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1e-023, 1e-046, 1e-069, 1e-092, 1e-115, 1e-138, 1e-161, 1e-184, 1e-207, 1e-230, 1e-253, 1e-276, 1e-299\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1524, + "column": 1, + "source_line": "static double const stbsp__negtop[13] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbsp__toperr", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__toperr[13]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "13", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 8388608,\n 6.8601809640529717e+028,\n -7.253143638152921e+052,\n -4.3377296974619174e+075,\n -1.5559416129466825e+098,\n -3.2841562489204913e+121,\n -3.7745893248228135e+144,\n -1.7356668416969134e+167,\n -3.8893577551088374e+190,\n -9.9566444326005119e+213,\n 6.3641293062232429e+236,\n -5.2069140800249813e+259,\n -5.2504760255204387e+282\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1527, + "column": 1, + "source_line": "static double const stbsp__toperr[13] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbsp__negtoperr", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__negtoperr[13]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "13", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 3.9565301985100693e-040, -2.299904345391321e-063, 3.6506201437945798e-086, 1.1875228833981544e-109,\n -5.0644902316928607e-132, -6.7156837247865426e-155, -2.812077463003139e-178, -5.7778912386589953e-201,\n 7.4997100559334532e-224, -4.6439668915134491e-247, -6.3691100762962136e-270, -9.436808465446358e-293,\n 8.0970921678014997e-317\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1542, + "column": 1, + "source_line": "static double const stbsp__negtoperr[13] = {" + }, + "callback_policy": null, + "declaration_locations": [] } ], "macros": [ @@ -2856,7 +3143,7 @@ "column": 1, "source_line": "static stbsp__uint64 const stbsp__powten[20] = {" }, - "source_text": "static stbsp__uint64 const stbsp__powten[20] =" + "source_text": "static stbsp__uint64 const stbsp__powten[20] = {\n 1,\n 10,\n 100,\n 1000,\n 10000,\n 100000,\n 1000000,\n 10000000,\n 100000000,\n 1000000000,\n 10000000000,\n 100000000000,\n 1000000000000,\n 10000000000000,\n 100000000000000,\n 1000000000000000,\n 10000000000000000,\n 100000000000000000,\n 1000000000000000000,\n 10000000000000000000U\n}" }, { "name": "stbsp__uint64", @@ -2867,7 +3154,7 @@ "column": 1, "source_line": "static stbsp__uint64 const stbsp__powten[20] = {" }, - "source_text": "static stbsp__uint64 const stbsp__powten[20] =" + "source_text": "static stbsp__uint64 const stbsp__powten[20] = {\n 1,\n 10,\n 100,\n 1000,\n 10000,\n 100000,\n 1000000,\n 10000000,\n 100000000,\n 1000000000,\n 10000000000ULL,\n 100000000000ULL,\n 1000000000000ULL,\n 10000000000000ULL,\n 100000000000000ULL,\n 1000000000000000ULL,\n 10000000000000000ULL,\n 100000000000000000ULL,\n 1000000000000000000ULL,\n 10000000000000000000ULL\n}" }, { "name": "stbsp__int32", @@ -3312,147 +3599,56 @@ "unit_name": "stbsp__int32" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_MACRO_DEPENDENT_DECLARATION", + "message": "Declaration depends on object-like macro 'stbsp__uint64'; provide preprocessed input to parse it.", "severity": "warning", "location": { "filename": "stb/stb_sprintf.h", - "line": 1507, + "line": 1550, "column": 1, - "source_line": "static double const stbsp__bot[23] = {" + "source_line": "static stbsp__uint64 const stbsp__powten[20] = {" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro_dependent_declaration", + "unit_name": "stbsp__uint64" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_MACRO_DEPENDENT_DECLARATION", + "message": "Declaration depends on object-like macro 'stbsp__uint64'; provide preprocessed input to parse it.", "severity": "warning", "location": { "filename": "stb/stb_sprintf.h", - "line": 1511, + "line": 1574, "column": 1, - "source_line": "static double const stbsp__negbot[22] = {" + "source_line": "static stbsp__uint64 const stbsp__powten[20] = {" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro_dependent_declaration", + "unit_name": "stbsp__uint64" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_MACRO_DEPENDENT_DECLARATION", + "message": "Declaration depends on object-like macro 'stbsp__int32'; provide preprocessed input to parse it.", "severity": "warning", "location": { "filename": "stb/stb_sprintf.h", - "line": 1515, + "line": 1705, "column": 1, - "source_line": "static double const stbsp__negboterr[22] = {" + "source_line": "static stbsp__int32 stbsp__real_to_str(char const **start, stbsp__uint32 *len, char *out, stbsp__int32 *decimal_pos, double value, stbsp__uint32 frac_digits)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1521, - "column": 1, - "source_line": "static double const stbsp__top[13] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1524, - "column": 1, - "source_line": "static double const stbsp__negtop[13] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1527, - "column": 1, - "source_line": "static double const stbsp__toperr[13] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1542, - "column": 1, - "source_line": "static double const stbsp__negtoperr[13] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_MACRO_DEPENDENT_DECLARATION", - "message": "Declaration depends on object-like macro 'stbsp__uint64'; provide preprocessed input to parse it.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1550, - "column": 1, - "source_line": "static stbsp__uint64 const stbsp__powten[20] = {" - }, - "unit_kind": "macro_dependent_declaration", - "unit_name": "stbsp__uint64" - }, - { - "code": "C_MACRO_DEPENDENT_DECLARATION", - "message": "Declaration depends on object-like macro 'stbsp__uint64'; provide preprocessed input to parse it.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1574, - "column": 1, - "source_line": "static stbsp__uint64 const stbsp__powten[20] = {" - }, - "unit_kind": "macro_dependent_declaration", - "unit_name": "stbsp__uint64" - }, - { - "code": "C_MACRO_DEPENDENT_DECLARATION", - "message": "Declaration depends on object-like macro 'stbsp__int32'; provide preprocessed input to parse it.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1705, - "column": 1, - "source_line": "static stbsp__int32 stbsp__real_to_str(char const **start, stbsp__uint32 *len, char *out, stbsp__int32 *decimal_pos, double value, stbsp__uint32 frac_digits)" - }, - "unit_kind": "macro_dependent_declaration", - "unit_name": "stbsp__int32" - } - ] - } - }, - "functions": { - "stbsp__lead_sign": { - "name": "stbsp__lead_sign", - "result_type": { - "model": "CVoid", - "qualifiers": [], - "source_text": "void" - }, - "parameters": [ + "unit_kind": "macro_dependent_declaration", + "unit_name": "stbsp__int32" + } + ] + } + }, + "functions": { + "stbsp__lead_sign": { + "name": "stbsp__lead_sign", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [ { "name": "fl", "type": { @@ -4033,7 +4229,7 @@ "static" ], "initializer": { - "source_text": "" + "source_text": "{\n 0,\n \"00010203040506070809101112131415161718192021222324\"\n \"25262728293031323334353637383940414243444546474849\"\n \"50515253545556575859606162636465666768697071727374\"\n \"75767778798081828384858687888990919293949596979899\"\n}" }, "bit_width": null, "source_location": { @@ -4044,6 +4240,293 @@ }, "callback_policy": null, "declaration_locations": [] + }, + "stbsp__bot": { + "name": "stbsp__bot", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__bot[23]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "23", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1e+000, 1e+001, 1e+002, 1e+003, 1e+004, 1e+005, 1e+006, 1e+007, 1e+008, 1e+009, 1e+010, 1e+011,\n 1e+012, 1e+013, 1e+014, 1e+015, 1e+016, 1e+017, 1e+018, 1e+019, 1e+020, 1e+021, 1e+022\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1507, + "column": 1, + "source_line": "static double const stbsp__bot[23] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbsp__negbot": { + "name": "stbsp__negbot", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__negbot[22]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "22", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1e-001, 1e-002, 1e-003, 1e-004, 1e-005, 1e-006, 1e-007, 1e-008, 1e-009, 1e-010, 1e-011,\n 1e-012, 1e-013, 1e-014, 1e-015, 1e-016, 1e-017, 1e-018, 1e-019, 1e-020, 1e-021, 1e-022\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1511, + "column": 1, + "source_line": "static double const stbsp__negbot[22] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbsp__negboterr": { + "name": "stbsp__negboterr", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__negboterr[22]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "22", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n -5.551115123125783e-018, -2.0816681711721684e-019, -2.0816681711721686e-020, -4.7921736023859299e-021, -8.1803053914031305e-022, 4.5251888174113741e-023,\n 4.5251888174113739e-024, -2.0922560830128471e-025, -6.2281591457779853e-026, -3.6432197315497743e-027, 6.0503030718060191e-028, 2.0113352370744385e-029,\n -3.0373745563400371e-030, 1.1806906454401013e-032, -7.7705399876661076e-032, 2.0902213275965398e-033, -7.1542424054621921e-034, -7.1542424054621926e-035,\n 2.4754073164739869e-036, 5.4846728545790429e-037, 9.2462547772103625e-038, -4.8596774326570872e-039\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1515, + "column": 1, + "source_line": "static double const stbsp__negboterr[22] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbsp__top": { + "name": "stbsp__top", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__top[13]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "13", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1e+023, 1e+046, 1e+069, 1e+092, 1e+115, 1e+138, 1e+161, 1e+184, 1e+207, 1e+230, 1e+253, 1e+276, 1e+299\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1521, + "column": 1, + "source_line": "static double const stbsp__top[13] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbsp__negtop": { + "name": "stbsp__negtop", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__negtop[13]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "13", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1e-023, 1e-046, 1e-069, 1e-092, 1e-115, 1e-138, 1e-161, 1e-184, 1e-207, 1e-230, 1e-253, 1e-276, 1e-299\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1524, + "column": 1, + "source_line": "static double const stbsp__negtop[13] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbsp__toperr": { + "name": "stbsp__toperr", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__toperr[13]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "13", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 8388608,\n 6.8601809640529717e+028,\n -7.253143638152921e+052,\n -4.3377296974619174e+075,\n -1.5559416129466825e+098,\n -3.2841562489204913e+121,\n -3.7745893248228135e+144,\n -1.7356668416969134e+167,\n -3.8893577551088374e+190,\n -9.9566444326005119e+213,\n 6.3641293062232429e+236,\n -5.2069140800249813e+259,\n -5.2504760255204387e+282\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1527, + "column": 1, + "source_line": "static double const stbsp__toperr[13] = {" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbsp__negtoperr": { + "name": "stbsp__negtoperr", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static double const stbsp__negtoperr[13]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "13", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CDouble", + "qualifiers": [ + "const" + ], + "source_text": "const double" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 3.9565301985100693e-040, -2.299904345391321e-063, 3.6506201437945798e-086, 1.1875228833981544e-109,\n -5.0644902316928607e-132, -6.7156837247865426e-155, -2.812077463003139e-178, -5.7778912386589953e-201,\n 7.4997100559334532e-224, -4.6439668915134491e-247, -6.3691100762962136e-270, -9.436808465446358e-293,\n 8.0970921678014997e-317\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_sprintf.h", + "line": 1542, + "column": 1, + "source_line": "static double const stbsp__negtoperr[13] = {" + }, + "callback_policy": null, + "declaration_locations": [] } }, "macros": { @@ -5030,97 +5513,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "stbsp__int32" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1507, - "column": 1, - "source_line": "static double const stbsp__bot[23] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1511, - "column": 1, - "source_line": "static double const stbsp__negbot[22] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1515, - "column": 1, - "source_line": "static double const stbsp__negboterr[22] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1521, - "column": 1, - "source_line": "static double const stbsp__top[13] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1524, - "column": 1, - "source_line": "static double const stbsp__negtop[13] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1527, - "column": 1, - "source_line": "static double const stbsp__toperr[13] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_sprintf.h", - "line": 1542, - "column": 1, - "source_line": "static double const stbsp__negtoperr[13] = {" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro 'stbsp__uint64'; provide preprocessed input to parse it.", diff --git a/tests/parser/c/fixtures/stb/stb_tilemap_editor.json b/tests/parser/c/fixtures/stb/stb_tilemap_editor.json index 86cc86c81..45dd93696 100644 --- a/tests/parser/c/fixtures/stb/stb_tilemap_editor.json +++ b/tests/parser/c/fixtures/stb/stb_tilemap_editor.json @@ -17322,6 +17322,173 @@ } ], "variables": [ + { + "name": "stbte__color_names", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static char *stbte__color_names[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CChar", + "qualifiers": [], + "source_text": "char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n \"expander\", \"toolbar\", \"tool button\", \"panel\",\n \"panel c1\", \"panel c2\", \"scollbar\", \"map button\",\n \"layer\", \"hide\", \"lock\", \"solo\",\n \"category\",\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 641, + "column": 1, + "source_line": "static char *stbte__color_names[] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbte__color_table", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static int stbte__color_table[STBTE__num_color_modes][STBTE__num_color_aspects][STBTE__num_color_states]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBTE__num_color_modes", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBTE__num_color_aspects", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBTE__num_color_states", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [], + "source_text": "int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n {\n { 0x000000, 0x84987c, 0xdcdca8, 0xdcdca8, 0x40c040, 0x60d060, 0x505050, },\n { 0xa4b090, 0xe0ec80, 0xffffc0, 0xffffc0, 0x80ff80, 0x80ff80, 0x606060, },\n { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0x808890, 0x606060, 0x606060, 0x606060, 0x606060, 0x606060, 0x606060, },\n { 0x605860, 0x606060, 0x606060, 0x606060, 0x606060, 0x606060, 0x606060, },\n { 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, },\n }, {\n { 0x3c5068, 0x7088a8, 0x647488, 0x94b4dc, 0x8890c4, 0x9caccc, 0x404040, },\n { 0x889cb8, 0x889cb8, 0x889cb8, 0x889cb8, 0x84c4e8, 0xacc8ff, 0x0c0c08, },\n { 0xbcc4cc, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x707074, },\n }, {\n { 0x403848, 0x403010, 0x403010, 0x403010, 0x403010, 0x403010, 0x303024, },\n { 0x68546c, 0xc08040, 0xc08040, 0xc08040, 0xc08040, 0xc08040, 0x605030, },\n { 0xf4e4ff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0xb4b04c, 0xacac60, 0xc0ffc0, 0xc0ffc0, 0x40c040, 0x60d060, 0x505050, },\n { 0xa0a04c, 0xd0d04c, 0xffff80, 0xffff80, 0x80ff80, 0x80ff80, 0x606060, },\n { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0x40c440, 0x60d060, 0xc0ffc0, 0xc0ffc0, 0x40c040, 0x60d060, 0x505050, },\n { 0x40c040, 0x80ff80, 0x80ff80, 0x80ff80, 0x80ff80, 0x80ff80, 0x606060, },\n { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0x9090ac, 0xa0a0b8, 0xbcb8cc, 0xbcb8cc, 0x909040, 0x909040, 0x909040, },\n { 0xa0a0b8, 0xb0b4d0, 0xa0a0b8, 0xa0a0b8, 0xa0a050, 0xa0a050, 0xa0a050, },\n { 0x808088, 0x808030, 0x808030, 0x808030, 0x808030, 0x808030, 0x808030, },\n }, {\n { 0x704c70, 0x885c8c, 0x9c68a4, 0xb870bc, 0xb490bc, 0xb490bc, 0x302828, },\n { 0x646064, 0xcca8d4, 0xc060c0, 0xa07898, 0xe0b8e0, 0xe0b8e0, 0x403838, },\n { 0xdccce4, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0x704c70, 0x885c8c, 0x9c68a4, 0xb870bc, 0xb490bc, 0xb490bc, 0x302828, },\n { 0xb09cb4, 0xcca8d4, 0xc060c0, 0xa07898, 0xe0b8e0, 0xe0b8e0, 0x403838, },\n { 0xdccce4, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0x646494, 0x888cb8, 0xb0b0b0, 0xb0b0cc, 0x9c9cf4, 0x8888b0, 0x50506c, },\n { 0x9090a4, 0xb0b4d4, 0xb0b0dc, 0xb0b0cc, 0xd0d0fc, 0xd0d4f0, 0x606060, },\n { 0xb4b4d4, 0xe4e4ff, 0xffffff, 0xffffff, 0xe0e4ff, 0xececff, 0x909090, },\n }, {\n { 0x646444, 0x888c64, 0xb0b0b0, 0xb0b088, 0xaca858, 0x88886c, 0x505050, },\n { 0x88886c, 0xb0b490, 0xb0b0b0, 0xb0b088, 0xd8d898, 0xd0d4b0, 0x606060, },\n { 0xb4b49c, 0xffffd8, 0xffffff, 0xffffd4, 0xffffdc, 0xffffcc, 0x909090, },\n }, {\n { 0x906464, 0xb48c8c, 0xd4b0b0, 0xdcb0b0, 0xff9c9c, 0xc88888, 0x505050, },\n { 0xb47c80, 0xd4b4b8, 0xc4a8a8, 0xdcb0b0, 0xffc0c0, 0xfce8ec, 0x606060, },\n { 0xe0b4b4, 0xffdcd8, 0xffd8d4, 0xffe0e4, 0xffece8, 0xffffff, 0x909090, },\n }, {\n { 0x403848, 0x403848, 0x403848, 0x886894, 0x7c80c8, 0x7c80c8, 0x302828, },\n { 0x403848, 0x403848, 0x403848, 0x403848, 0x7c80c8, 0x7c80c8, 0x403838, },\n { 0xc8c4c8, 0xffffff, 0xffffff, 0xffffff, 0xe8e8ec, 0xffffff, 0x909090, },\n },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 651, + "column": 1, + "source_line": "static int stbte__color_table[STBTE__num_color_modes][STBTE__num_color_aspects][STBTE__num_color_states] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbte__state_to_index", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbte__state_to_index[2][2][2][2]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n {\n { { STBTE__idle , STBTE__over }, { STBTE__down , STBTE__over_down }, },\n { { STBTE__selected, STBTE__selected_over }, { STBTE__down , STBTE__over_down }, },\n },{\n { { STBTE__disabled, STBTE__disabled }, { STBTE__disabled, STBTE__disabled }, },\n { { STBTE__selected, STBTE__selected_over }, { STBTE__disabled, STBTE__disabled }, },\n }\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 731, + "column": 1, + "source_line": "static unsigned char stbte__state_to_index[2][2][2][2] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, { "name": "stbte__font_offset", "type": { @@ -17359,6 +17526,105 @@ "callback_policy": null, "declaration_locations": [] }, + { + "name": "stbte__fontdata", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static short stbte__fontdata[769]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "769", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CShort", + "qualifiers": [], + "source_text": "short" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 4,9,6,9,9,9,9,8,9,8,4,9,7,7,7,7,4,2,6,8,6,6,7,3,4,4,8,6,3,6,2,6,6,6,6,6,6,\n 6,6,6,6,6,2,3,5,4,5,6,6,6,6,6,6,6,6,6,6,6,6,7,6,7,7,7,6,7,6,6,6,6,7,7,6,6,\n 6,4,6,4,7,7,3,6,6,5,6,6,5,6,6,4,5,6,4,7,6,6,6,6,6,6,6,6,6,7,6,6,6,5,2,5,8,\n 0,0,0,0,2,253,130,456,156,8,72,184,64,2,125,66,64,160,64,146,511,146,146,\n 511,146,146,511,146,511,257,341,297,341,297,341,257,511,16,56,124,16,16,16,\n 124,56,16,96,144,270,261,262,136,80,48,224,192,160,80,40,22,14,15,3,448,496,\n 496,240,232,20,10,5,2,112,232,452,450,225,113,58,28,63,30,60,200,455,257,\n 257,0,0,0,257,257,455,120,204,132,132,159,14,4,4,14,159,132,132,204,120,8,\n 24,56,120,56,24,8,32,48,56,60,56,48,32,0,0,0,0,111,111,7,7,0,0,7,7,34,127,\n 127,34,34,127,127,34,36,46,107,107,58,18,99,51,24,12,102,99,48,122,79,93,\n 55,114,80,4,7,3,62,127,99,65,65,99,127,62,8,42,62,28,28,62,42,8,8,8,62,62,\n 8,8,128,224,96,8,8,8,8,8,8,96,96,96,48,24,12,6,3,62,127,89,77,127,62,64,66,\n 127,127,64,64,98,115,89,77,71,66,33,97,73,93,119,35,24,28,22,127,127,16,39,\n 103,69,69,125,57,62,127,73,73,121,48,1,1,113,121,15,7,54,127,73,73,127,54,\n 6,79,73,105,63,30,54,54,128,246,118,8,28,54,99,65,20,20,20,20,65,99,54,28,\n 8,2,3,105,109,7,2,30,63,33,45,47,46,124,126,19,19,126,124,127,127,73,73,127,\n 54,62,127,65,65,99,34,127,127,65,99,62,28,127,127,73,73,73,65,127,127,9,9,\n 9,1,62,127,65,73,121,121,127,127,8,8,127,127,65,65,127,127,65,65,32,96,64,\n 64,127,63,127,127,8,28,54,99,65,127,127,64,64,64,64,127,127,6,12,6,127,127,\n 127,127,6,12,24,127,127,62,127,65,65,65,127,62,127,127,9,9,15,6,62,127,65,\n 81,49,127,94,127,127,9,25,127,102,70,79,73,73,121,49,1,1,127,127,1,1,63,127,\n 64,64,127,63,15,31,48,96,48,31,15,127,127,48,24,48,127,127,99,119,28,28,119,\n 99,7,15,120,120,15,7,97,113,89,77,71,67,127,127,65,65,3,6,12,24,48,96,65,\n 65,127,127,8,12,6,3,6,12,8,64,64,64,64,64,64,64,3,7,4,32,116,84,84,124,120,\n 127,127,68,68,124,56,56,124,68,68,68,56,124,68,68,127,127,56,124,84,84,92,\n 24,8,124,126,10,10,56,380,324,324,508,252,127,127,4,4,124,120,72,122,122,\n 64,256,256,256,506,250,126,126,16,56,104,64,66,126,126,64,124,124,24,56,28,\n 124,120,124,124,4,4,124,120,56,124,68,68,124,56,508,508,68,68,124,56,56,124,\n 68,68,508,508,124,124,4,4,12,8,72,92,84,84,116,36,4,4,62,126,68,68,60,124,\n 64,64,124,124,28,60,96,96,60,28,28,124,112,56,112,124,28,68,108,56,56,108,\n 68,284,316,352,320,508,252,68,100,116,92,76,68,8,62,119,65,65,127,127,65,\n 65,119,62,8,16,24,12,12,24,24,12,4,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 746, + "column": 1, + "source_line": "static short stbte__fontdata[769] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "toolchar", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static int toolchar[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [], + "source_text": "int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 26,24,25,20,23,22,18, 19,17, 29,28, }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 838, + "column": 1, + "source_line": "static int toolchar[] = { 26,24,25,20,23,22,18, 19,17, 29,28, };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "stbte__ui", + "type": { + "reference": "stbte__ui_t" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ STBTE__tool_brush, 0 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 919, + "column": 1, + "source_line": "static stbte__ui_t stbte__ui = { STBTE__tool_brush, 0 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, { "name": "default_category", "type": { @@ -19903,84 +20169,6 @@ }, "unit_kind": "macro", "unit_name": "STBTE__TEXTCOLOR" - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 641, - "column": 1, - "source_line": "static char *stbte__color_names[] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 651, - "column": 1, - "source_line": "static int stbte__color_table[STBTE__num_color_modes][STBTE__num_color_aspects][STBTE__num_color_states] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 731, - "column": 1, - "source_line": "static unsigned char stbte__state_to_index[2][2][2][2] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 746, - "column": 1, - "source_line": "static short stbte__fontdata[769] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 838, - "column": 1, - "source_line": "static int toolchar[] = { 26,24,25,20,23,22,18, 19,17, 29,28, };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 919, - "column": 1, - "source_line": "static stbte__ui_t stbte__ui = { STBTE__tool_brush, 0 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null } ] } @@ -32567,101 +32755,268 @@ "type": { "model": "CInt", "qualifiers": [], - "source_text": "int x" + "source_text": "int x" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int x" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "y", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int y" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int y" + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [ + "static" + ], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 4040, + "column": 1, + "source_line": "static void stbte__set_event(int event, int x, int y)" + }, + "start": { + "filename": "stb/stb_tilemap_editor.h", + "line": 4040, + "column": 1, + "source_line": "static void stbte__set_event(int event, int x, int y)" + }, + "end": { + "filename": "stb/stb_tilemap_editor.h", + "line": 4051, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + } + }, + "structs": { + "stbte_tilemap": { + "reference": "struct stbte_tilemap" + } + }, + "unions": {}, + "enums": { + "stbte_action": { + "reference": "enum stbte_action" + } + }, + "typedefs": { + "stbte_tilemap": { + "reference": "stbte_tilemap" + }, + "stbte__link": { + "reference": "stbte__link" + }, + "stbte__tileinfo": { + "reference": "stbte__tileinfo" + }, + "stbte__tiledata": { + "reference": "stbte__tiledata" + }, + "stbte__panel": { + "reference": "stbte__panel" + }, + "stbte__colorrect": { + "reference": "stbte__colorrect" + }, + "stbte__ui_t": { + "reference": "stbte__ui_t" + }, + "stbte__layer": { + "reference": "stbte__layer" + }, + "stbte__region_t": { + "reference": "stbte__region_t" + } + }, + "variables": { + "stbte__color_names": { + "name": "stbte__color_names", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static char *stbte__color_names[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CChar", + "qualifiers": [], + "source_text": "char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n \"expander\", \"toolbar\", \"tool button\", \"panel\",\n \"panel c1\", \"panel c2\", \"scollbar\", \"map button\",\n \"layer\", \"hide\", \"lock\", \"solo\",\n \"category\",\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 641, + "column": 1, + "source_line": "static char *stbte__color_names[] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbte__color_table": { + "name": "stbte__color_table", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static int stbte__color_table[STBTE__num_color_modes][STBTE__num_color_aspects][STBTE__num_color_states]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBTE__num_color_modes", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBTE__num_color_aspects", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBTE__num_color_states", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [], + "source_text": "int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n {\n { 0x000000, 0x84987c, 0xdcdca8, 0xdcdca8, 0x40c040, 0x60d060, 0x505050, },\n { 0xa4b090, 0xe0ec80, 0xffffc0, 0xffffc0, 0x80ff80, 0x80ff80, 0x606060, },\n { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0x808890, 0x606060, 0x606060, 0x606060, 0x606060, 0x606060, 0x606060, },\n { 0x605860, 0x606060, 0x606060, 0x606060, 0x606060, 0x606060, 0x606060, },\n { 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, },\n }, {\n { 0x3c5068, 0x7088a8, 0x647488, 0x94b4dc, 0x8890c4, 0x9caccc, 0x404040, },\n { 0x889cb8, 0x889cb8, 0x889cb8, 0x889cb8, 0x84c4e8, 0xacc8ff, 0x0c0c08, },\n { 0xbcc4cc, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x707074, },\n }, {\n { 0x403848, 0x403010, 0x403010, 0x403010, 0x403010, 0x403010, 0x303024, },\n { 0x68546c, 0xc08040, 0xc08040, 0xc08040, 0xc08040, 0xc08040, 0x605030, },\n { 0xf4e4ff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0xb4b04c, 0xacac60, 0xc0ffc0, 0xc0ffc0, 0x40c040, 0x60d060, 0x505050, },\n { 0xa0a04c, 0xd0d04c, 0xffff80, 0xffff80, 0x80ff80, 0x80ff80, 0x606060, },\n { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0x40c440, 0x60d060, 0xc0ffc0, 0xc0ffc0, 0x40c040, 0x60d060, 0x505050, },\n { 0x40c040, 0x80ff80, 0x80ff80, 0x80ff80, 0x80ff80, 0x80ff80, 0x606060, },\n { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0x9090ac, 0xa0a0b8, 0xbcb8cc, 0xbcb8cc, 0x909040, 0x909040, 0x909040, },\n { 0xa0a0b8, 0xb0b4d0, 0xa0a0b8, 0xa0a0b8, 0xa0a050, 0xa0a050, 0xa0a050, },\n { 0x808088, 0x808030, 0x808030, 0x808030, 0x808030, 0x808030, 0x808030, },\n }, {\n { 0x704c70, 0x885c8c, 0x9c68a4, 0xb870bc, 0xb490bc, 0xb490bc, 0x302828, },\n { 0x646064, 0xcca8d4, 0xc060c0, 0xa07898, 0xe0b8e0, 0xe0b8e0, 0x403838, },\n { 0xdccce4, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0x704c70, 0x885c8c, 0x9c68a4, 0xb870bc, 0xb490bc, 0xb490bc, 0x302828, },\n { 0xb09cb4, 0xcca8d4, 0xc060c0, 0xa07898, 0xe0b8e0, 0xe0b8e0, 0x403838, },\n { 0xdccce4, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x909090, },\n }, {\n { 0x646494, 0x888cb8, 0xb0b0b0, 0xb0b0cc, 0x9c9cf4, 0x8888b0, 0x50506c, },\n { 0x9090a4, 0xb0b4d4, 0xb0b0dc, 0xb0b0cc, 0xd0d0fc, 0xd0d4f0, 0x606060, },\n { 0xb4b4d4, 0xe4e4ff, 0xffffff, 0xffffff, 0xe0e4ff, 0xececff, 0x909090, },\n }, {\n { 0x646444, 0x888c64, 0xb0b0b0, 0xb0b088, 0xaca858, 0x88886c, 0x505050, },\n { 0x88886c, 0xb0b490, 0xb0b0b0, 0xb0b088, 0xd8d898, 0xd0d4b0, 0x606060, },\n { 0xb4b49c, 0xffffd8, 0xffffff, 0xffffd4, 0xffffdc, 0xffffcc, 0x909090, },\n }, {\n { 0x906464, 0xb48c8c, 0xd4b0b0, 0xdcb0b0, 0xff9c9c, 0xc88888, 0x505050, },\n { 0xb47c80, 0xd4b4b8, 0xc4a8a8, 0xdcb0b0, 0xffc0c0, 0xfce8ec, 0x606060, },\n { 0xe0b4b4, 0xffdcd8, 0xffd8d4, 0xffe0e4, 0xffece8, 0xffffff, 0x909090, },\n }, {\n { 0x403848, 0x403848, 0x403848, 0x886894, 0x7c80c8, 0x7c80c8, 0x302828, },\n { 0x403848, 0x403848, 0x403848, 0x403848, 0x7c80c8, 0x7c80c8, 0x403838, },\n { 0xc8c4c8, 0xffffff, 0xffffff, 0xffffff, 0xe8e8ec, 0xffffff, 0x909090, },\n },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 651, + "column": 1, + "source_line": "static int stbte__color_table[STBTE__num_color_modes][STBTE__num_color_aspects][STBTE__num_color_states] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbte__state_to_index": { + "name": "stbte__state_to_index", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbte__state_to_index[2][2][2][2]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CInt", + { + "model": "CArray", "qualifiers": [], - "source_text": "int x" + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - }, - { - "name": "y", - "type": { - "model": "CInt", + { + "model": "CArray", "qualifiers": [], - "source_text": "int y" + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CInt", + { + "model": "CArray", "qualifiers": [], - "source_text": "int y" + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - } - ], + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, "storage": [ "static" ], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", - "source_location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 4040, - "column": 1, - "source_line": "static void stbte__set_event(int event, int x, int y)" - }, - "start": { - "filename": "stb/stb_tilemap_editor.h", - "line": 4040, - "column": 1, - "source_line": "static void stbte__set_event(int event, int x, int y)" + "initializer": { + "source_text": "{\n {\n { { STBTE__idle , STBTE__over }, { STBTE__down , STBTE__over_down }, },\n { { STBTE__selected, STBTE__selected_over }, { STBTE__down , STBTE__over_down }, },\n },{\n { { STBTE__disabled, STBTE__disabled }, { STBTE__disabled, STBTE__disabled }, },\n { { STBTE__selected, STBTE__selected_over }, { STBTE__disabled, STBTE__disabled }, },\n }\n}" }, - "end": { + "bit_width": null, + "source_location": { "filename": "stb/stb_tilemap_editor.h", - "line": 4051, + "line": 731, "column": 1, - "source_line": "}" + "source_line": "static unsigned char stbte__state_to_index[2][2][2][2] =" }, + "callback_policy": null, "declaration_locations": [] - } - }, - "structs": { - "stbte_tilemap": { - "reference": "struct stbte_tilemap" - } - }, - "unions": {}, - "enums": { - "stbte_action": { - "reference": "enum stbte_action" - } - }, - "typedefs": { - "stbte_tilemap": { - "reference": "stbte_tilemap" - }, - "stbte__link": { - "reference": "stbte__link" - }, - "stbte__tileinfo": { - "reference": "stbte__tileinfo" - }, - "stbte__tiledata": { - "reference": "stbte__tiledata" - }, - "stbte__panel": { - "reference": "stbte__panel" - }, - "stbte__colorrect": { - "reference": "stbte__colorrect" - }, - "stbte__ui_t": { - "reference": "stbte__ui_t" - }, - "stbte__layer": { - "reference": "stbte__layer" }, - "stbte__region_t": { - "reference": "stbte__region_t" - } - }, - "variables": { "stbte__font_offset": { "name": "stbte__font_offset", "type": { @@ -32699,6 +33054,105 @@ "callback_policy": null, "declaration_locations": [] }, + "stbte__fontdata": { + "name": "stbte__fontdata", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static short stbte__fontdata[769]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "769", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CShort", + "qualifiers": [], + "source_text": "short" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 4,9,6,9,9,9,9,8,9,8,4,9,7,7,7,7,4,2,6,8,6,6,7,3,4,4,8,6,3,6,2,6,6,6,6,6,6,\n 6,6,6,6,6,2,3,5,4,5,6,6,6,6,6,6,6,6,6,6,6,6,7,6,7,7,7,6,7,6,6,6,6,7,7,6,6,\n 6,4,6,4,7,7,3,6,6,5,6,6,5,6,6,4,5,6,4,7,6,6,6,6,6,6,6,6,6,7,6,6,6,5,2,5,8,\n 0,0,0,0,2,253,130,456,156,8,72,184,64,2,125,66,64,160,64,146,511,146,146,\n 511,146,146,511,146,511,257,341,297,341,297,341,257,511,16,56,124,16,16,16,\n 124,56,16,96,144,270,261,262,136,80,48,224,192,160,80,40,22,14,15,3,448,496,\n 496,240,232,20,10,5,2,112,232,452,450,225,113,58,28,63,30,60,200,455,257,\n 257,0,0,0,257,257,455,120,204,132,132,159,14,4,4,14,159,132,132,204,120,8,\n 24,56,120,56,24,8,32,48,56,60,56,48,32,0,0,0,0,111,111,7,7,0,0,7,7,34,127,\n 127,34,34,127,127,34,36,46,107,107,58,18,99,51,24,12,102,99,48,122,79,93,\n 55,114,80,4,7,3,62,127,99,65,65,99,127,62,8,42,62,28,28,62,42,8,8,8,62,62,\n 8,8,128,224,96,8,8,8,8,8,8,96,96,96,48,24,12,6,3,62,127,89,77,127,62,64,66,\n 127,127,64,64,98,115,89,77,71,66,33,97,73,93,119,35,24,28,22,127,127,16,39,\n 103,69,69,125,57,62,127,73,73,121,48,1,1,113,121,15,7,54,127,73,73,127,54,\n 6,79,73,105,63,30,54,54,128,246,118,8,28,54,99,65,20,20,20,20,65,99,54,28,\n 8,2,3,105,109,7,2,30,63,33,45,47,46,124,126,19,19,126,124,127,127,73,73,127,\n 54,62,127,65,65,99,34,127,127,65,99,62,28,127,127,73,73,73,65,127,127,9,9,\n 9,1,62,127,65,73,121,121,127,127,8,8,127,127,65,65,127,127,65,65,32,96,64,\n 64,127,63,127,127,8,28,54,99,65,127,127,64,64,64,64,127,127,6,12,6,127,127,\n 127,127,6,12,24,127,127,62,127,65,65,65,127,62,127,127,9,9,15,6,62,127,65,\n 81,49,127,94,127,127,9,25,127,102,70,79,73,73,121,49,1,1,127,127,1,1,63,127,\n 64,64,127,63,15,31,48,96,48,31,15,127,127,48,24,48,127,127,99,119,28,28,119,\n 99,7,15,120,120,15,7,97,113,89,77,71,67,127,127,65,65,3,6,12,24,48,96,65,\n 65,127,127,8,12,6,3,6,12,8,64,64,64,64,64,64,64,3,7,4,32,116,84,84,124,120,\n 127,127,68,68,124,56,56,124,68,68,68,56,124,68,68,127,127,56,124,84,84,92,\n 24,8,124,126,10,10,56,380,324,324,508,252,127,127,4,4,124,120,72,122,122,\n 64,256,256,256,506,250,126,126,16,56,104,64,66,126,126,64,124,124,24,56,28,\n 124,120,124,124,4,4,124,120,56,124,68,68,124,56,508,508,68,68,124,56,56,124,\n 68,68,508,508,124,124,4,4,12,8,72,92,84,84,116,36,4,4,62,126,68,68,60,124,\n 64,64,124,124,28,60,96,96,60,28,28,124,112,56,112,124,28,68,108,56,56,108,\n 68,284,316,352,320,508,252,68,100,116,92,76,68,8,62,119,65,65,127,127,65,\n 65,119,62,8,16,24,12,12,24,24,12,4,\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 746, + "column": 1, + "source_line": "static short stbte__fontdata[769] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "toolchar": { + "name": "toolchar", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static int toolchar[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CInt", + "qualifiers": [], + "source_text": "int" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 26,24,25,20,23,22,18, 19,17, 29,28, }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 838, + "column": 1, + "source_line": "static int toolchar[] = { 26,24,25,20,23,22,18, 19,17, 29,28, };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbte__ui": { + "name": "stbte__ui", + "type": { + "reference": "stbte__ui_t" + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ STBTE__tool_brush, 0 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_tilemap_editor.h", + "line": 919, + "column": 1, + "source_line": "static stbte__ui_t stbte__ui = { STBTE__tool_brush, 0 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, "default_category": { "name": "default_category", "type": { @@ -35305,84 +35759,6 @@ }, "unit_kind": "macro", "unit_name": "STBTE__TEXTCOLOR" - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 641, - "column": 1, - "source_line": "static char *stbte__color_names[] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 651, - "column": 1, - "source_line": "static int stbte__color_table[STBTE__num_color_modes][STBTE__num_color_aspects][STBTE__num_color_states] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 731, - "column": 1, - "source_line": "static unsigned char stbte__state_to_index[2][2][2][2] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 746, - "column": 1, - "source_line": "static short stbte__fontdata[769] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 838, - "column": 1, - "source_line": "static int toolchar[] = { 26,24,25,20,23,22,18, 19,17, 29,28, };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_tilemap_editor.h", - "line": 919, - "column": 1, - "source_line": "static stbte__ui_t stbte__ui = { STBTE__tool_brush, 0 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null } ] } diff --git a/tests/parser/c/fixtures/stb/stb_vorbis.json b/tests/parser/c/fixtures/stb/stb_vorbis.json index d8950af19..d21dacff5 100644 --- a/tests/parser/c/fixtures/stb/stb_vorbis.json +++ b/tests/parser/c/fixtures/stb/stb_vorbis.json @@ -17471,6 +17471,82 @@ "callback_policy": null, "declaration_locations": [] }, + { + "name": "ogg_page_header", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static uint8 ogg_page_header[4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "uint8" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0x4f, 0x67, 0x67, 0x53 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_vorbis.c", + "line": 1429, + "column": 1, + "source_line": "static uint8 ogg_page_header[4] = { 0x4f, 0x67, 0x67, 0x53 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + { + "name": "inverse_db_table", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float inverse_db_table[256]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "256", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1.0649863e-07f, 1.1341951e-07f, 1.2079015e-07f, 1.2863978e-07f,\n 1.3699951e-07f, 1.4590251e-07f, 1.5538408e-07f, 1.6548181e-07f,\n 1.7623575e-07f, 1.8768855e-07f, 1.9988561e-07f, 2.1287530e-07f,\n 2.2670913e-07f, 2.4144197e-07f, 2.5713223e-07f, 2.7384213e-07f,\n 2.9163793e-07f, 3.1059021e-07f, 3.3077411e-07f, 3.5226968e-07f,\n 3.7516214e-07f, 3.9954229e-07f, 4.2550680e-07f, 4.5315863e-07f,\n 4.8260743e-07f, 5.1396998e-07f, 5.4737065e-07f, 5.8294187e-07f,\n 6.2082472e-07f, 6.6116941e-07f, 7.0413592e-07f, 7.4989464e-07f,\n 7.9862701e-07f, 8.5052630e-07f, 9.0579828e-07f, 9.6466216e-07f,\n 1.0273513e-06f, 1.0941144e-06f, 1.1652161e-06f, 1.2409384e-06f,\n 1.3215816e-06f, 1.4074654e-06f, 1.4989305e-06f, 1.5963394e-06f,\n 1.7000785e-06f, 1.8105592e-06f, 1.9282195e-06f, 2.0535261e-06f,\n 2.1869758e-06f, 2.3290978e-06f, 2.4804557e-06f, 2.6416497e-06f,\n 2.8133190e-06f, 2.9961443e-06f, 3.1908506e-06f, 3.3982101e-06f,\n 3.6190449e-06f, 3.8542308e-06f, 4.1047004e-06f, 4.3714470e-06f,\n 4.6555282e-06f, 4.9580707e-06f, 5.2802740e-06f, 5.6234160e-06f,\n 5.9888572e-06f, 6.3780469e-06f, 6.7925283e-06f, 7.2339451e-06f,\n 7.7040476e-06f, 8.2047000e-06f, 8.7378876e-06f, 9.3057248e-06f,\n 9.9104632e-06f, 1.0554501e-05f, 1.1240392e-05f, 1.1970856e-05f,\n 1.2748789e-05f, 1.3577278e-05f, 1.4459606e-05f, 1.5399272e-05f,\n 1.6400004e-05f, 1.7465768e-05f, 1.8600792e-05f, 1.9809576e-05f,\n 2.1096914e-05f, 2.2467911e-05f, 2.3928002e-05f, 2.5482978e-05f,\n 2.7139006e-05f, 2.8902651e-05f, 3.0780908e-05f, 3.2781225e-05f,\n 3.4911534e-05f, 3.7180282e-05f, 3.9596466e-05f, 4.2169667e-05f,\n 4.4910090e-05f, 4.7828601e-05f, 5.0936773e-05f, 5.4246931e-05f,\n 5.7772202e-05f, 6.1526565e-05f, 6.5524908e-05f, 6.9783085e-05f,\n 7.4317983e-05f, 7.9147585e-05f, 8.4291040e-05f, 8.9768747e-05f,\n 9.5602426e-05f, 0.00010181521f, 0.00010843174f, 0.00011547824f,\n 0.00012298267f, 0.00013097477f, 0.00013948625f, 0.00014855085f,\n 0.00015820453f, 0.00016848555f, 0.00017943469f, 0.00019109536f,\n 0.00020351382f, 0.00021673929f, 0.00023082423f, 0.00024582449f,\n 0.00026179955f, 0.00027881276f, 0.00029693158f, 0.00031622787f,\n 0.00033677814f, 0.00035866388f, 0.00038197188f, 0.00040679456f,\n 0.00043323036f, 0.00046138411f, 0.00049136745f, 0.00052329927f,\n 0.00055730621f, 0.00059352311f, 0.00063209358f, 0.00067317058f,\n 0.00071691700f, 0.00076350630f, 0.00081312324f, 0.00086596457f,\n 0.00092223983f, 0.00098217216f, 0.0010459992f, 0.0011139742f,\n 0.0011863665f, 0.0012634633f, 0.0013455702f, 0.0014330129f,\n 0.0015261382f, 0.0016253153f, 0.0017309374f, 0.0018434235f,\n 0.0019632195f, 0.0020908006f, 0.0022266726f, 0.0023713743f,\n 0.0025254795f, 0.0026895994f, 0.0028643847f, 0.0030505286f,\n 0.0032487691f, 0.0034598925f, 0.0036847358f, 0.0039241906f,\n 0.0041792066f, 0.0044507950f, 0.0047400328f, 0.0050480668f,\n 0.0053761186f, 0.0057254891f, 0.0060975636f, 0.0064938176f,\n 0.0069158225f, 0.0073652516f, 0.0078438871f, 0.0083536271f,\n 0.0088964928f, 0.009474637f, 0.010090352f, 0.010746080f,\n 0.011444421f, 0.012188144f, 0.012980198f, 0.013823725f,\n 0.014722068f, 0.015678791f, 0.016697687f, 0.017782797f,\n 0.018938423f, 0.020169149f, 0.021479854f, 0.022875735f,\n 0.024362330f, 0.025945531f, 0.027631618f, 0.029427276f,\n 0.031339626f, 0.033376252f, 0.035545228f, 0.037855157f,\n 0.040315199f, 0.042935108f, 0.045725273f, 0.048696758f,\n 0.051861348f, 0.055231591f, 0.058820850f, 0.062643361f,\n 0.066714279f, 0.071049749f, 0.075666962f, 0.080584227f,\n 0.085821044f, 0.091398179f, 0.097337747f, 0.10366330f,\n 0.11039993f, 0.11757434f, 0.12521498f, 0.13335215f,\n 0.14201813f, 0.15124727f, 0.16107617f, 0.17154380f,\n 0.18269168f, 0.19456402f, 0.20720788f, 0.22067342f,\n 0.23501402f, 0.25028656f, 0.26655159f, 0.28387361f,\n 0.30232132f, 0.32196786f, 0.34289114f, 0.36517414f,\n 0.38890521f, 0.41417847f, 0.44109412f, 0.46975890f,\n 0.50028648f, 0.53279791f, 0.56742212f, 0.60429640f,\n 0.64356699f, 0.68538959f, 0.72993007f, 0.77736504f,\n 0.82788260f, 0.88168307f, 0.9389798f, 1.0f\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_vorbis.c", + "line": 1946, + "column": 1, + "source_line": "static float inverse_db_table[256] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, { "name": "integer_divide_table", "type": { @@ -17546,6 +17622,52 @@ }, "callback_policy": null, "declaration_locations": [] + }, + { + "name": "channel_position", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static int8 channel_position[7][6]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "7", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "int8" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0 },\n { C },\n { L, R },\n { L, C, R },\n { L, R, L, R },\n { L, C, R, L, R },\n { L, C, R, L, R, C },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_vorbis.c", + "line": 5135, + "column": 1, + "source_line": "static int8 channel_position[7][6] =" + }, + "callback_policy": null, + "declaration_locations": [] } ], "macros": [ @@ -21547,19 +21669,6 @@ "unit_kind": "declarator", "unit_name": null }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_vorbis.c", - "line": 1429, - "column": 1, - "source_line": "static uint8 ogg_page_header[4] = { 0x4f, 0x67, 0x67, 0x53 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro '__forceinline'; provide preprocessed input to parse it.", @@ -21573,19 +21682,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "__forceinline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_vorbis.c", - "line": 1946, - "column": 1, - "source_line": "static float inverse_db_table[256] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro '__forceinline'; provide preprocessed input to parse it.", @@ -21612,19 +21708,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "__forceinline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_vorbis.c", - "line": 5135, - "column": 1, - "source_line": "static int8 channel_position[7][6] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_CONFLICTING_TYPEDEF", "message": "Conflicting typedef declarations for 'YTYPE'.", @@ -34806,6 +34889,82 @@ "callback_policy": null, "declaration_locations": [] }, + "ogg_page_header": { + "name": "ogg_page_header", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static uint8 ogg_page_header[4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "uint8" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0x4f, 0x67, 0x67, 0x53 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_vorbis.c", + "line": 1429, + "column": 1, + "source_line": "static uint8 ogg_page_header[4] = { 0x4f, 0x67, 0x67, 0x53 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "inverse_db_table": { + "name": "inverse_db_table", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float inverse_db_table[256]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "256", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n 1.0649863e-07f, 1.1341951e-07f, 1.2079015e-07f, 1.2863978e-07f,\n 1.3699951e-07f, 1.4590251e-07f, 1.5538408e-07f, 1.6548181e-07f,\n 1.7623575e-07f, 1.8768855e-07f, 1.9988561e-07f, 2.1287530e-07f,\n 2.2670913e-07f, 2.4144197e-07f, 2.5713223e-07f, 2.7384213e-07f,\n 2.9163793e-07f, 3.1059021e-07f, 3.3077411e-07f, 3.5226968e-07f,\n 3.7516214e-07f, 3.9954229e-07f, 4.2550680e-07f, 4.5315863e-07f,\n 4.8260743e-07f, 5.1396998e-07f, 5.4737065e-07f, 5.8294187e-07f,\n 6.2082472e-07f, 6.6116941e-07f, 7.0413592e-07f, 7.4989464e-07f,\n 7.9862701e-07f, 8.5052630e-07f, 9.0579828e-07f, 9.6466216e-07f,\n 1.0273513e-06f, 1.0941144e-06f, 1.1652161e-06f, 1.2409384e-06f,\n 1.3215816e-06f, 1.4074654e-06f, 1.4989305e-06f, 1.5963394e-06f,\n 1.7000785e-06f, 1.8105592e-06f, 1.9282195e-06f, 2.0535261e-06f,\n 2.1869758e-06f, 2.3290978e-06f, 2.4804557e-06f, 2.6416497e-06f,\n 2.8133190e-06f, 2.9961443e-06f, 3.1908506e-06f, 3.3982101e-06f,\n 3.6190449e-06f, 3.8542308e-06f, 4.1047004e-06f, 4.3714470e-06f,\n 4.6555282e-06f, 4.9580707e-06f, 5.2802740e-06f, 5.6234160e-06f,\n 5.9888572e-06f, 6.3780469e-06f, 6.7925283e-06f, 7.2339451e-06f,\n 7.7040476e-06f, 8.2047000e-06f, 8.7378876e-06f, 9.3057248e-06f,\n 9.9104632e-06f, 1.0554501e-05f, 1.1240392e-05f, 1.1970856e-05f,\n 1.2748789e-05f, 1.3577278e-05f, 1.4459606e-05f, 1.5399272e-05f,\n 1.6400004e-05f, 1.7465768e-05f, 1.8600792e-05f, 1.9809576e-05f,\n 2.1096914e-05f, 2.2467911e-05f, 2.3928002e-05f, 2.5482978e-05f,\n 2.7139006e-05f, 2.8902651e-05f, 3.0780908e-05f, 3.2781225e-05f,\n 3.4911534e-05f, 3.7180282e-05f, 3.9596466e-05f, 4.2169667e-05f,\n 4.4910090e-05f, 4.7828601e-05f, 5.0936773e-05f, 5.4246931e-05f,\n 5.7772202e-05f, 6.1526565e-05f, 6.5524908e-05f, 6.9783085e-05f,\n 7.4317983e-05f, 7.9147585e-05f, 8.4291040e-05f, 8.9768747e-05f,\n 9.5602426e-05f, 0.00010181521f, 0.00010843174f, 0.00011547824f,\n 0.00012298267f, 0.00013097477f, 0.00013948625f, 0.00014855085f,\n 0.00015820453f, 0.00016848555f, 0.00017943469f, 0.00019109536f,\n 0.00020351382f, 0.00021673929f, 0.00023082423f, 0.00024582449f,\n 0.00026179955f, 0.00027881276f, 0.00029693158f, 0.00031622787f,\n 0.00033677814f, 0.00035866388f, 0.00038197188f, 0.00040679456f,\n 0.00043323036f, 0.00046138411f, 0.00049136745f, 0.00052329927f,\n 0.00055730621f, 0.00059352311f, 0.00063209358f, 0.00067317058f,\n 0.00071691700f, 0.00076350630f, 0.00081312324f, 0.00086596457f,\n 0.00092223983f, 0.00098217216f, 0.0010459992f, 0.0011139742f,\n 0.0011863665f, 0.0012634633f, 0.0013455702f, 0.0014330129f,\n 0.0015261382f, 0.0016253153f, 0.0017309374f, 0.0018434235f,\n 0.0019632195f, 0.0020908006f, 0.0022266726f, 0.0023713743f,\n 0.0025254795f, 0.0026895994f, 0.0028643847f, 0.0030505286f,\n 0.0032487691f, 0.0034598925f, 0.0036847358f, 0.0039241906f,\n 0.0041792066f, 0.0044507950f, 0.0047400328f, 0.0050480668f,\n 0.0053761186f, 0.0057254891f, 0.0060975636f, 0.0064938176f,\n 0.0069158225f, 0.0073652516f, 0.0078438871f, 0.0083536271f,\n 0.0088964928f, 0.009474637f, 0.010090352f, 0.010746080f,\n 0.011444421f, 0.012188144f, 0.012980198f, 0.013823725f,\n 0.014722068f, 0.015678791f, 0.016697687f, 0.017782797f,\n 0.018938423f, 0.020169149f, 0.021479854f, 0.022875735f,\n 0.024362330f, 0.025945531f, 0.027631618f, 0.029427276f,\n 0.031339626f, 0.033376252f, 0.035545228f, 0.037855157f,\n 0.040315199f, 0.042935108f, 0.045725273f, 0.048696758f,\n 0.051861348f, 0.055231591f, 0.058820850f, 0.062643361f,\n 0.066714279f, 0.071049749f, 0.075666962f, 0.080584227f,\n 0.085821044f, 0.091398179f, 0.097337747f, 0.10366330f,\n 0.11039993f, 0.11757434f, 0.12521498f, 0.13335215f,\n 0.14201813f, 0.15124727f, 0.16107617f, 0.17154380f,\n 0.18269168f, 0.19456402f, 0.20720788f, 0.22067342f,\n 0.23501402f, 0.25028656f, 0.26655159f, 0.28387361f,\n 0.30232132f, 0.32196786f, 0.34289114f, 0.36517414f,\n 0.38890521f, 0.41417847f, 0.44109412f, 0.46975890f,\n 0.50028648f, 0.53279791f, 0.56742212f, 0.60429640f,\n 0.64356699f, 0.68538959f, 0.72993007f, 0.77736504f,\n 0.82788260f, 0.88168307f, 0.9389798f, 1.0f\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_vorbis.c", + "line": 1946, + "column": 1, + "source_line": "static float inverse_db_table[256] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, "integer_divide_table": { "name": "integer_divide_table", "type": { @@ -34881,6 +35040,52 @@ }, "callback_policy": null, "declaration_locations": [] + }, + "channel_position": { + "name": "channel_position", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static int8 channel_position[7][6]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "7", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "int8" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0 },\n { C },\n { L, R },\n { L, C, R },\n { L, R, L, R },\n { L, C, R, L, R },\n { L, C, R, L, R, C },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_vorbis.c", + "line": 5135, + "column": 1, + "source_line": "static int8 channel_position[7][6] =" + }, + "callback_policy": null, + "declaration_locations": [] } }, "macros": { @@ -36416,19 +36621,6 @@ "unit_kind": "declarator", "unit_name": null }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_vorbis.c", - "line": 1429, - "column": 1, - "source_line": "static uint8 ogg_page_header[4] = { 0x4f, 0x67, 0x67, 0x53 };" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro '__forceinline'; provide preprocessed input to parse it.", @@ -36442,19 +36634,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "__forceinline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_vorbis.c", - "line": 1946, - "column": 1, - "source_line": "static float inverse_db_table[256] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_MACRO_DEPENDENT_DECLARATION", "message": "Declaration depends on object-like macro '__forceinline'; provide preprocessed input to parse it.", @@ -36481,19 +36660,6 @@ "unit_kind": "macro_dependent_declaration", "unit_name": "__forceinline" }, - { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_vorbis.c", - "line": 5135, - "column": 1, - "source_line": "static int8 channel_position[7][6] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, { "code": "C_CONFLICTING_TYPEDEF", "message": "Conflicting typedef declarations for 'YTYPE'.", diff --git a/tests/parser/c/fixtures/stb/stb_voxel_render.json b/tests/parser/c/fixtures/stb/stb_voxel_render.json index f3a91dab2..f9c3e8b84 100644 --- a/tests/parser/c/fixtures/stb/stb_voxel_render.json +++ b/tests/parser/c/fixtures/stb/stb_voxel_render.json @@ -6683,17 +6683,17 @@ ], "variables": [ { - "name": "stbvox_default_palette", + "name": "stbvox_default_texgen", "type": { "model": "CComposedType", "qualifiers": [], - "source_text": "static float stbvox_default_palette[64][4]", + "source_text": "static float stbvox_default_texgen[2][32][3]", "components": [ { "model": "CArray", "qualifiers": [], "source_text": "", - "bound": "64", + "bound": "2", "is_static_minimum": false, "is_variable_length": false, "is_flexible": false @@ -6702,7 +6702,16 @@ "model": "CArray", "qualifiers": [], "source_text": "", - "bound": "4", + "bound": "32", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", "is_static_minimum": false, "is_variable_length": false, "is_flexible": false @@ -6717,29 +6726,31 @@ "storage": [ "static" ], - "initializer": null, + "initializer": { + "source_text": "{\n { { 0, 1,0 }, { 0, 0, 1 }, { 0,-1,0 }, { 0, 0,-1 },\n { -1, 0,0 }, { 0, 0, 1 }, { 1, 0,0 }, { 0, 0,-1 },\n { 0,-1,0 }, { 0, 0, 1 }, { 0, 1,0 }, { 0, 0,-1 },\n { 1, 0,0 }, { 0, 0, 1 }, { -1, 0,0 }, { 0, 0,-1 },\n\n { 1, 0,0 }, { 0, 1, 0 }, { -1, 0,0 }, { 0,-1, 0 },\n { -1, 0,0 }, { 0,-1, 0 }, { 1, 0,0 }, { 0, 1, 0 },\n { 1, 0,0 }, { 0, 1, 0 }, { -1, 0,0 }, { 0,-1, 0 },\n { -1, 0,0 }, { 0,-1, 0 }, { 1, 0,0 }, { 0, 1, 0 },\n },\n { { 0, 0,-1 }, { 0, 1,0 }, { 0, 0, 1 }, { 0,-1,0 },\n { 0, 0,-1 }, { -1, 0,0 }, { 0, 0, 1 }, { 1, 0,0 },\n { 0, 0,-1 }, { 0,-1,0 }, { 0, 0, 1 }, { 0, 1,0 },\n { 0, 0,-1 }, { 1, 0,0 }, { 0, 0, 1 }, { -1, 0,0 },\n\n { 0,-1, 0 }, { 1, 0,0 }, { 0, 1, 0 }, { -1, 0,0 },\n { 0, 1, 0 }, { -1, 0,0 }, { 0,-1, 0 }, { 1, 0,0 },\n { 0,-1, 0 }, { 1, 0,0 }, { 0, 1, 0 }, { -1, 0,0 },\n { 0, 1, 0 }, { -1, 0,0 }, { 0,-1, 0 }, { 1, 0,0 },\n },\n}" + }, "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1542, + "line": 1428, "column": 1, - "source_line": "static float stbvox_default_palette[64][4];" + "source_line": "static float stbvox_default_texgen[2][32][3] =" }, "callback_policy": null, "declaration_locations": [] }, { - "name": "stbvox_dummy_transform", + "name": "stbvox_default_normals", "type": { "model": "CComposedType", "qualifiers": [], - "source_text": "static float stbvox_dummy_transform[3][3]", + "source_text": "static float stbvox_default_normals[32][3]", "components": [ { "model": "CArray", "qualifiers": [], "source_text": "", - "bound": "3", + "bound": "32", "is_static_minimum": false, "is_variable_length": false, "is_flexible": false @@ -6763,1260 +6774,2544 @@ "storage": [ "static" ], - "initializer": null, + "initializer": { + "source_text": "{\n { 1,0,0 }, \n { 0,1,0 }, \n { -1,0,0 }, \n { 0,-1,0 }, \n { 0,0,1 }, \n { 0,0,-1 }, \n { STBVOX_RSQRT2,0, STBVOX_RSQRT2 }, \n { STBVOX_RSQRT2,0, -STBVOX_RSQRT2 }, \n\n { STBVOX_RSQRT2,0, STBVOX_RSQRT2 }, \n { 0, STBVOX_RSQRT2, STBVOX_RSQRT2 }, \n { -STBVOX_RSQRT2,0, STBVOX_RSQRT2 }, \n { 0,-STBVOX_RSQRT2, STBVOX_RSQRT2 }, \n { STBVOX_RSQRT3, STBVOX_RSQRT3, STBVOX_RSQRT3 }, \n { STBVOX_RSQRT3, STBVOX_RSQRT3,-STBVOX_RSQRT3 }, \n { 0, STBVOX_RSQRT2, STBVOX_RSQRT2 }, \n { 0, STBVOX_RSQRT2, -STBVOX_RSQRT2 }, \n\n { STBVOX_RSQRT2,0, -STBVOX_RSQRT2 }, \n { 0, STBVOX_RSQRT2, -STBVOX_RSQRT2 }, \n { -STBVOX_RSQRT2,0, -STBVOX_RSQRT2 }, \n { 0,-STBVOX_RSQRT2, -STBVOX_RSQRT2 }, \n { -STBVOX_RSQRT3, STBVOX_RSQRT3, STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT3, STBVOX_RSQRT3,-STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT2,0, STBVOX_RSQRT2 }, \n { -STBVOX_RSQRT2,0, -STBVOX_RSQRT2 }, \n\n { STBVOX_RSQRT3, STBVOX_RSQRT3,STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT3, STBVOX_RSQRT3,STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT3,-STBVOX_RSQRT3,STBVOX_RSQRT3 }, \n { STBVOX_RSQRT3,-STBVOX_RSQRT3,STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT3,-STBVOX_RSQRT3, STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT3,-STBVOX_RSQRT3,-STBVOX_RSQRT3 }, \n { 0,-STBVOX_RSQRT2, STBVOX_RSQRT2 }, \n { 0,-STBVOX_RSQRT2, -STBVOX_RSQRT2 }, \n}" + }, "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1985, + "line": 1455, "column": 1, - "source_line": "static float stbvox_dummy_transform[3][3];" + "source_line": "static float stbvox_default_normals[32][3] =" }, "callback_policy": null, "declaration_locations": [] - } - ], - "macros": [ + }, { - "name": "INCLUDE_STB_VOXEL_RENDER_H", - "value": null, - "function_like": false, - "directive": "define", + "name": "stbvox_default_texscale", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float stbvox_default_texscale[128][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "128", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 229, + "line": 1494, "column": 1, - "source_line": "#define INCLUDE_STB_VOXEL_RENDER_H" - } + "source_line": "static float stbvox_default_texscale[128][4] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVXDEC", - "value": "static", - "function_like": false, - "directive": "define", + "name": "stbvox_default_palette_compact", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_default_palette_compact[64][3]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "64", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 255,255,255 }, { 238,238,238 }, { 221,221,221 }, { 204,204,204 },\n { 187,187,187 }, { 170,170,170 }, { 153,153,153 }, { 136,136,136 },\n { 119,119,119 }, { 102,102,102 }, { 85, 85, 85 }, { 68, 68, 68 },\n { 51, 51, 51 }, { 34, 34, 34 }, { 17, 17, 17 }, { 0, 0, 0 },\n { 255,240,240 }, { 255,220,220 }, { 255,160,160 }, { 255, 32, 32 },\n { 200,120,160 }, { 200, 60,150 }, { 220,100,130 }, { 255, 0,128 },\n { 240,240,255 }, { 220,220,255 }, { 160,160,255 }, { 32, 32,255 },\n { 120,160,200 }, { 60,150,200 }, { 100,130,220 }, { 0,128,255 },\n { 240,255,240 }, { 220,255,220 }, { 160,255,160 }, { 32,255, 32 },\n { 160,200,120 }, { 150,200, 60 }, { 130,220,100 }, { 128,255, 0 },\n { 255,255,240 }, { 255,255,220 }, { 220,220,180 }, { 255,255, 32 },\n { 200,160,120 }, { 200,150, 60 }, { 220,130,100 }, { 255,128, 0 },\n { 255,240,255 }, { 255,220,255 }, { 220,180,220 }, { 255, 32,255 },\n { 160,120,200 }, { 150, 60,200 }, { 130,100,220 }, { 128, 0,255 },\n { 240,255,255 }, { 220,255,255 }, { 180,220,220 }, { 32,255,255 },\n { 120,200,160 }, { 60,200,150 }, { 100,220,130 }, { 0,255,128 },\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 237, + "line": 1514, "column": 1, - "source_line": "#define STBVXDEC static" - } + "source_line": "static unsigned char stbvox_default_palette_compact[64][3] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVXDEC", - "value": "extern", - "function_like": false, - "directive": "define", + "name": "stbvox_default_ambient", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float stbvox_default_ambient[4][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0,0,1 ,0 }, \n { 0.5,0.5,0.5,0 }, \n { 0.5,0.5,0.5,0 }, \n { 0.5,0.5,0.5,1.0f/1000.0f/1000.0f }, \n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 239, + "line": 1534, "column": 1, - "source_line": "#define STBVXDEC extern" - } + "source_line": "static float stbvox_default_ambient[4][4] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_COLOR_TEX1_ENABLE", - "value": "64", - "function_like": false, - "directive": "define", + "name": "stbvox_default_palette", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float stbvox_default_palette[64][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "64", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": null, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 716, + "line": 1542, "column": 1, - "source_line": "#define STBVOX_COLOR_TEX1_ENABLE 64" - } + "source_line": "static float stbvox_default_palette[64][4];" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_COLOR_TEX2_ENABLE", - "value": "128", - "function_like": false, - "directive": "define", + "name": "stbvox_vertex_program", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const char *stbvox_vertex_program", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CChar", + "qualifiers": [ + "const" + ], + "source_text": "const char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBVOX_SHADER_VERSION\n\n \n \"in uvec4 attr_face;\\n\"\n \n \"uniform usamplerBuffer facearray;\\n\"\n \n\n \n \"uniform usamplerBuffer facearray2;\\n\"\n \n\n \n \"in uint attr_vertex;\\n\"\n\n \n \"uniform vec3 transform[3];\\n\"\n\n \n \"uniform vec4 camera_pos;\\n\" \n\n \n \n \n \"uniform vec3 normal_table[32];\\n\"\n\n \n \"uniform mat4x4 model_view;\\n\"\n \n\n \n \"flat out uvec4 facedata;\\n\"\n \" out vec3 voxelspace_pos;\\n\"\n \" out vec3 vnormal;\\n\"\n \" out float texlerp;\\n\"\n \" out float amb_occ;\\n\"\n\n \n \"void main()\\n\"\n \"{\\n\"\n \n \" facedata = attr_face;\\n\"\n \n \" int faceID = gl_VertexID >> 2;\\n\"\n \" facedata = texelFetch(facearray, faceID);\\n\"\n \n\n \n \" vec3 offset;\\n\"\n \" offset.x = float( (attr_vertex ) & 127u );\\n\" \n \" offset.y = float( (attr_vertex >> 7u) & 127u );\\n\" \n \" offset.z = float( (attr_vertex >> 14u) & 511u );\\n\" \n \" amb_occ = float( (attr_vertex >> 23u) & 63u ) / 63.0;\\n\" \n \" texlerp = float( (attr_vertex >> 29u) ) / 7.0;\\n\" \n\n \" vnormal = normal_table[(facedata.w>>2u) & 31u];\\n\"\n \" voxelspace_pos = offset * transform[0];\\n\" \n \" vec3 position = voxelspace_pos + transform[1];\\n\" \n\n \n \" if ((facedata.w & 28u) == 16u || (facedata.w & 28u) == 24u)\\n\"\n \" position += vnormal.xyz * camera_pos.w;\\n\"\n \n\n \n \" gl_Position = model_view * vec4(position,1.0);\\n\"\n \n \" gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);\\n\"\n \n\n \"}\\n\"\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 717, + "line": 1570, "column": 1, - "source_line": "#define STBVOX_COLOR_TEX2_ENABLE 128" - } + "source_line": "static const char *stbvox_vertex_program =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_FACE_NONE", - "value": "7", - "function_like": false, - "directive": "define", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1145, + "name": "stbvox_fragment_program", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const char *stbvox_fragment_program", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CChar", + "qualifiers": [ + "const" + ], + "source_text": "const char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBVOX_SHADER_VERSION\n\n \n \n \"#define rlerp(t,x,y) mix(x,y,t)\\n\"\n \n \"#define rlerp(t,x,y) lerp(x,y,t)\\n\"\n \n \n \n\n\n \n \"flat in uvec4 facedata;\\n\"\n \" in vec3 voxelspace_pos;\\n\"\n \" in vec3 vnormal;\\n\"\n \" in float texlerp;\\n\"\n \" in float amb_occ;\\n\"\n\n \n \"uniform vec3 transform[3];\\n\"\n\n \n \"uniform vec4 camera_pos;\\n\" \n\n \n \"uniform vec4 ambient[4];\\n\"\n\n \n \n \"uniform sampler2DArray tex_array[2];\\n\"\n\n \n \"uniform samplerBuffer color_table;\\n\"\n \"uniform samplerBuffer texscale;\\n\"\n \"uniform samplerBuffer texgen;\\n\"\n \n \"uniform vec4 color_table[64];\\n\"\n \"uniform vec4 texscale[64];\\n\" \n \"uniform vec3 texgen[64];\\n\"\n \n \n\n \"out vec4 outcolor;\\n\"\n\n \n \"vec3 compute_lighting(vec3 pos, vec3 norm, vec3 albedo, vec3 ambient);\\n\"\n \n \n \"vec3 compute_fog(vec3 color, vec3 relative_pos, float fragment_alpha);\\n\"\n \n\n \"void main()\\n\"\n \"{\\n\"\n \" vec3 albedo;\\n\"\n \" float fragment_alpha;\\n\"\n\n \n \n \" uint tex1_id = facedata.x;\\n\"\n \" uint tex2_id = facedata.y;\\n\"\n \" uint texprojid = facedata.w & 31u;\\n\"\n \" uint color_id = facedata.z;\\n\"\n\n \n \n \" vec3 texgen_s = texgen[texprojid];\\n\"\n \" vec3 texgen_t = texgen[texprojid+32u];\\n\"\n \" float tex1_scale = texscale[tex1_id & 63u].x;\\n\"\n \" vec4 color = color_table[color_id & 63u];\\n\"\n \n \" vec4 tex2_props = texscale[tex2_id & 63u];\\n\"\n \n \n \" vec3 texgen_s = texelFetch(texgen, int(texprojid)).xyz;\\n\"\n \" vec3 texgen_t = texelFetch(texgen, int(texprojid+32u)).xyz;\\n\"\n \" float tex1_scale = texelFetch(texscale, int(tex1_id & 127u)).x;\\n\"\n \" vec4 color = texelFetch(color_table, int(color_id & 63u));\\n\"\n \n \" vec4 tex2_props = texelFetch(texscale, int(tex1_id & 127u));\\n\"\n \n \n\n \n \" float tex2_scale = tex2_props.y;\\n\"\n \" bool texblend_mode = tex2_props.z != 0.0;\\n\"\n \n \" vec2 texcoord;\\n\"\n \" vec3 texturespace_pos = voxelspace_pos + transform[2].xyz;\\n\"\n \" texcoord.s = dot(texturespace_pos, texgen_s);\\n\"\n \" texcoord.t = dot(texturespace_pos, texgen_t);\\n\"\n\n \" vec2 texcoord_1 = tex1_scale * texcoord;\\n\"\n \n \" vec2 texcoord_2 = tex2_scale * texcoord;\\n\"\n \n\n \n \" texcoord_1 = texcoord_1 - floor(texcoord_1);\\n\"\n \" vec4 tex1 = textureGrad(tex_array[0], vec3(texcoord_1, float(tex1_id)), dFdx(tex1_scale*texcoord), dFdy(tex1_scale*texcoord));\\n\"\n \n \" vec4 tex1 = texture(tex_array[0], vec3(texcoord_1, float(tex1_id)));\\n\"\n \n\n \n \n \" texcoord_2 = texcoord_2 - floor(texcoord_2);\\n\"\n \" vec4 tex2 = textureGrad(tex_array[0], vec3(texcoord_2, float(tex2_id)), dFdx(tex2_scale*texcoord), dFdy(tex2_scale*texcoord));\\n\"\n \n \" vec4 tex2 = texture(tex_array[1], vec3(texcoord_2, float(tex2_id)));\\n\"\n \n \n\n \" bool emissive = (color.a > 1.0);\\n\"\n \" color.a = min(color.a, 1.0);\\n\"\n\n \n \" if ((color_id & 64u) != 0u) tex1.rgba *= color.rgba;\\n\"\n \" fragment_alpha = tex1.a;\\n\"\n \n \" if ((color_id & 128u) != 0u) tex2.rgba *= color.rgba;\\n\"\n\n \n \" tex2.rgba *= texlerp;\\n\"\n \n \" tex2.a *= texlerp;\\n\"\n \n\n \" if (texblend_mode)\\n\"\n \" albedo = tex1.xyz * rlerp(tex2.a, vec3(1.0,1.0,1.0), 2.0*tex2.xyz);\\n\"\n \" else {\\n\"\n \n \" albedo = (1.0-tex2.a)*tex1.xyz + tex2.xyz;\\n\"\n \n \" albedo = rlerp(tex2.a, tex1.xyz, tex2.xyz);\\n\"\n \n \" fragment_alpha = tex1.a*(1-tex2.a)+tex2.a;\\n\"\n \" }\\n\"\n \n \" albedo = tex1.xyz;\\n\"\n \n\n \n \" vec4 color;\"\n \" color.xyz = vec3(facedata.xyz) / 255.0;\\n\"\n \" bool emissive = false;\\n\"\n \" albedo = color.xyz;\\n\"\n \" fragment_alpha = 1.0;\\n\"\n \n\n \n \n \n \" vec3 normal = normalize(vnormal);\\n\"\n \n \" vec3 normal = vnormal;\\n\"\n \n\n \" vec3 ambient_color = dot(normal, ambient[0].xyz) * ambient[1].xyz + ambient[2].xyz;\\n\"\n\n \" ambient_color = clamp(ambient_color, 0.0, 1.0);\"\n \" ambient_color *= amb_occ;\\n\"\n\n \" vec3 lit_color;\\n\"\n \" if (!emissive)\\n\"\n \n \" lit_color = compute_lighting(voxelspace_pos + transform[1], normal, albedo, ambient_color);\\n\"\n \n \" lit_color = albedo * ambient_color ;\\n\"\n \n \" else\\n\"\n \" lit_color = albedo;\\n\"\n\n \n \" vec3 dist = voxelspace_pos + (transform[1] - camera_pos.xyz);\\n\"\n \" lit_color = compute_fog(lit_color, dist, fragment_alpha);\\n\"\n \n\n \n \" vec4 final_color = vec4(lit_color/fragment_alpha, fragment_alpha);\\n\"\n \n \" vec4 final_color = vec4(lit_color, fragment_alpha);\\n\"\n \n \" outcolor = final_color;\\n\"\n \"}\\n\"\n\n \n \"\\n\"\n \"uniform vec3 light_source[2];\\n\"\n \"vec3 compute_lighting(vec3 pos, vec3 norm, vec3 albedo, vec3 ambient)\\n\"\n \"{\\n\"\n \" vec3 light_dir = light_source[0] - pos;\\n\"\n \" float lambert = dot(light_dir, norm) / dot(light_dir, light_dir);\\n\"\n \" vec3 diffuse = clamp(light_source[1] * clamp(lambert, 0.0, 1.0), 0.0, 1.0);\\n\"\n \" return (diffuse + ambient) * albedo;\\n\"\n \"}\\n\"\n \n\n \n \"\\n\"\n \"vec3 compute_fog(vec3 color, vec3 relative_pos, float fragment_alpha)\\n\"\n \"{\\n\"\n \" float f = dot(relative_pos,relative_pos)*ambient[3].w;\\n\"\n \n \" f = clamp(f, 0.0, 1.0);\\n\"\n \" f = 3.0*f*f - 2.0*f*f*f;\\n\" \n \n \n \" return rlerp(f, color.xyz, ambient[3].xyz*fragment_alpha);\\n\"\n \n \" return rlerp(f, color.xyz, ambient[3].xyz);\\n\"\n \n \"}\\n\"\n \n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1646, "column": 1, - "source_line": "#define STBVOX_FACE_NONE 7" - } + "source_line": "static const char *stbvox_fragment_program =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_BLOCKTYPE_EMPTY", - "value": "0", - "function_like": false, - "directive": "define", + "name": "stbvox_fragment_program_alpha_only", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const char *stbvox_fragment_program_alpha_only", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CChar", + "qualifiers": [ + "const" + ], + "source_text": "const char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBVOX_SHADER_VERSION\n\n \n \"flat in uvec4 facedata;\\n\"\n \" in vec3 voxelspace_pos;\\n\"\n \" in float texlerp;\\n\"\n\n \n \"uniform vec3 transform[3];\\n\"\n\n \n \n \"uniform sampler2DArray tex_array[2];\\n\"\n\n \n \"uniform samplerBuffer texscale;\\n\"\n \"uniform samplerBuffer texgen;\\n\"\n \n \"uniform vec4 texscale[64];\\n\" \n \"uniform vec3 texgen[64];\\n\"\n \n \n\n \"out vec4 outcolor;\\n\"\n\n \"void main()\\n\"\n \"{\\n\"\n \" vec3 albedo;\\n\"\n \" float fragment_alpha;\\n\"\n\n \n \n \" uint tex1_id = facedata.x;\\n\"\n \" uint tex2_id = facedata.y;\\n\"\n \" uint texprojid = facedata.w & 31u;\\n\"\n \" uint color_id = facedata.z;\\n\"\n\n \n \n \" vec3 texgen_s = texgen[texprojid];\\n\"\n \" vec3 texgen_t = texgen[texprojid+32u];\\n\"\n \" float tex1_scale = texscale[tex1_id & 63u].x;\\n\"\n \" vec4 color = color_table[color_id & 63u];\\n\"\n \" vec4 tex2_props = texscale[tex2_id & 63u];\\n\"\n \n \" vec3 texgen_s = texelFetch(texgen, int(texprojid)).xyz;\\n\"\n \" vec3 texgen_t = texelFetch(texgen, int(texprojid+32u)).xyz;\\n\"\n \" float tex1_scale = texelFetch(texscale, int(tex1_id & 127u)).x;\\n\"\n \" vec4 color = texelFetch(color_table, int(color_id & 63u));\\n\"\n \" vec4 tex2_props = texelFetch(texscale, int(tex2_id & 127u));\\n\"\n \n\n \n \" float tex2_scale = tex2_props.y;\\n\"\n \" bool texblend_mode = tex2_props.z &((facedata.w & 128u) != 0u);\\n\"\n \n\n \" color.a = min(color.a, 1.0);\\n\"\n\n \" vec2 texcoord;\\n\"\n \" vec3 texturespace_pos = voxelspace_pos + transform[2].xyz;\\n\"\n \" texcoord.s = dot(texturespace_pos, texgen_s);\\n\"\n \" texcoord.t = dot(texturespace_pos, texgen_t);\\n\"\n\n \" vec2 texcoord_1 = tex1_scale * texcoord;\\n\"\n \" vec2 texcoord_2 = tex2_scale * texcoord;\\n\"\n\n \n \" texcoord_1 = texcoord_1 - floor(texcoord_1);\\n\"\n \" vec4 tex1 = textureGrad(tex_array[0], vec3(texcoord_1, float(tex1_id)), dFdx(tex1_scale*texcoord), dFdy(tex1_scale*texcoord));\\n\"\n \n \" vec4 tex1 = texture(tex_array[0], vec3(texcoord_1, float(tex1_id)));\\n\"\n \n\n \" if ((color_id & 64u) != 0u) tex1.a *= color.a;\\n\"\n \" fragment_alpha = tex1.a;\\n\"\n\n \n \" if (!texblend_mode) {\\n\"\n \n \" texcoord_2 = texcoord_2 - floor(texcoord_2);\\n\"\n \" vec4 tex2 = textureGrad(tex_array[0], vec3(texcoord_2, float(tex2_id)), dFdx(tex2_scale*texcoord), dFdy(tex2_scale*texcoord));\\n\"\n \n \" vec4 tex2 = texture(tex_array[1], vec3(texcoord_2, float(tex2_id)));\\n\"\n \n\n \" tex2.a *= texlerp;\\n\"\n \" if ((color_id & 128u) != 0u) tex2.rgba *= color.a;\\n\"\n \" fragment_alpha = tex1.a*(1-tex2.a)+tex2.a;\\n\"\n \"}\\n\"\n \"\\n\"\n \n\n \n \" fragment_alpha = 1.0;\\n\"\n \n\n \" outcolor = vec4(0.0, 0.0, 0.0, fragment_alpha);\\n\"\n \"}\\n\"\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1147, + "line": 1866, "column": 1, - "source_line": "#define STBVOX_BLOCKTYPE_EMPTY 0" - } + "source_line": "static const char *stbvox_fragment_program_alpha_only =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_BLOCKTYPE_HOLE", - "value": "65535", - "function_like": false, - "directive": "define", + "name": "stbvox_dummy_transform", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float stbvox_dummy_transform[3][3]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": null, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1150, + "line": 1985, "column": 1, - "source_line": "#define STBVOX_BLOCKTYPE_HOLE 65535" - } + "source_line": "static float stbvox_dummy_transform[3][3];" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_BLOCKTYPE_HOLE", - "value": "255", - "function_like": false, - "directive": "define", + "name": "stbvox_uniforms", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbvox_uniform_info stbvox_uniforms[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CTypedef", + "qualifiers": [], + "source_text": "stbvox_uniform_info", + "name": "stbvox_uniform_info", + "type": null, + "source_location": null, + "declaration_locations": [] + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { STBVOX_UNIFORM_TYPE_sampler , 4, 1, (char*) \"facearray\" , 0 },\n { STBVOX_UNIFORM_TYPE_vec3 , 12, 3, (char*) \"transform\" , stbvox_dummy_transform[0] },\n { STBVOX_UNIFORM_TYPE_sampler , 4, 2, (char*) \"tex_array\" , 0 },\n { STBVOX_UNIFORM_TYPE_vec4 , 16, 128, (char*) \"texscale\" , stbvox_default_texscale[0] , STBVOX_TEXBUF },\n { STBVOX_UNIFORM_TYPE_vec4 , 16, 64, (char*) \"color_table\" , stbvox_default_palette[0] , STBVOX_TEXBUF },\n { STBVOX_UNIFORM_TYPE_vec3 , 12, 32, (char*) \"normal_table\" , stbvox_default_normals[0] },\n { STBVOX_UNIFORM_TYPE_vec3 , 12, 64, (char*) \"texgen\" , stbvox_default_texgen[0][0], STBVOX_TEXBUF },\n { STBVOX_UNIFORM_TYPE_vec4 , 16, 4, (char*) \"ambient\" , stbvox_default_ambient[0] },\n { STBVOX_UNIFORM_TYPE_vec4 , 16, 1, (char*) \"camera_pos\" , stbvox_dummy_transform[0] },\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1152, + "line": 1993, "column": 1, - "source_line": "#define STBVOX_BLOCKTYPE_HOLE 255" - } + "source_line": "static stbvox_uniform_info stbvox_uniforms[] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_GEOMETRY", - "value": "((geom) + (rotate)*16 + (vheight)*64)", - "function_like": true, - "directive": "define", + "name": "stbvox_rotate_face", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_rotate_face[6][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0,1,2,3 },\n { 1,2,3,0 },\n { 2,3,0,1 },\n { 3,0,1,2 },\n { 4,4,4,4 },\n { 5,5,5,5 },\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1155, + "line": 2030, "column": 1, - "source_line": "#define STBVOX_MAKE_GEOMETRY(geom, rotate, vheight) ((geom) + (rotate)*16 + (vheight)*64)" - } + "source_line": "static unsigned char stbvox_rotate_face[6][4] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_VHEIGHT", - "value": "((v_sw) + (v_se)*4 + (v_nw)*16 + (v_ne)*64)", - "function_like": true, - "directive": "define", + "name": "stbvox_face_lerp", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_face_lerp[6]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,2,0,2,4,4 }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1156, + "line": 2162, "column": 1, - "source_line": "#define STBVOX_MAKE_VHEIGHT(v_sw, v_se, v_nw, v_ne) ((v_sw) + (v_se)*4 + (v_nw)*16 + (v_ne)*64)" - } + "source_line": "static unsigned char stbvox_face_lerp[6] = { 0,2,0,2,4,4 };" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_MATROT", - "value": "((block) + (overlay)*4 + (color)*64)", - "function_like": true, - "directive": "define", + "name": "stbvox_vert3_lerp", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_vert3_lerp[5]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "5", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,3,6,9,12 }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1157, + "line": 2163, "column": 1, - "source_line": "#define STBVOX_MAKE_MATROT(block, overlay, color) ((block) + (overlay)*4 + (color)*64)" - } + "source_line": "static unsigned char stbvox_vert3_lerp[5] = { 0,3,6,9,12 };" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_TEX2_REPLACE", - "value": "((tex2) + ((tex2_replace_face) & 3)*64)", - "function_like": true, - "directive": "define", + "name": "stbvox_vert_lerp_for_face_lerp", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_vert_lerp_for_face_lerp[4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0, 4, 7, 7 }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1158, + "line": 2164, "column": 1, - "source_line": "#define STBVOX_MAKE_TEX2_REPLACE(tex2, tex2_replace_face) ((tex2) + ((tex2_replace_face) & 3)*64)" - } + "source_line": "static unsigned char stbvox_vert_lerp_for_face_lerp[4] = { 0, 4, 7, 7 };" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_TEXLERP", - "value": "((ew2) + (ns2)*4 + (ud2)*16 + (vert)*64)", - "function_like": true, - "directive": "define", + "name": "stbvox_face3_lerp", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_face3_lerp[6]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,3,6,9,12,14 }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1159, + "line": 2165, "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP(ns2, ew2, ud2, vert) ((ew2) + (ns2)*4 + (ud2)*16 + (vert)*64)" - } + "source_line": "static unsigned char stbvox_face3_lerp[6] = { 0,3,6,9,12,14 };" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_TEXLERP_SIMPLE", - "value": "((vert)*32 + (face)*4 + (baselerp))", - "function_like": true, - "directive": "define", + "name": "stbvox_vert_lerp_for_simple", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_vert_lerp_for_simple[4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,2,5,7 }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1160, + "line": 2166, "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP_SIMPLE(baselerp,vert,face) ((vert)*32 + (face)*4 + (baselerp))" - } + "source_line": "static unsigned char stbvox_vert_lerp_for_simple[4] = { 0,2,5,7 };" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_TEXLERP1", - "value": "STBVOX_MAKE_TEXLERP(s2, w2, d2, vert)", - "function_like": true, - "directive": "define", + "name": "stbvox_face3_updown", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_face3_updown[8]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,2,5,7,0,2,5,7 }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1161, + "line": 2167, "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP1(vert,e2,n2,w2,s2,u4,d2) STBVOX_MAKE_TEXLERP(s2, w2, d2, vert)" - } + "source_line": "static unsigned char stbvox_face3_updown[8] = { 0,2,5,7,0,2,5,7 }; // ignore top bit" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_TEXLERP2", - "value": "((u2)*16 + (n2)*4 + (s2))", - "function_like": true, - "directive": "define", + "name": "stbvox_vertex_vector", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_vertex_vector[6][4][3]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { { 1,0,1 }, { 1,1,1 }, { 1,1,0 }, { 1,0,0 } }, \n { { 1,1,1 }, { 0,1,1 }, { 0,1,0 }, { 1,1,0 } }, \n { { 0,1,1 }, { 0,0,1 }, { 0,0,0 }, { 0,1,0 } }, \n { { 0,0,1 }, { 1,0,1 }, { 1,0,0 }, { 0,0,0 } }, \n { { 0,1,1 }, { 1,1,1 }, { 1,0,1 }, { 0,0,1 } }, \n { { 0,0,0 }, { 1,0,0 }, { 1,1,0 }, { 0,1,0 } }, \n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1162, + "line": 2170, "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP2(vert,e2,n2,w2,s2,u4,d2) ((u2)*16 + (n2)*4 + (s2))" - } + "source_line": "static unsigned char stbvox_vertex_vector[6][4][3] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_FACE_MASK", - "value": "((e)+(n)*2+(w)*4+(s)*8+(u)*16+(d)*32)", - "function_like": true, - "directive": "define", + "name": "stbvox_vertex_selector", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_vertex_selector[6][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 5,7,3,1 },\n { 7,6,2,3 },\n { 6,4,0,2 },\n { 4,5,1,0 },\n { 6,7,5,4 },\n { 0,1,3,2 },\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1163, + "line": 2181, "column": 1, - "source_line": "#define STBVOX_MAKE_FACE_MASK(e,n,w,s,u,d) ((e)+(n)*2+(w)*4+(s)*8+(u)*16+(d)*32)" - } + "source_line": "static unsigned char stbvox_vertex_selector[6][4] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_SIDE_TEXROT", - "value": "((e)+(n)*4+(w)*16+(s)*64)", - "function_like": true, - "directive": "define", - "source_location": { + "name": "stbvox_vmesh_delta_normal", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbvox_mesh_vertex stbvox_vmesh_delta_normal[6][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { stbvox_vertex_encode(1,0,1,0,0) ,\n stbvox_vertex_encode(1,1,1,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) },\n { stbvox_vertex_encode(1,1,1,0,0) ,\n stbvox_vertex_encode(0,1,1,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) },\n { stbvox_vertex_encode(0,1,1,0,0) ,\n stbvox_vertex_encode(0,0,1,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) },\n { stbvox_vertex_encode(0,0,1,0,0) ,\n stbvox_vertex_encode(1,0,1,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) },\n { stbvox_vertex_encode(0,1,1,0,0) ,\n stbvox_vertex_encode(1,1,1,0,0) ,\n stbvox_vertex_encode(1,0,1,0,0) ,\n stbvox_vertex_encode(0,0,1,0,0) },\n { stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) }\n}" + }, + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1164, + "line": 2191, "column": 1, - "source_line": "#define STBVOX_MAKE_SIDE_TEXROT(e,n,w,s) ((e)+(n)*4+(w)*16+(s)*64)" - } + "source_line": "static stbvox_mesh_vertex stbvox_vmesh_delta_normal[6][4] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_COLOR", - "value": "((color)+(t1)*64+(t2)*128)", - "function_like": true, - "directive": "define", + "name": "stbvox_vmesh_pre_vheight", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbvox_mesh_vertex stbvox_vmesh_pre_vheight[6][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) },\n { stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) },\n { stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) },\n { stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) },\n { stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) },\n { stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) }\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1165, + "line": 2219, "column": 1, - "source_line": "#define STBVOX_MAKE_COLOR(color,t1,t2) ((color)+(t1)*64+(t2)*128)" - } + "source_line": "static stbvox_mesh_vertex stbvox_vmesh_pre_vheight[6][4] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_TEXLERP_VERT3", - "value": "((e)+(n)*8+(w)*64+(s)*512+(u)*4096)", - "function_like": true, - "directive": "define", + "name": "stbvox_vmesh_delta_half_z", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbvox_mesh_vertex stbvox_vmesh_delta_half_z[6][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) },\n { stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) },\n { stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(0,0,2,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) },\n { stbvox_vertex_encode(0,0,2,0,0) ,\n stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) },\n { stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(0,0,2,0,0) },\n { stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) }\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1166, + "line": 2247, "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP_VERT3(e,n,w,s,u) ((e)+(n)*8+(w)*64+(s)*512+(u)*4096)" - } + "source_line": "static stbvox_mesh_vertex stbvox_vmesh_delta_half_z[6][4] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_TEXLERP_FACE3", - "value": "((e)+(n)*8+(w)*64+(s)*512+(u)*4096+(d)*16384)", - "function_like": true, - "directive": "define", + "name": "stbvox_vmesh_crossed_pair", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbvox_mesh_vertex stbvox_vmesh_crossed_pair[6][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) },\n { stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(0,0,2,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) },\n { stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) },\n { stbvox_vertex_encode(0,0,2,0,0) ,\n stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) },\n \n { stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(0,0,2,0,0) },\n { stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) }\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1167, + "line": 2275, "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP_FACE3(e,n,w,s,u,d) ((e)+(n)*8+(w)*64+(s)*512+(u)*4096+(d)*16384)" - } + "source_line": "static stbvox_mesh_vertex stbvox_vmesh_crossed_pair[6][4] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_PACKED_COMPACT", - "value": "((rot)+4*(vheight)+16*(use)+32*(texlerp))", - "function_like": true, - "directive": "define", + "name": "stbvox_hasface", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_hasface[STBVOX_MAX_GEOM][STBVOX_NUM_ROTATION]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBVOX_MAX_GEOM", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBVOX_NUM_ROTATION", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0,0,0,0 }, \n { 0,0,0,0 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 1|2|4|48, 8|1|2|48, 4|8|1|48, 2|4|8|48, }, \n { 1|2|4|48, 8|1|2|48, 4|8|1|48, 2|4|8|48, }, \n { 47,47,47,47 }, \n { 31,31,31,31 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1168, + "line": 2308, "column": 1, - "source_line": "#define STBVOX_MAKE_PACKED_COMPACT(rot, vheight, texlerp, def) ((rot)+4*(vheight)+16*(use)+32*(texlerp))" - } + "source_line": "static unsigned char stbvox_hasface[STBVOX_MAX_GEOM][STBVOX_NUM_ROTATION] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAKE_LIGHTING_EXT", - "value": "(((lighting)&~3)+(rot))", - "function_like": true, - "directive": "define", + "name": "stbvox_facetype", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_facetype[STBVOX_GEOM_count][6]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBVOX_GEOM_count", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0, }, \n { STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid }, \n { STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid }, \n { STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force }, \n\n { STBVOX_FT_upper, STBVOX_FT_upper, STBVOX_FT_upper, STBVOX_FT_upper, STBVOX_FT_solid, STBVOX_FT_force },\n { STBVOX_FT_lower, STBVOX_FT_lower, STBVOX_FT_lower, STBVOX_FT_lower, STBVOX_FT_force, STBVOX_FT_solid },\n { STBVOX_FT_diag_123, STBVOX_FT_solid, STBVOX_FT_diag_023, STBVOX_FT_none, STBVOX_FT_force, STBVOX_FT_solid },\n { STBVOX_FT_diag_012, STBVOX_FT_solid, STBVOX_FT_diag_013, STBVOX_FT_none, STBVOX_FT_solid, STBVOX_FT_force },\n\n { STBVOX_FT_diag_123, STBVOX_FT_solid, STBVOX_FT_diag_023, STBVOX_FT_force, STBVOX_FT_none, STBVOX_FT_solid },\n { STBVOX_FT_diag_012, STBVOX_FT_solid, STBVOX_FT_diag_013, STBVOX_FT_force, STBVOX_FT_solid, STBVOX_FT_none },\n { STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, 0,0 }, \n { STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force }, \n\n { STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial, STBVOX_FT_force, STBVOX_FT_solid }, \n { STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial, STBVOX_FT_force, STBVOX_FT_solid }, \n { STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial, STBVOX_FT_solid, STBVOX_FT_force }, \n { STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial, STBVOX_FT_solid, STBVOX_FT_force }, \n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1170, + "line": 2329, "column": 1, - "source_line": "#define STBVOX_MAKE_LIGHTING_EXT(lighting, rot) (((lighting)&~3)+(rot))" - } - }, - { - "name": "STBVOX_MAKE_LIGHTING", - "value": "(lighting)", - "function_like": true, - "directive": "define", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1171, - "column": 1, - "source_line": "#define STBVOX_MAKE_LIGHTING(lighting) (lighting)" - } + "source_line": "static unsigned char stbvox_facetype[STBVOX_GEOM_count][6] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAX_MESHES", - "value": "2", - "function_like": false, - "directive": "define", + "name": "stbvox_floor_slope_for_rot", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_floor_slope_for_rot[4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBVF_su,\n STBVF_wu, \n STBVF_nu,\n STBVF_eu,\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1174, + "line": 2354, "column": 1, - "source_line": "#define STBVOX_MAX_MESHES 2 // opaque & transparent" - } + "source_line": "static unsigned char stbvox_floor_slope_for_rot[4] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_MAX_MESH_SLOTS", - "value": "3", - "function_like": false, - "directive": "define", + "name": "stbvox_ceil_slope_for_rot", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_ceil_slope_for_rot[4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBVF_sd,\n STBVF_ed,\n STBVF_nd,\n STBVF_wd,\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1177, + "line": 2362, "column": 1, - "source_line": "#define STBVOX_MAX_MESH_SLOTS 3 // one vertex & two faces, or two vertex and one face" - } - }, - { - "name": "STBVOX_NOTUSED", - "value": "(void)(v)", - "function_like": true, - "directive": "define", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1233, - "column": 4, - "source_line": " #define STBVOX_NOTUSED(v) (void)(v)" - } - }, - { - "name": "STBVOX_NOTUSED", - "value": "(void)sizeof(v)", - "function_like": true, - "directive": "define", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1235, - "column": 4, - "source_line": " #define STBVOX_NOTUSED(v) (void)sizeof(v)" - } - }, - { - "name": "STBVOX_ICONFIG_VERTEX_32", - "value": null, - "function_like": false, - "directive": "define", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1294, - "column": 4, - "source_line": " #define STBVOX_ICONFIG_VERTEX_32" - } + "source_line": "static unsigned char stbvox_ceil_slope_for_rot[4] =" + }, + "callback_policy": null, + "declaration_locations": [] }, { - "name": "STBVOX_ICONFIG_FACE1_1", - "value": null, - "function_like": false, - "directive": "define", + "name": "stbvox_face_visible", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned short stbvox_face_visible[STBVOX_FT_count]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBVOX_FT_count", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedShort", + "qualifiers": [], + "source_text": "unsigned short" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n \n \n (unsigned short) ((~0x07ffu )<<5), \n (unsigned short) ((~((1u<" + "source_line": "#define STBVOX_MAKE_TEXLERP_VERT3(e,n,w,s,u) ((e)+(n)*8+(w)*64+(s)*512+(u)*4096)" } }, { - "target": "stdlib.h", - "kind": "system", - "resolved_path": null, + "name": "STBVOX_MAKE_TEXLERP_FACE3", + "value": "((e)+(n)*8+(w)*64+(s)*512+(u)*4096+(d)*16384)", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1218, + "line": 1167, "column": 1, - "source_line": "#include " + "source_line": "#define STBVOX_MAKE_TEXLERP_FACE3(e,n,w,s,u,d) ((e)+(n)*8+(w)*64+(s)*512+(u)*4096+(d)*16384)" } }, { - "target": "assert.h", - "kind": "system", - "resolved_path": null, + "name": "STBVOX_MAKE_PACKED_COMPACT", + "value": "((rot)+4*(vheight)+16*(use)+32*(texlerp))", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1219, + "line": 1168, "column": 1, - "source_line": "#include " + "source_line": "#define STBVOX_MAKE_PACKED_COMPACT(rot, vheight, texlerp, def) ((rot)+4*(vheight)+16*(use)+32*(texlerp))" } }, { - "target": "string.h", - "kind": "system", - "resolved_path": null, + "name": "STBVOX_MAKE_LIGHTING_EXT", + "value": "(((lighting)&~3)+(rot))", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1220, + "line": 1170, "column": 1, - "source_line": "#include // memset" + "source_line": "#define STBVOX_MAKE_LIGHTING_EXT(lighting, rot) (((lighting)&~3)+(rot))" } }, { - "target": "stdint.h", - "kind": "system", - "resolved_path": null, - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1224, - "column": 4, - "source_line": " #include " - } - } - ], - "raw_directives": [ - { - "directive": "ifndef", - "argument": "INCLUDE_STB_VOXEL_RENDER_H", + "name": "STBVOX_MAKE_LIGHTING", + "value": "(lighting)", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 228, + "line": 1171, "column": 1, - "source_line": "#ifndef INCLUDE_STB_VOXEL_RENDER_H" + "source_line": "#define STBVOX_MAKE_LIGHTING(lighting) (lighting)" } }, { - "directive": "ifdef", - "argument": "STB_VOXEL_RENDER_STATIC", + "name": "STBVOX_MAX_MESHES", + "value": "2", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 236, + "line": 1174, "column": 1, - "source_line": "#ifdef STB_VOXEL_RENDER_STATIC" + "source_line": "#define STBVOX_MAX_MESHES 2 // opaque & transparent" } }, { - "directive": "else", - "argument": null, + "name": "STBVOX_MAX_MESH_SLOTS", + "value": "3", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 238, + "line": 1177, "column": 1, - "source_line": "#else" + "source_line": "#define STBVOX_MAX_MESH_SLOTS 3 // one vertex & two faces, or two vertex and one face" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_NOTUSED", + "value": "(void)(v)", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 240, - "column": 1, - "source_line": "#endif" + "line": 1233, + "column": 4, + "source_line": " #define STBVOX_NOTUSED(v) (void)(v)" } }, { - "directive": "ifdef", - "argument": "__cplusplus", + "name": "STBVOX_NOTUSED", + "value": "(void)sizeof(v)", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 242, - "column": 1, - "source_line": "#ifdef __cplusplus" + "line": 1235, + "column": 4, + "source_line": " #define STBVOX_NOTUSED(v) (void)sizeof(v)" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_ICONFIG_VERTEX_32", + "value": null, + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 244, - "column": 1, - "source_line": "#endif" + "line": 1294, + "column": 4, + "source_line": " #define STBVOX_ICONFIG_VERTEX_32" } }, { - "directive": "if", - "argument": "0", + "name": "STBVOX_ICONFIG_FACE1_1", + "value": null, + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 607, - "column": 1, - "source_line": "#if 0" + "line": 1295, + "column": 4, + "source_line": " #define STBVOX_ICONFIG_FACE1_1" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_ICONFIG_VERTEX_32", + "value": null, + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 653, - "column": 1, - "source_line": "#endif" + "line": 1299, + "column": 4, + "source_line": " #define STBVOX_ICONFIG_VERTEX_32" } }, { - "directive": "ifdef", - "argument": "__cplusplus", + "name": "STBVOX_ICONFIG_FACE1_1", + "value": null, + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 655, - "column": 1, - "source_line": "#ifdef __cplusplus" + "line": 1300, + "column": 4, + "source_line": " #define STBVOX_ICONFIG_FACE1_1" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_ICONFIG_UNTEXTURED", + "value": null, + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 657, - "column": 1, - "source_line": "#endif" + "line": 1301, + "column": 4, + "source_line": " #define STBVOX_ICONFIG_UNTEXTURED" } }, { - "directive": "ifdef", - "argument": "STBVOX_CONFIG_BLOCKTYPE_SHORT", + "name": "STBVOX_ICONFIG_FACE_ATTRIBUTE", + "value": null, + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 704, + "line": 1308, "column": 1, - "source_line": "#ifdef STBVOX_CONFIG_BLOCKTYPE_SHORT" + "source_line": "#define STBVOX_ICONFIG_FACE_ATTRIBUTE" } }, { - "directive": "else", - "argument": null, + "name": "STBVOX_ICONFIG_GLSL", + "value": null, + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 706, + "line": 1313, "column": 1, - "source_line": "#else" + "source_line": "#define STBVOX_ICONFIG_GLSL" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_ICONFIG_OPENGL_3_1_COMPATIBILITY", + "value": null, + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 708, + "line": 1317, "column": 1, - "source_line": "#endif" + "source_line": "#define STBVOX_ICONFIG_OPENGL_3_1_COMPATIBILITY" } }, { - "directive": "ifdef", - "argument": "STBVOX_BLOCKTYPE_SHORT", + "name": "stbvox_vertex_encode", + "value": "((stbvox_uint32) ((x)+((y)<<7)+((z)<<14)+((ao)<<23)+((texlerp)<<29)))", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1149, - "column": 1, - "source_line": "#ifdef STBVOX_BLOCKTYPE_SHORT" + "line": 1322, + "column": 4, + "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" } }, { - "directive": "else", - "argument": null, + "name": "stbvox_vertex_encode", + "value": "((stbvox_uint16) ((z)+((ao)<<7)+((texlerp)<<13)", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1151, - "column": 1, - "source_line": "#else" + "line": 1326, + "column": 4, + "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" } }, { - "directive": "endif", - "argument": null, + "name": "stbvox_vertex_encode", + "value": "((stbvox_uint16) ((x)+((z)<<6))+((ao)<<10))", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1153, - "column": 1, - "source_line": "#endif" + "line": 1330, + "column": 4, + "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" } }, { - "directive": "ifndef", - "argument": "STBVOX_MAX_MESHES", + "name": "stbvox_vertex_encode", + "value": "((stbvox_uint8) ((z)+((ao)<<6))", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1173, - "column": 1, - "source_line": "#ifndef STBVOX_MAX_MESHES" + "line": 1334, + "column": 4, + "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_RSQRT2", + "value": "0.7071067811865f", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1175, + "line": 1452, "column": 1, - "source_line": "#endif" + "source_line": "#define STBVOX_RSQRT2 0.7071067811865f" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_RSQRT3", + "value": "0.5773502691896f", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1213, + "line": 1453, "column": 1, - "source_line": "#endif // INCLUDE_STB_VOXEL_RENDER_H" + "source_line": "#define STBVOX_RSQRT3 0.5773502691896f" } }, { - "directive": "ifdef", - "argument": "STB_VOXEL_RENDER_IMPLEMENTATION", + "name": "STBVOX_SHADER_VERSION", + "value": "\"#version 150 compatibility\\n\"", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1216, - "column": 1, - "source_line": "#ifdef STB_VOXEL_RENDER_IMPLEMENTATION" + "line": 1561, + "column": 4, + "source_line": " #define STBVOX_SHADER_VERSION \"#version 150 compatibility\\n\"" } }, { - "directive": "ifndef", - "argument": "_MSC_VER", + "name": "STBVOX_SHADER_VERSION", + "value": "\"#version 130\\n\"", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1223, - "column": 1, - "source_line": "#ifndef _MSC_VER" + "line": 1563, + "column": 4, + "source_line": " #define STBVOX_SHADER_VERSION \"#version 130\\n\"" } }, { - "directive": "else", - "argument": null, + "name": "STBVOX_SHADER_VERSION", + "value": "\"#version 150\\n\"", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1227, - "column": 1, - "source_line": "#else" + "line": 1565, + "column": 4, + "source_line": " #define STBVOX_SHADER_VERSION \"#version 150\\n\"" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_SHADER_VERSION", + "value": "\"\"", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1230, - "column": 1, - "source_line": "#endif" + "line": 1567, + "column": 4, + "source_line": " #define STBVOX_SHADER_VERSION \"\"" } }, { - "directive": "ifdef", - "argument": "_MSC_VER", + "name": "STBVOX_TEXBUF", + "value": "1", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1232, + "line": 1988, "column": 1, - "source_line": "#ifdef _MSC_VER" + "source_line": "#define STBVOX_TEXBUF 1" } }, { - "directive": "else", - "argument": null, + "name": "STBVOX_TEXBUF", + "value": "0", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1234, + "line": 1990, "column": 1, - "source_line": "#else" + "source_line": "#define STBVOX_TEXBUF 0" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_GET_GEO", + "value": "((geom_data) & 15)", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1236, + "line": 2015, "column": 1, - "source_line": "#endif" + "source_line": "#define STBVOX_GET_GEO(geom_data) ((geom_data) & 15)" } }, { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_MODE", + "name": "STBVOX_ROTATE", + "value": "stbvox_rotate_face[x][r]", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1240, + "line": 2040, "column": 1, - "source_line": "#ifndef STBVOX_CONFIG_MODE" + "source_line": "#define STBVOX_ROTATE(x,r) stbvox_rotate_face[x][r] // (((x)+(r))&3)" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_MAX_GEOM", + "value": "16", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1242, + "line": 2304, "column": 1, - "source_line": "#endif" + "source_line": "#define STBVOX_MAX_GEOM 16" } }, { - "directive": "if", - "argument": "defined(STBVOX_CONFIG_ROTATION_IN_LIGHTING) && defined(STBVOX_CONFIG_VHEIGHT_IN_LIGHTING)", + "name": "STBVOX_NUM_ROTATION", + "value": "4", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1244, + "line": 2305, "column": 1, - "source_line": "#if defined(STBVOX_CONFIG_ROTATION_IN_LIGHTING) && defined(STBVOX_CONFIG_VHEIGHT_IN_LIGHTING)" + "source_line": "#define STBVOX_NUM_ROTATION 4" } }, { - "directive": "endif", - "argument": null, - "source_location": { + "name": "STBVOX_HEIGHTS", + "value": "{ stbvox_vertex_encode(0,0,a,0,0), stbvox_vertex_encode(0,0,b,0,0), stbvox_vertex_encode(0,0,c,0,0), stbvox_vertex_encode(0,0,d,0,0), stbvox_vertex_encode(0,0,e,0,0), stbvox_vertex_encode(0,0,f,0,0), stbvox_vertex_encode(0,0,g,0,0), stbvox_vertex_encode(0,0,h,0,0) }", + "function_like": true, + "directive": "define", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1246, - "column": 1, - "source_line": "#endif" + "line": 2392, + "column": 4, + "source_line": " #define STBVOX_HEIGHTS(a,b,c,d,e,f,g,h) \\" } }, { - "directive": "if", - "argument": "STBVOX_CONFIG_MODE==0 || STBVOX_CONFIG_MODE==1", + "name": "STBVOX_USE_PACKED", + "value": "((f) == STBVOX_FACE_up || (f) == STBVOX_FACE_down)", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1292, - "column": 1, - "source_line": "#if STBVOX_CONFIG_MODE==0 || STBVOX_CONFIG_MODE==1" + "line": 2686, + "column": 7, + "source_line": " #define STBVOX_USE_PACKED(f) ((f) == STBVOX_FACE_up || (f) == STBVOX_FACE_down)" } }, { - "directive": "elif", - "argument": "STBVOX_CONFIG_MODE==20 || STBVOX_CONFIG_MODE==21", + "name": "STBVOX_USE_PACKED", + "value": "((f) == STBVOX_FACE_up )", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1297, - "column": 1, - "source_line": "#elif STBVOX_CONFIG_MODE==20 || STBVOX_CONFIG_MODE==21" + "line": 2688, + "column": 7, + "source_line": " #define STBVOX_USE_PACKED(f) ((f) == STBVOX_FACE_up )" } }, { - "directive": "else", - "argument": null, + "name": "STBVOX_USE_PACKED", + "value": "( (f) == STBVOX_FACE_down)", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1303, - "column": 1, - "source_line": "#else" + "line": 2690, + "column": 7, + "source_line": " #define STBVOX_USE_PACKED(f) ( (f) == STBVOX_FACE_down)" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_GET_LIGHTING", + "value": "((light) & ~3)", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1305, - "column": 1, - "source_line": "#endif" + "line": 2790, + "column": 13, + "source_line": " #define STBVOX_GET_LIGHTING(light) ((light) & ~3)" } }, { - "directive": "if", - "argument": "STBVOX_CONFIG_MODE==0 || STBVOX_CONFIG_MODE==20", + "name": "STBVOX_LIGHTING_ROUNDOFF", + "value": "8", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1307, - "column": 1, - "source_line": "#if STBVOX_CONFIG_MODE==0 || STBVOX_CONFIG_MODE==20" + "line": 2791, + "column": 13, + "source_line": " #define STBVOX_LIGHTING_ROUNDOFF 8" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_GET_LIGHTING", + "value": "(light)", + "function_like": true, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1309, - "column": 1, - "source_line": "#endif" + "line": 2793, + "column": 13, + "source_line": " #define STBVOX_GET_LIGHTING(light) (light)" } }, { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_HLSL", + "name": "STBVOX_LIGHTING_ROUNDOFF", + "value": "2", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1311, - "column": 1, - "source_line": "#ifndef STBVOX_CONFIG_HLSL" + "line": 2794, + "column": 13, + "source_line": " #define STBVOX_LIGHTING_ROUNDOFF 2" } }, { - "directive": "endif", - "argument": null, + "name": "STBVOX_CONFIG_PRECISION_Z", + "value": "1", + "function_like": false, + "directive": "define", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1314, + "line": 2890, "column": 1, - "source_line": "#endif" + "source_line": "#define STBVOX_CONFIG_PRECISION_Z 1" } - }, + } + ], + "includes": [ { - "directive": "ifdef", - "argument": "STBVOX_CONFIG_OPENGL_MODELVIEW", + "target": "stdlib.h", + "kind": "system", + "resolved_path": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1316, + "line": 231, "column": 1, - "source_line": "#ifdef STBVOX_CONFIG_OPENGL_MODELVIEW" + "source_line": "#include " } }, { - "directive": "endif", - "argument": null, + "target": "stdlib.h", + "kind": "system", + "resolved_path": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1318, + "line": 1218, "column": 1, - "source_line": "#endif" + "source_line": "#include " } }, { - "directive": "if", - "argument": "defined(STBVOX_ICONFIG_VERTEX_32)", + "target": "assert.h", + "kind": "system", + "resolved_path": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1320, + "line": 1219, "column": 1, - "source_line": "#if defined(STBVOX_ICONFIG_VERTEX_32)" + "source_line": "#include " } }, { - "directive": "elif", - "argument": "defined(STBVOX_ICONFIG_VERTEX_16_1)", + "target": "string.h", + "kind": "system", + "resolved_path": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1324, + "line": 1220, "column": 1, - "source_line": "#elif defined(STBVOX_ICONFIG_VERTEX_16_1) // mode=2" + "source_line": "#include // memset" } }, { - "directive": "elif", - "argument": "defined(STBVOX_ICONFIG_VERTEX_16_2)", + "target": "stdint.h", + "kind": "system", + "resolved_path": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1328, + "line": 1224, + "column": 4, + "source_line": " #include " + } + } + ], + "raw_directives": [ + { + "directive": "ifndef", + "argument": "INCLUDE_STB_VOXEL_RENDER_H", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 228, "column": 1, - "source_line": "#elif defined(STBVOX_ICONFIG_VERTEX_16_2) // mode=3" + "source_line": "#ifndef INCLUDE_STB_VOXEL_RENDER_H" } }, { - "directive": "elif", - "argument": "defined(STBVOX_ICONFIG_VERTEX_8)", + "directive": "ifdef", + "argument": "STB_VOXEL_RENDER_STATIC", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1332, + "line": 236, "column": 1, - "source_line": "#elif defined(STBVOX_ICONFIG_VERTEX_8)" + "source_line": "#ifdef STB_VOXEL_RENDER_STATIC" } }, { @@ -8024,7 +9319,7 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1336, + "line": 238, "column": 1, "source_line": "#else" } @@ -8034,29 +9329,39 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1338, + "line": 240, "column": 1, "source_line": "#endif" } }, { "directive": "ifdef", - "argument": "STBVOX_ICONFIG_FACE1_1", + "argument": "__cplusplus", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1340, + "line": 242, "column": 1, - "source_line": "#ifdef STBVOX_ICONFIG_FACE1_1" + "source_line": "#ifdef __cplusplus" } }, { - "directive": "else", + "directive": "endif", "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1345, + "line": 244, "column": 1, - "source_line": "#else" + "source_line": "#endif" + } + }, + { + "directive": "if", + "argument": "0", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 607, + "column": 1, + "source_line": "#if 0" } }, { @@ -8064,39 +9369,39 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1347, + "line": 653, "column": 1, "source_line": "#endif" } }, { - "directive": "if", - "argument": "defined(STBVOX_ICONFIG_OPENGL_3_1_COMPATIBILITY)", + "directive": "ifdef", + "argument": "__cplusplus", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1560, + "line": 655, "column": 1, - "source_line": "#if defined(STBVOX_ICONFIG_OPENGL_3_1_COMPATIBILITY)" + "source_line": "#ifdef __cplusplus" } }, { - "directive": "elif", - "argument": "defined(STBVOX_ICONFIG_OPENGL_3_0)", + "directive": "endif", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1562, + "line": 657, "column": 1, - "source_line": "#elif defined(STBVOX_ICONFIG_OPENGL_3_0)" + "source_line": "#endif" } }, { - "directive": "elif", - "argument": "defined(STBVOX_ICONFIG_GLSL)", + "directive": "ifdef", + "argument": "STBVOX_CONFIG_BLOCKTYPE_SHORT", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1564, + "line": 704, "column": 1, - "source_line": "#elif defined(STBVOX_ICONFIG_GLSL)" + "source_line": "#ifdef STBVOX_CONFIG_BLOCKTYPE_SHORT" } }, { @@ -8104,7 +9409,7 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1566, + "line": 706, "column": 1, "source_line": "#else" } @@ -8114,19 +9419,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1568, + "line": 708, "column": 1, "source_line": "#endif" } }, { "directive": "ifdef", - "argument": "STBVOX_ICONFIG_FACE_ATTRIBUTE", + "argument": "STBVOX_BLOCKTYPE_SHORT", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1574, - "column": 4, - "source_line": " #ifdef STBVOX_ICONFIG_FACE_ATTRIBUTE // NOT TAG_face_sampled" + "line": 1149, + "column": 1, + "source_line": "#ifdef STBVOX_BLOCKTYPE_SHORT" } }, { @@ -8134,9 +9439,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1576, - "column": 4, - "source_line": " #else" + "line": 1151, + "column": 1, + "source_line": "#else" } }, { @@ -8144,19 +9449,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1578, - "column": 4, - "source_line": " #endif" + "line": 1153, + "column": 1, + "source_line": "#endif" } }, { - "directive": "ifdef", - "argument": "STBVOX_ICONFIG_FACE_ARRAY_2", + "directive": "ifndef", + "argument": "STBVOX_MAX_MESHES", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1580, - "column": 4, - "source_line": " #ifdef STBVOX_ICONFIG_FACE_ARRAY_2" + "line": 1173, + "column": 1, + "source_line": "#ifndef STBVOX_MAX_MESHES" } }, { @@ -8164,39 +9469,39 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1582, - "column": 4, - "source_line": " #endif" + "line": 1175, + "column": 1, + "source_line": "#endif" } }, { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_OPENGL_MODELVIEW", + "directive": "endif", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1598, - "column": 7, - "source_line": " #ifndef STBVOX_CONFIG_OPENGL_MODELVIEW" + "line": 1213, + "column": 1, + "source_line": "#endif // INCLUDE_STB_VOXEL_RENDER_H" } }, { - "directive": "endif", - "argument": null, + "directive": "ifdef", + "argument": "STB_VOXEL_RENDER_IMPLEMENTATION", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1600, - "column": 7, - "source_line": " #endif" + "line": 1216, + "column": 1, + "source_line": "#ifdef STB_VOXEL_RENDER_IMPLEMENTATION" } }, { - "directive": "ifdef", - "argument": "STBVOX_ICONFIG_FACE_ATTRIBUTE", + "directive": "ifndef", + "argument": "_MSC_VER", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1612, - "column": 7, - "source_line": " #ifdef STBVOX_ICONFIG_FACE_ATTRIBUTE" + "line": 1223, + "column": 1, + "source_line": "#ifndef _MSC_VER" } }, { @@ -8204,9 +9509,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1614, - "column": 7, - "source_line": " #else" + "line": 1227, + "column": 1, + "source_line": "#else" } }, { @@ -8214,19 +9519,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1617, - "column": 7, - "source_line": " #endif" + "line": 1230, + "column": 1, + "source_line": "#endif" } }, { "directive": "ifdef", - "argument": "STBVOX_DEBUG_TEST_NORMALS", + "argument": "_MSC_VER", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1631, - "column": 7, - "source_line": " #ifdef STBVOX_DEBUG_TEST_NORMALS" + "line": 1232, + "column": 1, + "source_line": "#ifdef _MSC_VER" + } + }, + { + "directive": "else", + "argument": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1234, + "column": 1, + "source_line": "#else" } }, { @@ -8234,29 +9549,39 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1634, - "column": 7, - "source_line": " #endif" + "line": 1236, + "column": 1, + "source_line": "#endif" } }, { "directive": "ifndef", - "argument": "STBVOX_CONFIG_OPENGL_MODELVIEW", + "argument": "STBVOX_CONFIG_MODE", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1636, - "column": 7, - "source_line": " #ifndef STBVOX_CONFIG_OPENGL_MODELVIEW" + "line": 1240, + "column": 1, + "source_line": "#ifndef STBVOX_CONFIG_MODE" } }, { - "directive": "else", + "directive": "endif", "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1638, - "column": 7, - "source_line": " #else" + "line": 1242, + "column": 1, + "source_line": "#endif" + } + }, + { + "directive": "if", + "argument": "defined(STBVOX_CONFIG_ROTATION_IN_LIGHTING) && defined(STBVOX_CONFIG_VHEIGHT_IN_LIGHTING)", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1244, + "column": 1, + "source_line": "#if defined(STBVOX_CONFIG_ROTATION_IN_LIGHTING) && defined(STBVOX_CONFIG_VHEIGHT_IN_LIGHTING)" } }, { @@ -8264,29 +9589,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1640, - "column": 7, - "source_line": " #endif" + "line": 1246, + "column": 1, + "source_line": "#endif" } }, { "directive": "if", - "argument": "defined(STBVOX_ICONFIG_GLSL)", + "argument": "STBVOX_CONFIG_MODE==0 || STBVOX_CONFIG_MODE==1", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1651, - "column": 7, - "source_line": " #if defined(STBVOX_ICONFIG_GLSL)" + "line": 1292, + "column": 1, + "source_line": "#if STBVOX_CONFIG_MODE==0 || STBVOX_CONFIG_MODE==1" } }, { "directive": "elif", - "argument": "defined(STBVOX_CONFIG_HLSL)", + "argument": "STBVOX_CONFIG_MODE==20 || STBVOX_CONFIG_MODE==21", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1653, - "column": 7, - "source_line": " #elif defined(STBVOX_CONFIG_HLSL)" + "line": 1297, + "column": 1, + "source_line": "#elif STBVOX_CONFIG_MODE==20 || STBVOX_CONFIG_MODE==21" } }, { @@ -8294,9 +9619,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1655, - "column": 7, - "source_line": " #else" + "line": 1303, + "column": 1, + "source_line": "#else" } }, { @@ -8304,49 +9629,39 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1657, - "column": 7, - "source_line": " #endif" - } - }, - { - "directive": "ifndef", - "argument": "STBVOX_ICONFIG_UNTEXTURED", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1676, - "column": 7, - "source_line": " #ifndef STBVOX_ICONFIG_UNTEXTURED" + "line": 1305, + "column": 1, + "source_line": "#endif" } }, { - "directive": "ifdef", - "argument": "STBVOX_CONFIG_PREFER_TEXBUFFER", + "directive": "if", + "argument": "STBVOX_CONFIG_MODE==0 || STBVOX_CONFIG_MODE==20", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1680, - "column": 10, - "source_line": " #ifdef STBVOX_CONFIG_PREFER_TEXBUFFER" + "line": 1307, + "column": 1, + "source_line": "#if STBVOX_CONFIG_MODE==0 || STBVOX_CONFIG_MODE==20" } }, { - "directive": "else", + "directive": "endif", "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1684, - "column": 10, - "source_line": " #else" + "line": 1309, + "column": 1, + "source_line": "#endif" } }, { - "directive": "endif", - "argument": null, + "directive": "ifndef", + "argument": "STBVOX_CONFIG_HLSL", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1688, - "column": 10, - "source_line": " #endif" + "line": 1311, + "column": 1, + "source_line": "#ifndef STBVOX_CONFIG_HLSL" } }, { @@ -8354,19 +9669,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1689, - "column": 7, - "source_line": " #endif" + "line": 1314, + "column": 1, + "source_line": "#endif" } }, { - "directive": "if", - "argument": "defined(STBVOX_CONFIG_LIGHTING) || defined(STBVOX_CONFIG_LIGHTING_SIMPLE)", + "directive": "ifdef", + "argument": "STBVOX_CONFIG_OPENGL_MODELVIEW", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1693, - "column": 7, - "source_line": " #if defined(STBVOX_CONFIG_LIGHTING) || defined(STBVOX_CONFIG_LIGHTING_SIMPLE)" + "line": 1316, + "column": 1, + "source_line": "#ifdef STBVOX_CONFIG_OPENGL_MODELVIEW" } }, { @@ -8374,59 +9689,59 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1695, - "column": 7, - "source_line": " #endif" + "line": 1318, + "column": 1, + "source_line": "#endif" } }, { "directive": "if", - "argument": "defined(STBVOX_CONFIG_FOG) || defined(STBVOX_CONFIG_FOG_SMOOTHSTEP)", + "argument": "defined(STBVOX_ICONFIG_VERTEX_32)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1696, - "column": 7, - "source_line": " #if defined(STBVOX_CONFIG_FOG) || defined(STBVOX_CONFIG_FOG_SMOOTHSTEP)" + "line": 1320, + "column": 1, + "source_line": "#if defined(STBVOX_ICONFIG_VERTEX_32)" } }, { - "directive": "endif", - "argument": null, + "directive": "elif", + "argument": "defined(STBVOX_ICONFIG_VERTEX_16_1)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1698, - "column": 7, - "source_line": " #endif" + "line": 1324, + "column": 1, + "source_line": "#elif defined(STBVOX_ICONFIG_VERTEX_16_1) // mode=2" } }, { - "directive": "ifndef", - "argument": "STBVOX_ICONFIG_UNTEXTURED", + "directive": "elif", + "argument": "defined(STBVOX_ICONFIG_VERTEX_16_2)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1705, - "column": 7, - "source_line": " #ifndef STBVOX_ICONFIG_UNTEXTURED" + "line": 1328, + "column": 1, + "source_line": "#elif defined(STBVOX_ICONFIG_VERTEX_16_2) // mode=3" } }, { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_PREFER_TEXBUFFER", + "directive": "elif", + "argument": "defined(STBVOX_ICONFIG_VERTEX_8)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1712, - "column": 10, - "source_line": " #ifndef STBVOX_CONFIG_PREFER_TEXBUFFER" + "line": 1332, + "column": 1, + "source_line": "#elif defined(STBVOX_ICONFIG_VERTEX_8)" } }, { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_DISABLE_TEX2", + "directive": "else", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1718, - "column": 13, - "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" + "line": 1336, + "column": 1, + "source_line": "#else" } }, { @@ -8434,29 +9749,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1720, - "column": 13, - "source_line": " #endif" + "line": 1338, + "column": 1, + "source_line": "#endif" } }, { - "directive": "else", - "argument": null, + "directive": "ifdef", + "argument": "STBVOX_ICONFIG_FACE1_1", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1721, - "column": 10, - "source_line": " #else" + "line": 1340, + "column": 1, + "source_line": "#ifdef STBVOX_ICONFIG_FACE1_1" } }, { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_DISABLE_TEX2", + "directive": "else", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1726, - "column": 13, - "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" + "line": 1345, + "column": 1, + "source_line": "#else" } }, { @@ -8464,49 +9779,49 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1728, - "column": 13, - "source_line": " #endif" + "line": 1347, + "column": 1, + "source_line": "#endif" } }, { - "directive": "endif", - "argument": null, + "directive": "if", + "argument": "defined(STBVOX_ICONFIG_OPENGL_3_1_COMPATIBILITY)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1729, - "column": 10, - "source_line": " #endif" + "line": 1560, + "column": 1, + "source_line": "#if defined(STBVOX_ICONFIG_OPENGL_3_1_COMPATIBILITY)" } }, { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_DISABLE_TEX2", + "directive": "elif", + "argument": "defined(STBVOX_ICONFIG_OPENGL_3_0)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1731, - "column": 10, - "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" + "line": 1562, + "column": 1, + "source_line": "#elif defined(STBVOX_ICONFIG_OPENGL_3_0)" } }, { - "directive": "endif", - "argument": null, + "directive": "elif", + "argument": "defined(STBVOX_ICONFIG_GLSL)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1734, - "column": 10, - "source_line": " #endif" + "line": 1564, + "column": 1, + "source_line": "#elif defined(STBVOX_ICONFIG_GLSL)" } }, { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_DISABLE_TEX2", + "directive": "else", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1741, - "column": 10, - "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" + "line": 1566, + "column": 1, + "source_line": "#else" } }, { @@ -8514,19 +9829,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1743, - "column": 10, - "source_line": " #endif" + "line": 1568, + "column": 1, + "source_line": "#endif" } }, { "directive": "ifdef", - "argument": "STBVOX_CONFIG_TEX1_EDGE_CLAMP", + "argument": "STBVOX_ICONFIG_FACE_ATTRIBUTE", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1745, - "column": 10, - "source_line": " #ifdef STBVOX_CONFIG_TEX1_EDGE_CLAMP" + "line": 1574, + "column": 4, + "source_line": " #ifdef STBVOX_ICONFIG_FACE_ATTRIBUTE // NOT TAG_face_sampled" } }, { @@ -8534,9 +9849,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1748, - "column": 10, - "source_line": " #else" + "line": 1576, + "column": 4, + "source_line": " #else" } }, { @@ -8544,49 +9859,39 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1750, - "column": 10, - "source_line": " #endif" - } - }, - { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_DISABLE_TEX2", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1752, - "column": 10, - "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" + "line": 1578, + "column": 4, + "source_line": " #endif" } }, { "directive": "ifdef", - "argument": "STBVOX_CONFIG_TEX2_EDGE_CLAMP", + "argument": "STBVOX_ICONFIG_FACE_ARRAY_2", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1753, - "column": 10, - "source_line": " #ifdef STBVOX_CONFIG_TEX2_EDGE_CLAMP" + "line": 1580, + "column": 4, + "source_line": " #ifdef STBVOX_ICONFIG_FACE_ARRAY_2" } }, { - "directive": "else", + "directive": "endif", "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1756, - "column": 10, - "source_line": " #else" + "line": 1582, + "column": 4, + "source_line": " #endif" } }, { - "directive": "endif", - "argument": null, + "directive": "ifndef", + "argument": "STBVOX_CONFIG_OPENGL_MODELVIEW", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1758, - "column": 10, - "source_line": " #endif" + "line": 1598, + "column": 7, + "source_line": " #ifndef STBVOX_CONFIG_OPENGL_MODELVIEW" } }, { @@ -8594,29 +9899,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1759, - "column": 10, - "source_line": " #endif" - } - }, - { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_DISABLE_TEX2", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1767, - "column": 10, - "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" + "line": 1600, + "column": 7, + "source_line": " #endif" } }, { "directive": "ifdef", - "argument": "STBVOX_CONFIG_PREMULTIPLIED_ALPHA", + "argument": "STBVOX_ICONFIG_FACE_ATTRIBUTE", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1770, - "column": 13, - "source_line": " #ifdef STBVOX_CONFIG_PREMULTIPLIED_ALPHA" + "line": 1612, + "column": 7, + "source_line": " #ifdef STBVOX_ICONFIG_FACE_ATTRIBUTE" } }, { @@ -8624,9 +9919,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1772, - "column": 13, - "source_line": " #else" + "line": 1614, + "column": 7, + "source_line": " #else" } }, { @@ -8634,39 +9929,39 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1774, - "column": 13, - "source_line": " #endif" + "line": 1617, + "column": 7, + "source_line": " #endif" } }, { "directive": "ifdef", - "argument": "STBVOX_CONFIG_PREMULTIPLIED_ALPHA", + "argument": "STBVOX_DEBUG_TEST_NORMALS", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1779, - "column": 13, - "source_line": " #ifdef STBVOX_CONFIG_PREMULTIPLIED_ALPHA" + "line": 1631, + "column": 7, + "source_line": " #ifdef STBVOX_DEBUG_TEST_NORMALS" } }, { - "directive": "else", + "directive": "endif", "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1781, - "column": 13, - "source_line": " #else" + "line": 1634, + "column": 7, + "source_line": " #endif" } }, { - "directive": "endif", - "argument": null, + "directive": "ifndef", + "argument": "STBVOX_CONFIG_OPENGL_MODELVIEW", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1783, - "column": 13, - "source_line": " #endif" + "line": 1636, + "column": 7, + "source_line": " #ifndef STBVOX_CONFIG_OPENGL_MODELVIEW" } }, { @@ -8674,9 +9969,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1786, - "column": 10, - "source_line": " #else" + "line": 1638, + "column": 7, + "source_line": " #else" } }, { @@ -8684,39 +9979,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1788, - "column": 10, - "source_line": " #endif" - } - }, - { - "directive": "else", - "argument": null, - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1790, + "line": 1640, "column": 7, - "source_line": " #else // UNTEXTURED" + "source_line": " #endif" } }, { - "directive": "endif", - "argument": null, + "directive": "if", + "argument": "defined(STBVOX_ICONFIG_GLSL)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1796, + "line": 1651, "column": 7, - "source_line": " #endif" + "source_line": " #if defined(STBVOX_ICONFIG_GLSL)" } }, { - "directive": "ifdef", - "argument": "STBVOX_ICONFIG_VARYING_VERTEX_NORMALS", + "directive": "elif", + "argument": "defined(STBVOX_CONFIG_HLSL)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1798, + "line": 1653, "column": 7, - "source_line": " #ifdef STBVOX_ICONFIG_VARYING_VERTEX_NORMALS" + "source_line": " #elif defined(STBVOX_CONFIG_HLSL)" } }, { @@ -8724,7 +10009,7 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1802, + "line": 1655, "column": 7, "source_line": " #else" } @@ -8734,19 +10019,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1804, + "line": 1657, "column": 7, "source_line": " #endif" } }, { - "directive": "if", - "argument": "defined(STBVOX_ICONFIG_LIGHTING) || defined(STBVOX_CONFIG_LIGHTING_SIMPLE)", + "directive": "ifndef", + "argument": "STBVOX_ICONFIG_UNTEXTURED", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1813, + "line": 1676, "column": 7, - "source_line": " #if defined(STBVOX_ICONFIG_LIGHTING) || defined(STBVOX_CONFIG_LIGHTING_SIMPLE)" + "source_line": " #ifndef STBVOX_ICONFIG_UNTEXTURED" + } + }, + { + "directive": "ifdef", + "argument": "STBVOX_CONFIG_PREFER_TEXBUFFER", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1680, + "column": 10, + "source_line": " #ifdef STBVOX_CONFIG_PREFER_TEXBUFFER" } }, { @@ -8754,9 +10049,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1815, - "column": 7, - "source_line": " #else" + "line": 1684, + "column": 10, + "source_line": " #else" } }, { @@ -8764,19 +10059,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1817, - "column": 7, - "source_line": " #endif" - } - }, - { - "directive": "if", - "argument": "defined(STBVOX_ICONFIG_FOG) || defined(STBVOX_CONFIG_FOG_SMOOTHSTEP)", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1821, - "column": 7, - "source_line": " #if defined(STBVOX_ICONFIG_FOG) || defined(STBVOX_CONFIG_FOG_SMOOTHSTEP)" + "line": 1688, + "column": 10, + "source_line": " #endif" } }, { @@ -8784,29 +10069,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1824, + "line": 1689, "column": 7, "source_line": " #endif" } }, { - "directive": "ifdef", - "argument": "STBVOX_CONFIG_UNPREMULTIPLY", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1826, - "column": 7, - "source_line": " #ifdef STBVOX_CONFIG_UNPREMULTIPLY" - } - }, - { - "directive": "else", - "argument": null, + "directive": "if", + "argument": "defined(STBVOX_CONFIG_LIGHTING) || defined(STBVOX_CONFIG_LIGHTING_SIMPLE)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1828, + "line": 1693, "column": 7, - "source_line": " #else" + "source_line": " #if defined(STBVOX_CONFIG_LIGHTING) || defined(STBVOX_CONFIG_LIGHTING_SIMPLE)" } }, { @@ -8814,19 +10089,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1830, + "line": 1695, "column": 7, "source_line": " #endif" } }, { - "directive": "ifdef", - "argument": "STBVOX_CONFIG_LIGHTING_SIMPLE", + "directive": "if", + "argument": "defined(STBVOX_CONFIG_FOG) || defined(STBVOX_CONFIG_FOG_SMOOTHSTEP)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1834, - "column": 4, - "source_line": " #ifdef STBVOX_CONFIG_LIGHTING_SIMPLE" + "line": 1696, + "column": 7, + "source_line": " #if defined(STBVOX_CONFIG_FOG) || defined(STBVOX_CONFIG_FOG_SMOOTHSTEP)" } }, { @@ -8834,39 +10109,39 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1844, - "column": 4, - "source_line": " #endif" + "line": 1698, + "column": 7, + "source_line": " #endif" } }, { - "directive": "ifdef", - "argument": "STBVOX_CONFIG_FOG_SMOOTHSTEP", + "directive": "ifndef", + "argument": "STBVOX_ICONFIG_UNTEXTURED", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1846, - "column": 4, - "source_line": " #ifdef STBVOX_CONFIG_FOG_SMOOTHSTEP" + "line": 1705, + "column": 7, + "source_line": " #ifndef STBVOX_ICONFIG_UNTEXTURED" } }, { - "directive": "ifdef", - "argument": "STBVOX_CONFIG_PREMULTIPLIED_ALPHA", + "directive": "ifndef", + "argument": "STBVOX_CONFIG_PREFER_TEXBUFFER", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1855, - "column": 7, - "source_line": " #ifdef STBVOX_CONFIG_PREMULTIPLIED_ALPHA" + "line": 1712, + "column": 10, + "source_line": " #ifndef STBVOX_CONFIG_PREFER_TEXBUFFER" } }, { - "directive": "else", - "argument": null, + "directive": "ifndef", + "argument": "STBVOX_CONFIG_DISABLE_TEX2", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1857, - "column": 7, - "source_line": " #else" + "line": 1718, + "column": 13, + "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" } }, { @@ -8874,49 +10149,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1859, - "column": 7, - "source_line": " #endif" + "line": 1720, + "column": 13, + "source_line": " #endif" } }, { - "directive": "endif", + "directive": "else", "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1861, - "column": 4, - "source_line": " #endif" + "line": 1721, + "column": 10, + "source_line": " #else" } }, { "directive": "ifndef", - "argument": "STBVOX_ICONFIG_UNTEXTURED", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1878, - "column": 4, - "source_line": " #ifndef STBVOX_ICONFIG_UNTEXTURED" - } - }, - { - "directive": "ifdef", - "argument": "STBVOX_CONFIG_PREFER_TEXBUFFER", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1882, - "column": 7, - "source_line": " #ifdef STBVOX_CONFIG_PREFER_TEXBUFFER" - } - }, - { - "directive": "else", - "argument": null, + "argument": "STBVOX_CONFIG_DISABLE_TEX2", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1885, - "column": 7, - "source_line": " #else" + "line": 1726, + "column": 13, + "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" } }, { @@ -8924,9 +10179,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1888, - "column": 7, - "source_line": " #endif" + "line": 1728, + "column": 13, + "source_line": " #endif" } }, { @@ -8934,39 +10189,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1889, - "column": 4, - "source_line": " #endif" - } - }, - { - "directive": "ifndef", - "argument": "STBVOX_ICONFIG_UNTEXTURED", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1898, - "column": 4, - "source_line": " #ifndef STBVOX_ICONFIG_UNTEXTURED" + "line": 1729, + "column": 10, + "source_line": " #endif" } }, { "directive": "ifndef", - "argument": "STBVOX_CONFIG_PREFER_TEXBUFFER", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1905, - "column": 7, - "source_line": " #ifndef STBVOX_CONFIG_PREFER_TEXBUFFER" - } - }, - { - "directive": "else", - "argument": null, + "argument": "STBVOX_CONFIG_DISABLE_TEX2", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1912, - "column": 7, - "source_line": " #else" + "line": 1731, + "column": 10, + "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" } }, { @@ -8974,9 +10209,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1918, - "column": 7, - "source_line": " #endif" + "line": 1734, + "column": 10, + "source_line": " #endif" } }, { @@ -8984,9 +10219,9 @@ "argument": "STBVOX_CONFIG_DISABLE_TEX2", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1920, - "column": 7, - "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" + "line": 1741, + "column": 10, + "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" } }, { @@ -8994,9 +10229,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1923, - "column": 7, - "source_line": " #endif" + "line": 1743, + "column": 10, + "source_line": " #endif" } }, { @@ -9004,9 +10239,9 @@ "argument": "STBVOX_CONFIG_TEX1_EDGE_CLAMP", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1935, - "column": 7, - "source_line": " #ifdef STBVOX_CONFIG_TEX1_EDGE_CLAMP" + "line": 1745, + "column": 10, + "source_line": " #ifdef STBVOX_CONFIG_TEX1_EDGE_CLAMP" } }, { @@ -9014,9 +10249,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1938, - "column": 7, - "source_line": " #else" + "line": 1748, + "column": 10, + "source_line": " #else" } }, { @@ -9024,9 +10259,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1940, - "column": 7, - "source_line": " #endif" + "line": 1750, + "column": 10, + "source_line": " #endif" } }, { @@ -9034,9 +10269,9 @@ "argument": "STBVOX_CONFIG_DISABLE_TEX2", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1945, - "column": 7, - "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" + "line": 1752, + "column": 10, + "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" } }, { @@ -9044,7 +10279,7 @@ "argument": "STBVOX_CONFIG_TEX2_EDGE_CLAMP", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1947, + "line": 1753, "column": 10, "source_line": " #ifdef STBVOX_CONFIG_TEX2_EDGE_CLAMP" } @@ -9054,7 +10289,7 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1950, + "line": 1756, "column": 10, "source_line": " #else" } @@ -9064,7 +10299,7 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1952, + "line": 1758, "column": 10, "source_line": " #endif" } @@ -9074,39 +10309,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1959, - "column": 7, - "source_line": " #endif" - } - }, - { - "directive": "else", - "argument": null, - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 1961, - "column": 4, - "source_line": " #else // UNTEXTURED" + "line": 1759, + "column": 10, + "source_line": " #endif" } }, { - "directive": "endif", - "argument": null, + "directive": "ifndef", + "argument": "STBVOX_CONFIG_DISABLE_TEX2", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1963, - "column": 4, - "source_line": " #endif" + "line": 1767, + "column": 10, + "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" } }, { "directive": "ifdef", - "argument": "STBVOX_CONFIG_PREFER_TEXBUFFER", + "argument": "STBVOX_CONFIG_PREMULTIPLIED_ALPHA", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1987, - "column": 1, - "source_line": "#ifdef STBVOX_CONFIG_PREFER_TEXBUFFER" + "line": 1770, + "column": 13, + "source_line": " #ifdef STBVOX_CONFIG_PREMULTIPLIED_ALPHA" } }, { @@ -9114,9 +10339,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1989, - "column": 1, - "source_line": "#else" + "line": 1772, + "column": 13, + "source_line": " #else" } }, { @@ -9124,19 +10349,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1991, - "column": 1, - "source_line": "#endif" + "line": 1774, + "column": 13, + "source_line": " #endif" } }, { "directive": "ifdef", - "argument": "STBVOX_ICONFIG_UNTEXTURED", + "argument": "STBVOX_CONFIG_PREMULTIPLIED_ALPHA", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2049, - "column": 4, - "source_line": " #ifdef STBVOX_ICONFIG_UNTEXTURED" + "line": 1779, + "column": 13, + "source_line": " #ifdef STBVOX_CONFIG_PREMULTIPLIED_ALPHA" } }, { @@ -9144,9 +10369,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2057, - "column": 4, - "source_line": " #else" + "line": 1781, + "column": 13, + "source_line": " #else" } }, { @@ -9154,19 +10379,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2139, - "column": 4, - "source_line": " #endif" + "line": 1783, + "column": 13, + "source_line": " #endif" } }, { - "directive": "ifdef", - "argument": "STBVOX_CONFIG_OPTIMIZED_VHEIGHT", + "directive": "else", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2425, - "column": 1, - "source_line": "#ifdef STBVOX_CONFIG_OPTIMIZED_VHEIGHT" + "line": 1786, + "column": 10, + "source_line": " #else" + } + }, + { + "directive": "endif", + "argument": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1788, + "column": 10, + "source_line": " #endif" } }, { @@ -9174,9 +10409,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2519, - "column": 1, - "source_line": "#else" + "line": 1790, + "column": 7, + "source_line": " #else // UNTEXTURED" } }, { @@ -9184,19 +10419,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2649, - "column": 1, - "source_line": "#endif" + "line": 1796, + "column": 7, + "source_line": " #endif" } }, { "directive": "ifdef", - "argument": "STBVOX_ICONFIG_FACE_ATTRIBUTE", + "argument": "STBVOX_ICONFIG_VARYING_VERTEX_NORMALS", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2664, - "column": 4, - "source_line": " #ifdef STBVOX_ICONFIG_FACE_ATTRIBUTE" + "line": 1798, + "column": 7, + "source_line": " #ifdef STBVOX_ICONFIG_VARYING_VERTEX_NORMALS" } }, { @@ -9204,9 +10439,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2670, - "column": 4, - "source_line": " #else" + "line": 1802, + "column": 7, + "source_line": " #else" } }, { @@ -9214,39 +10449,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2673, - "column": 4, - "source_line": " #endif" + "line": 1804, + "column": 7, + "source_line": " #endif" } }, { "directive": "if", - "argument": "defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED) && defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 2685, - "column": 4, - "source_line": " #if defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED) && defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)" - } - }, - { - "directive": "elif", - "argument": "defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)", + "argument": "defined(STBVOX_ICONFIG_LIGHTING) || defined(STBVOX_CONFIG_LIGHTING_SIMPLE)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2687, - "column": 4, - "source_line": " #elif defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)" + "line": 1813, + "column": 7, + "source_line": " #if defined(STBVOX_ICONFIG_LIGHTING) || defined(STBVOX_CONFIG_LIGHTING_SIMPLE)" } }, { - "directive": "elif", - "argument": "defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)", + "directive": "else", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2689, - "column": 4, - "source_line": " #elif defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)" + "line": 1815, + "column": 7, + "source_line": " #else" } }, { @@ -9254,19 +10479,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2691, - "column": 4, - "source_line": " #endif" + "line": 1817, + "column": 7, + "source_line": " #endif" } }, { "directive": "if", - "argument": "defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED) || defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)", + "argument": "defined(STBVOX_ICONFIG_FOG) || defined(STBVOX_CONFIG_FOG_SMOOTHSTEP)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2693, - "column": 4, - "source_line": " #if defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED) || defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)" + "line": 1821, + "column": 7, + "source_line": " #if defined(STBVOX_ICONFIG_FOG) || defined(STBVOX_CONFIG_FOG_SMOOTHSTEP)" } }, { @@ -9274,19 +10499,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2707, - "column": 4, - "source_line": " #endif" + "line": 1824, + "column": 7, + "source_line": " #endif" } }, { - "directive": "if", - "argument": "defined(STBVOX_CONFIG_UP_TEXLERP_PACKED) || defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)", + "directive": "ifdef", + "argument": "STBVOX_CONFIG_UNPREMULTIPLY", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2762, + "line": 1826, "column": 7, - "source_line": " #if defined(STBVOX_CONFIG_UP_TEXLERP_PACKED) || defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)" + "source_line": " #ifdef STBVOX_CONFIG_UNPREMULTIPLY" + } + }, + { + "directive": "else", + "argument": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1828, + "column": 7, + "source_line": " #else" } }, { @@ -9294,19 +10529,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2764, + "line": 1830, "column": 7, "source_line": " #endif" } }, { - "directive": "if", - "argument": "defined(STBVOX_CONFIG_UP_TEXLERP_PACKED) || defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)", + "directive": "ifdef", + "argument": "STBVOX_CONFIG_LIGHTING_SIMPLE", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2768, + "line": 1834, "column": 4, - "source_line": " #if defined(STBVOX_CONFIG_UP_TEXLERP_PACKED) || defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)" + "source_line": " #ifdef STBVOX_CONFIG_LIGHTING_SIMPLE" } }, { @@ -9314,49 +10549,49 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2770, + "line": 1844, "column": 4, "source_line": " #endif" } }, { - "directive": "if", - "argument": "defined(STBVOX_CONFIG_ROTATION_IN_LIGHTING) || defined(STBVOX_CONFIG_VHEIGHT_IN_LIGHTING)", + "directive": "ifdef", + "argument": "STBVOX_CONFIG_FOG_SMOOTHSTEP", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2789, - "column": 13, - "source_line": " #if defined(STBVOX_CONFIG_ROTATION_IN_LIGHTING) || defined(STBVOX_CONFIG_VHEIGHT_IN_LIGHTING)" + "line": 1846, + "column": 4, + "source_line": " #ifdef STBVOX_CONFIG_FOG_SMOOTHSTEP" } }, { - "directive": "else", - "argument": null, + "directive": "ifdef", + "argument": "STBVOX_CONFIG_PREMULTIPLIED_ALPHA", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2792, - "column": 13, - "source_line": " #else" + "line": 1855, + "column": 7, + "source_line": " #ifdef STBVOX_CONFIG_PREMULTIPLIED_ALPHA" } }, { - "directive": "endif", + "directive": "else", "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2795, - "column": 13, - "source_line": " #endif" + "line": 1857, + "column": 7, + "source_line": " #else" } }, { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_OPTIMIZED_VHEIGHT", + "directive": "endif", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2841, - "column": 1, - "source_line": "#ifndef STBVOX_CONFIG_OPTIMIZED_VHEIGHT" + "line": 1859, + "column": 7, + "source_line": " #endif" } }, { @@ -9364,39 +10599,49 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2887, - "column": 1, - "source_line": "#endif" + "line": 1861, + "column": 4, + "source_line": " #endif" } }, { "directive": "ifndef", - "argument": "STBVOX_CONFIG_PRECISION_Z", + "argument": "STBVOX_ICONFIG_UNTEXTURED", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2889, - "column": 1, - "source_line": "#ifndef STBVOX_CONFIG_PRECISION_Z" + "line": 1878, + "column": 4, + "source_line": " #ifndef STBVOX_ICONFIG_UNTEXTURED" } }, { - "directive": "endif", + "directive": "ifdef", + "argument": "STBVOX_CONFIG_PREFER_TEXBUFFER", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1882, + "column": 7, + "source_line": " #ifdef STBVOX_CONFIG_PREFER_TEXBUFFER" + } + }, + { + "directive": "else", "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2891, - "column": 1, - "source_line": "#endif" + "line": 1885, + "column": 7, + "source_line": " #else" } }, { - "directive": "ifdef", - "argument": "STBVOX_CONFIG_ROTATION_IN_LIGHTING", + "directive": "endif", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2918, - "column": 4, - "source_line": " #ifdef STBVOX_CONFIG_ROTATION_IN_LIGHTING" + "line": 1888, + "column": 7, + "source_line": " #endif" } }, { @@ -9404,39 +10649,39 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2920, + "line": 1889, "column": 4, "source_line": " #endif" } }, { "directive": "ifndef", - "argument": "STBVOX_CONFIG_ROTATION_IN_LIGHTING", + "argument": "STBVOX_ICONFIG_UNTEXTURED", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3006, - "column": 10, - "source_line": " #ifndef STBVOX_CONFIG_ROTATION_IN_LIGHTING" + "line": 1898, + "column": 4, + "source_line": " #ifndef STBVOX_ICONFIG_UNTEXTURED" } }, { - "directive": "endif", - "argument": null, + "directive": "ifndef", + "argument": "STBVOX_CONFIG_PREFER_TEXBUFFER", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3016, - "column": 10, - "source_line": " #endif" + "line": 1905, + "column": 7, + "source_line": " #ifndef STBVOX_CONFIG_PREFER_TEXBUFFER" } }, { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_ROTATION_IN_LIGHTING", + "directive": "else", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3018, - "column": 10, - "source_line": " #ifndef STBVOX_CONFIG_ROTATION_IN_LIGHTING" + "line": 1912, + "column": 7, + "source_line": " #else" } }, { @@ -9444,29 +10689,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3027, - "column": 10, - "source_line": " #endif" + "line": 1918, + "column": 7, + "source_line": " #endif" } }, { "directive": "ifndef", - "argument": "STBVOX_CONFIG_ROTATION_IN_LIGHTING", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 3031, - "column": 4, - "source_line": " #ifndef STBVOX_CONFIG_ROTATION_IN_LIGHTING" - } - }, - { - "directive": "else", - "argument": null, + "argument": "STBVOX_CONFIG_DISABLE_TEX2", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3041, - "column": 4, - "source_line": " #else" + "line": 1920, + "column": 7, + "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" } }, { @@ -9474,19 +10709,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3049, - "column": 4, - "source_line": " #endif" + "line": 1923, + "column": 7, + "source_line": " #endif" } }, { "directive": "ifdef", - "argument": "STBVOX_CONFIG_VHEIGHT_IN_LIGHTING", + "argument": "STBVOX_CONFIG_TEX1_EDGE_CLAMP", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3210, + "line": 1935, "column": 7, - "source_line": " #ifdef STBVOX_CONFIG_VHEIGHT_IN_LIGHTING" + "source_line": " #ifdef STBVOX_CONFIG_TEX1_EDGE_CLAMP" } }, { @@ -9494,7 +10729,7 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3215, + "line": 1938, "column": 7, "source_line": " #else" } @@ -9504,19 +10739,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3247, + "line": 1940, "column": 7, "source_line": " #endif" } }, { "directive": "ifndef", - "argument": "STBVOX_CONFIG_OPTIMIZED_VHEIGHT", + "argument": "STBVOX_CONFIG_DISABLE_TEX2", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3299, + "line": 1945, + "column": 7, + "source_line": " #ifndef STBVOX_CONFIG_DISABLE_TEX2" + } + }, + { + "directive": "ifdef", + "argument": "STBVOX_CONFIG_TEX2_EDGE_CLAMP", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1947, "column": 10, - "source_line": " #ifndef STBVOX_CONFIG_OPTIMIZED_VHEIGHT" + "source_line": " #ifdef STBVOX_CONFIG_TEX2_EDGE_CLAMP" } }, { @@ -9524,7 +10769,7 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3309, + "line": 1950, "column": 10, "source_line": " #else" } @@ -9534,19 +10779,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3311, + "line": 1952, "column": 10, "source_line": " #endif" } }, { - "directive": "ifndef", - "argument": "STBVOX_CONFIG_OPTIMIZED_VHEIGHT", + "directive": "endif", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3319, - "column": 10, - "source_line": " #ifndef STBVOX_CONFIG_OPTIMIZED_VHEIGHT" + "line": 1959, + "column": 7, + "source_line": " #endif" } }, { @@ -9554,9 +10799,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3329, - "column": 10, - "source_line": " #else" + "line": 1961, + "column": 4, + "source_line": " #else // UNTEXTURED" } }, { @@ -9564,19 +10809,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3331, - "column": 10, - "source_line": " #endif" + "line": 1963, + "column": 4, + "source_line": " #endif" } }, { - "directive": "if", - "argument": "STBVOX_CONFIG_PRECISION_Z == 1", + "directive": "ifdef", + "argument": "STBVOX_CONFIG_PREFER_TEXBUFFER", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3448, - "column": 7, - "source_line": " #if STBVOX_CONFIG_PRECISION_Z == 1" + "line": 1987, + "column": 1, + "source_line": "#ifdef STBVOX_CONFIG_PREFER_TEXBUFFER" } }, { @@ -9584,9 +10829,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3450, - "column": 7, - "source_line": " #else" + "line": 1989, + "column": 1, + "source_line": "#else" } }, { @@ -9594,19 +10839,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3452, - "column": 7, - "source_line": " #endif" + "line": 1991, + "column": 1, + "source_line": "#endif" } }, { "directive": "ifdef", - "argument": "STBVOX_ICONFIG_FACE_ATTRIBUTE", + "argument": "STBVOX_ICONFIG_UNTEXTURED", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3471, - "column": 7, - "source_line": " #ifdef STBVOX_ICONFIG_FACE_ATTRIBUTE" + "line": 2049, + "column": 4, + "source_line": " #ifdef STBVOX_ICONFIG_UNTEXTURED" } }, { @@ -9614,9 +10859,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3477, - "column": 7, - "source_line": " #else" + "line": 2057, + "column": 4, + "source_line": " #else" } }, { @@ -9624,19 +10869,19 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3485, - "column": 7, - "source_line": " #endif" + "line": 2139, + "column": 4, + "source_line": " #endif" } }, { - "directive": "if", - "argument": "STBVOX_CONFIG_PRECISION_Z==1", + "directive": "ifdef", + "argument": "STBVOX_CONFIG_OPTIMIZED_VHEIGHT", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3603, - "column": 4, - "source_line": " #if STBVOX_CONFIG_PRECISION_Z==1" + "line": 2425, + "column": 1, + "source_line": "#ifdef STBVOX_CONFIG_OPTIMIZED_VHEIGHT" } }, { @@ -9644,9 +10889,9 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3605, - "column": 4, - "source_line": " #else" + "line": 2519, + "column": 1, + "source_line": "#else" } }, { @@ -9654,29 +10899,29 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3607, - "column": 4, - "source_line": " #endif" + "line": 2649, + "column": 1, + "source_line": "#endif" } }, { - "directive": "if", - "argument": "0", + "directive": "ifdef", + "argument": "STBVOX_ICONFIG_FACE_ATTRIBUTE", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3657, - "column": 1, - "source_line": "#if 0" + "line": 2664, + "column": 4, + "source_line": " #ifdef STBVOX_ICONFIG_FACE_ATTRIBUTE" } }, { - "directive": "endif", + "directive": "else", "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3703, - "column": 1, - "source_line": "#endif" + "line": 2670, + "column": 4, + "source_line": " #else" } }, { @@ -9684,1037 +10929,1026 @@ "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3765, - "column": 1, - "source_line": "#endif // STB_VOXEL_RENDER_IMPLEMENTATION" + "line": 2673, + "column": 4, + "source_line": " #endif" } - } - ], - "macro_dependencies": [ + }, { - "name": "STBVXDEC", - "context": "declaration", + "directive": "if", + "argument": "defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED) && defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1970, - "column": 1, - "source_line": "STBVXDEC char *stbvox_get_vertex_shader(void)" - }, - "source_text": "STBVXDEC char *stbvox_get_vertex_shader(void)" + "line": 2685, + "column": 4, + "source_line": " #if defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED) && defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)" + } }, { - "name": "STBVXDEC", - "context": "declaration", + "directive": "elif", + "argument": "defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1975, - "column": 1, - "source_line": "STBVXDEC char *stbvox_get_fragment_shader(void)" - }, - "source_text": "STBVXDEC char *stbvox_get_fragment_shader(void)" + "line": 2687, + "column": 4, + "source_line": " #elif defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)" + } }, { - "name": "STBVXDEC", - "context": "declaration", + "directive": "elif", + "argument": "defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1980, - "column": 1, - "source_line": "STBVXDEC char *stbvox_get_fragment_shader_alpha_only(void)" - }, - "source_text": "STBVXDEC char *stbvox_get_fragment_shader_alpha_only(void)" + "line": 2689, + "column": 4, + "source_line": " #elif defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)" + } }, { - "name": "STBVXDEC", - "context": "declaration", + "directive": "endif", + "argument": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2006, - "column": 1, - "source_line": "STBVXDEC int stbvox_get_uniform_info(stbvox_uniform_info *info, int uniform)" - }, - "source_text": "STBVXDEC int stbvox_get_uniform_info(stbvox_uniform_info *info, int uniform)" - } - ], - "diagnostics": [ + "line": 2691, + "column": 4, + "source_line": " #endif" + } + }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_GEOMETRY' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "if", + "argument": "defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED) || defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1155, - "column": 1, - "source_line": "#define STBVOX_MAKE_GEOMETRY(geom, rotate, vheight) ((geom) + (rotate)*16 + (vheight)*64)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_GEOMETRY" + "line": 2693, + "column": 4, + "source_line": " #if defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED) || defined(STBVOX_CONFIG_UP_TEXLERP_PACKED)" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_VHEIGHT' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1156, - "column": 1, - "source_line": "#define STBVOX_MAKE_VHEIGHT(v_sw, v_se, v_nw, v_ne) ((v_sw) + (v_se)*4 + (v_nw)*16 + (v_ne)*64)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_VHEIGHT" + "line": 2707, + "column": 4, + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_MATROT' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "if", + "argument": "defined(STBVOX_CONFIG_UP_TEXLERP_PACKED) || defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1157, - "column": 1, - "source_line": "#define STBVOX_MAKE_MATROT(block, overlay, color) ((block) + (overlay)*4 + (color)*64)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_MATROT" + "line": 2762, + "column": 7, + "source_line": " #if defined(STBVOX_CONFIG_UP_TEXLERP_PACKED) || defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_TEX2_REPLACE' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1158, - "column": 1, - "source_line": "#define STBVOX_MAKE_TEX2_REPLACE(tex2, tex2_replace_face) ((tex2) + ((tex2_replace_face) & 3)*64)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_TEX2_REPLACE" + "line": 2764, + "column": 7, + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_TEXLERP' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "if", + "argument": "defined(STBVOX_CONFIG_UP_TEXLERP_PACKED) || defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1159, - "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP(ns2, ew2, ud2, vert) ((ew2) + (ns2)*4 + (ud2)*16 + (vert)*64)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_TEXLERP" + "line": 2768, + "column": 4, + "source_line": " #if defined(STBVOX_CONFIG_UP_TEXLERP_PACKED) || defined(STBVOX_CONFIG_DOWN_TEXLERP_PACKED)" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_TEXLERP_SIMPLE' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1160, - "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP_SIMPLE(baselerp,vert,face) ((vert)*32 + (face)*4 + (baselerp))" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_TEXLERP_SIMPLE" + "line": 2770, + "column": 4, + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_TEXLERP1' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "if", + "argument": "defined(STBVOX_CONFIG_ROTATION_IN_LIGHTING) || defined(STBVOX_CONFIG_VHEIGHT_IN_LIGHTING)", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1161, - "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP1(vert,e2,n2,w2,s2,u4,d2) STBVOX_MAKE_TEXLERP(s2, w2, d2, vert)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_TEXLERP1" + "line": 2789, + "column": 13, + "source_line": " #if defined(STBVOX_CONFIG_ROTATION_IN_LIGHTING) || defined(STBVOX_CONFIG_VHEIGHT_IN_LIGHTING)" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_TEXLERP2' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "else", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1162, - "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP2(vert,e2,n2,w2,s2,u4,d2) ((u2)*16 + (n2)*4 + (s2))" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_TEXLERP2" + "line": 2792, + "column": 13, + "source_line": " #else" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_FACE_MASK' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1163, - "column": 1, - "source_line": "#define STBVOX_MAKE_FACE_MASK(e,n,w,s,u,d) ((e)+(n)*2+(w)*4+(s)*8+(u)*16+(d)*32)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_FACE_MASK" + "line": 2795, + "column": 13, + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_SIDE_TEXROT' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "ifndef", + "argument": "STBVOX_CONFIG_OPTIMIZED_VHEIGHT", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1164, + "line": 2841, "column": 1, - "source_line": "#define STBVOX_MAKE_SIDE_TEXROT(e,n,w,s) ((e)+(n)*4+(w)*16+(s)*64)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_SIDE_TEXROT" + "source_line": "#ifndef STBVOX_CONFIG_OPTIMIZED_VHEIGHT" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_COLOR' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1165, + "line": 2887, "column": 1, - "source_line": "#define STBVOX_MAKE_COLOR(color,t1,t2) ((color)+(t1)*64+(t2)*128)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_COLOR" + "source_line": "#endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_TEXLERP_VERT3' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "ifndef", + "argument": "STBVOX_CONFIG_PRECISION_Z", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1166, + "line": 2889, "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP_VERT3(e,n,w,s,u) ((e)+(n)*8+(w)*64+(s)*512+(u)*4096)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_TEXLERP_VERT3" + "source_line": "#ifndef STBVOX_CONFIG_PRECISION_Z" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_TEXLERP_FACE3' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1167, + "line": 2891, "column": 1, - "source_line": "#define STBVOX_MAKE_TEXLERP_FACE3(e,n,w,s,u,d) ((e)+(n)*8+(w)*64+(s)*512+(u)*4096+(d)*16384)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_TEXLERP_FACE3" + "source_line": "#endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_PACKED_COMPACT' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "ifdef", + "argument": "STBVOX_CONFIG_ROTATION_IN_LIGHTING", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1168, - "column": 1, - "source_line": "#define STBVOX_MAKE_PACKED_COMPACT(rot, vheight, texlerp, def) ((rot)+4*(vheight)+16*(use)+32*(texlerp))" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_PACKED_COMPACT" + "line": 2918, + "column": 4, + "source_line": " #ifdef STBVOX_CONFIG_ROTATION_IN_LIGHTING" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_LIGHTING_EXT' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1170, - "column": 1, - "source_line": "#define STBVOX_MAKE_LIGHTING_EXT(lighting, rot) (((lighting)&~3)+(rot))" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_LIGHTING_EXT" + "line": 2920, + "column": 4, + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_MAKE_LIGHTING' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "ifndef", + "argument": "STBVOX_CONFIG_ROTATION_IN_LIGHTING", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1171, - "column": 1, - "source_line": "#define STBVOX_MAKE_LIGHTING(lighting) (lighting)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_MAKE_LIGHTING" + "line": 3006, + "column": 10, + "source_line": " #ifndef STBVOX_CONFIG_ROTATION_IN_LIGHTING" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_NOTUSED' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1233, - "column": 4, - "source_line": " #define STBVOX_NOTUSED(v) (void)(v)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_NOTUSED" + "line": 3016, + "column": 10, + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_NOTUSED' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "ifndef", + "argument": "STBVOX_CONFIG_ROTATION_IN_LIGHTING", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1235, - "column": 4, - "source_line": " #define STBVOX_NOTUSED(v) (void)sizeof(v)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_NOTUSED" + "line": 3018, + "column": 10, + "source_line": " #ifndef STBVOX_CONFIG_ROTATION_IN_LIGHTING" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'stbvox_vertex_encode' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1322, - "column": 4, - "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" - }, - "unit_kind": "macro", - "unit_name": "stbvox_vertex_encode" + "line": 3027, + "column": 10, + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'stbvox_vertex_encode' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "ifndef", + "argument": "STBVOX_CONFIG_ROTATION_IN_LIGHTING", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1326, + "line": 3031, "column": 4, - "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" - }, - "unit_kind": "macro", - "unit_name": "stbvox_vertex_encode" + "source_line": " #ifndef STBVOX_CONFIG_ROTATION_IN_LIGHTING" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'stbvox_vertex_encode' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "else", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1330, + "line": 3041, "column": 4, - "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" - }, - "unit_kind": "macro", - "unit_name": "stbvox_vertex_encode" + "source_line": " #else" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'stbvox_vertex_encode' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1334, + "line": 3049, "column": 4, - "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" - }, - "unit_kind": "macro", - "unit_name": "stbvox_vertex_encode" - }, - { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_GET_GEO' is recorded but not expanded.", - "severity": "warning", - "location": { - "filename": "stb/stb_voxel_render.h", - "line": 2015, - "column": 1, - "source_line": "#define STBVOX_GET_GEO(geom_data) ((geom_data) & 15)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_GET_GEO" + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_ROTATE' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "ifdef", + "argument": "STBVOX_CONFIG_VHEIGHT_IN_LIGHTING", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2040, - "column": 1, - "source_line": "#define STBVOX_ROTATE(x,r) stbvox_rotate_face[x][r] // (((x)+(r))&3)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_ROTATE" + "line": 3210, + "column": 7, + "source_line": " #ifdef STBVOX_CONFIG_VHEIGHT_IN_LIGHTING" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_HEIGHTS' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "else", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2392, - "column": 4, - "source_line": " #define STBVOX_HEIGHTS(a,b,c,d,e,f,g,h) \\" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_HEIGHTS" + "line": 3215, + "column": 7, + "source_line": " #else" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_USE_PACKED' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2686, + "line": 3247, "column": 7, - "source_line": " #define STBVOX_USE_PACKED(f) ((f) == STBVOX_FACE_up || (f) == STBVOX_FACE_down)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_USE_PACKED" + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_USE_PACKED' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "ifndef", + "argument": "STBVOX_CONFIG_OPTIMIZED_VHEIGHT", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2688, - "column": 7, - "source_line": " #define STBVOX_USE_PACKED(f) ((f) == STBVOX_FACE_up )" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_USE_PACKED" + "line": 3299, + "column": 10, + "source_line": " #ifndef STBVOX_CONFIG_OPTIMIZED_VHEIGHT" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_USE_PACKED' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "else", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2690, - "column": 7, - "source_line": " #define STBVOX_USE_PACKED(f) ( (f) == STBVOX_FACE_down)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_USE_PACKED" + "line": 3309, + "column": 10, + "source_line": " #else" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_GET_LIGHTING' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2790, - "column": 13, - "source_line": " #define STBVOX_GET_LIGHTING(light) ((light) & ~3)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_GET_LIGHTING" + "line": 3311, + "column": 10, + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", - "message": "Function-like macro 'STBVOX_GET_LIGHTING' is recorded but not expanded.", - "severity": "warning", - "location": { + "directive": "ifndef", + "argument": "STBVOX_CONFIG_OPTIMIZED_VHEIGHT", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2793, - "column": 13, - "source_line": " #define STBVOX_GET_LIGHTING(light) (light)" - }, - "unit_kind": "macro", - "unit_name": "STBVOX_GET_LIGHTING" + "line": 3319, + "column": 10, + "source_line": " #ifndef STBVOX_CONFIG_OPTIMIZED_VHEIGHT" + } }, { - "code": "C_UNSUPPORTED_DECLARATOR", - "message": "Unsupported declarator syntax after parsed type layers: '\"C\"'.", - "severity": "warning", - "location": { + "directive": "else", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 243, - "column": 1, - "source_line": "extern \"C\" {" - }, - "unit_kind": "declarator", - "unit_name": null + "line": 3329, + "column": 10, + "source_line": " #else" + } }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1428, - "column": 1, - "source_line": "static float stbvox_default_texgen[2][32][3] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "line": 3331, + "column": 10, + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { + "directive": "if", + "argument": "STBVOX_CONFIG_PRECISION_Z == 1", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1455, - "column": 1, - "source_line": "static float stbvox_default_normals[32][3] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "line": 3448, + "column": 7, + "source_line": " #if STBVOX_CONFIG_PRECISION_Z == 1" + } }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { - "filename": "stb/stb_voxel_render.h", - "line": 1494, - "column": 1, - "source_line": "static float stbvox_default_texscale[128][4] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "directive": "else", + "argument": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3450, + "column": 7, + "source_line": " #else" + } }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1514, - "column": 1, - "source_line": "static unsigned char stbvox_default_palette_compact[64][3] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "line": 3452, + "column": 7, + "source_line": " #endif" + } }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { + "directive": "ifdef", + "argument": "STBVOX_ICONFIG_FACE_ATTRIBUTE", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1534, - "column": 1, - "source_line": "static float stbvox_default_ambient[4][4] =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "line": 3471, + "column": 7, + "source_line": " #ifdef STBVOX_ICONFIG_FACE_ATTRIBUTE" + } }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { + "directive": "else", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1570, - "column": 1, - "source_line": "static const char *stbvox_vertex_program =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "line": 3477, + "column": 7, + "source_line": " #else" + } }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1646, + "line": 3485, + "column": 7, + "source_line": " #endif" + } + }, + { + "directive": "if", + "argument": "STBVOX_CONFIG_PRECISION_Z==1", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3603, + "column": 4, + "source_line": " #if STBVOX_CONFIG_PRECISION_Z==1" + } + }, + { + "directive": "else", + "argument": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3605, + "column": 4, + "source_line": " #else" + } + }, + { + "directive": "endif", + "argument": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3607, + "column": 4, + "source_line": " #endif" + } + }, + { + "directive": "if", + "argument": "0", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3657, "column": 1, - "source_line": "static const char *stbvox_fragment_program =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "source_line": "#if 0" + } }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1866, + "line": 3703, "column": 1, - "source_line": "static const char *stbvox_fragment_program_alpha_only =" - }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "source_line": "#endif" + } }, { - "code": "C_MACRO_DEPENDENT_DECLARATION", - "message": "Declaration depends on object-like macro 'STBVXDEC'; provide preprocessed input to parse it.", - "severity": "warning", - "location": { + "directive": "endif", + "argument": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3765, + "column": 1, + "source_line": "#endif // STB_VOXEL_RENDER_IMPLEMENTATION" + } + } + ], + "macro_dependencies": [ + { + "name": "STBVXDEC", + "context": "declaration", + "source_location": { "filename": "stb/stb_voxel_render.h", "line": 1970, "column": 1, "source_line": "STBVXDEC char *stbvox_get_vertex_shader(void)" }, - "unit_kind": "macro_dependent_declaration", - "unit_name": "STBVXDEC" + "source_text": "STBVXDEC char *stbvox_get_vertex_shader(void)" }, { - "code": "C_MACRO_DEPENDENT_DECLARATION", - "message": "Declaration depends on object-like macro 'STBVXDEC'; provide preprocessed input to parse it.", - "severity": "warning", - "location": { + "name": "STBVXDEC", + "context": "declaration", + "source_location": { "filename": "stb/stb_voxel_render.h", "line": 1975, "column": 1, "source_line": "STBVXDEC char *stbvox_get_fragment_shader(void)" }, - "unit_kind": "macro_dependent_declaration", - "unit_name": "STBVXDEC" + "source_text": "STBVXDEC char *stbvox_get_fragment_shader(void)" }, { - "code": "C_MACRO_DEPENDENT_DECLARATION", - "message": "Declaration depends on object-like macro 'STBVXDEC'; provide preprocessed input to parse it.", - "severity": "warning", - "location": { + "name": "STBVXDEC", + "context": "declaration", + "source_location": { "filename": "stb/stb_voxel_render.h", "line": 1980, "column": 1, "source_line": "STBVXDEC char *stbvox_get_fragment_shader_alpha_only(void)" }, - "unit_kind": "macro_dependent_declaration", - "unit_name": "STBVXDEC" + "source_text": "STBVXDEC char *stbvox_get_fragment_shader_alpha_only(void)" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", - "severity": "warning", - "location": { + "name": "STBVXDEC", + "context": "declaration", + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1993, + "line": 2006, "column": 1, - "source_line": "static stbvox_uniform_info stbvox_uniforms[] =" + "source_line": "STBVXDEC int stbvox_get_uniform_info(stbvox_uniform_info *info, int uniform)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null - }, + "source_text": "STBVXDEC int stbvox_get_uniform_info(stbvox_uniform_info *info, int uniform)" + } + ], + "diagnostics": [ { - "code": "C_MACRO_DEPENDENT_DECLARATION", - "message": "Declaration depends on object-like macro 'STBVXDEC'; provide preprocessed input to parse it.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_GEOMETRY' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2006, + "line": 1155, "column": 1, - "source_line": "STBVXDEC int stbvox_get_uniform_info(stbvox_uniform_info *info, int uniform)" + "source_line": "#define STBVOX_MAKE_GEOMETRY(geom, rotate, vheight) ((geom) + (rotate)*16 + (vheight)*64)" }, - "unit_kind": "macro_dependent_declaration", - "unit_name": "STBVXDEC" + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_GEOMETRY" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_VHEIGHT' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2030, + "line": 1156, "column": 1, - "source_line": "static unsigned char stbvox_rotate_face[6][4] =" + "source_line": "#define STBVOX_MAKE_VHEIGHT(v_sw, v_se, v_nw, v_ne) ((v_sw) + (v_se)*4 + (v_nw)*16 + (v_ne)*64)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_VHEIGHT" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_MATROT' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2162, + "line": 1157, "column": 1, - "source_line": "static unsigned char stbvox_face_lerp[6] = { 0,2,0,2,4,4 };" + "source_line": "#define STBVOX_MAKE_MATROT(block, overlay, color) ((block) + (overlay)*4 + (color)*64)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_MATROT" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_TEX2_REPLACE' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2163, + "line": 1158, "column": 1, - "source_line": "static unsigned char stbvox_vert3_lerp[5] = { 0,3,6,9,12 };" + "source_line": "#define STBVOX_MAKE_TEX2_REPLACE(tex2, tex2_replace_face) ((tex2) + ((tex2_replace_face) & 3)*64)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_TEX2_REPLACE" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_TEXLERP' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2164, + "line": 1159, "column": 1, - "source_line": "static unsigned char stbvox_vert_lerp_for_face_lerp[4] = { 0, 4, 7, 7 };" + "source_line": "#define STBVOX_MAKE_TEXLERP(ns2, ew2, ud2, vert) ((ew2) + (ns2)*4 + (ud2)*16 + (vert)*64)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_TEXLERP" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_TEXLERP_SIMPLE' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2165, + "line": 1160, "column": 1, - "source_line": "static unsigned char stbvox_face3_lerp[6] = { 0,3,6,9,12,14 };" + "source_line": "#define STBVOX_MAKE_TEXLERP_SIMPLE(baselerp,vert,face) ((vert)*32 + (face)*4 + (baselerp))" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_TEXLERP_SIMPLE" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_TEXLERP1' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2166, + "line": 1161, "column": 1, - "source_line": "static unsigned char stbvox_vert_lerp_for_simple[4] = { 0,2,5,7 };" + "source_line": "#define STBVOX_MAKE_TEXLERP1(vert,e2,n2,w2,s2,u4,d2) STBVOX_MAKE_TEXLERP(s2, w2, d2, vert)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_TEXLERP1" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_TEXLERP2' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2167, + "line": 1162, "column": 1, - "source_line": "static unsigned char stbvox_face3_updown[8] = { 0,2,5,7,0,2,5,7 }; // ignore top bit" + "source_line": "#define STBVOX_MAKE_TEXLERP2(vert,e2,n2,w2,s2,u4,d2) ((u2)*16 + (n2)*4 + (s2))" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_TEXLERP2" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_FACE_MASK' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2170, + "line": 1163, "column": 1, - "source_line": "static unsigned char stbvox_vertex_vector[6][4][3] =" + "source_line": "#define STBVOX_MAKE_FACE_MASK(e,n,w,s,u,d) ((e)+(n)*2+(w)*4+(s)*8+(u)*16+(d)*32)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_FACE_MASK" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_SIDE_TEXROT' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2181, + "line": 1164, "column": 1, - "source_line": "static unsigned char stbvox_vertex_selector[6][4] =" + "source_line": "#define STBVOX_MAKE_SIDE_TEXROT(e,n,w,s) ((e)+(n)*4+(w)*16+(s)*64)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_SIDE_TEXROT" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_COLOR' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2191, + "line": 1165, "column": 1, - "source_line": "static stbvox_mesh_vertex stbvox_vmesh_delta_normal[6][4] =" + "source_line": "#define STBVOX_MAKE_COLOR(color,t1,t2) ((color)+(t1)*64+(t2)*128)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_COLOR" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_TEXLERP_VERT3' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2219, + "line": 1166, "column": 1, - "source_line": "static stbvox_mesh_vertex stbvox_vmesh_pre_vheight[6][4] =" + "source_line": "#define STBVOX_MAKE_TEXLERP_VERT3(e,n,w,s,u) ((e)+(n)*8+(w)*64+(s)*512+(u)*4096)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_TEXLERP_VERT3" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_TEXLERP_FACE3' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2247, + "line": 1167, "column": 1, - "source_line": "static stbvox_mesh_vertex stbvox_vmesh_delta_half_z[6][4] =" + "source_line": "#define STBVOX_MAKE_TEXLERP_FACE3(e,n,w,s,u,d) ((e)+(n)*8+(w)*64+(s)*512+(u)*4096+(d)*16384)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_TEXLERP_FACE3" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_PACKED_COMPACT' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2275, + "line": 1168, "column": 1, - "source_line": "static stbvox_mesh_vertex stbvox_vmesh_crossed_pair[6][4] =" + "source_line": "#define STBVOX_MAKE_PACKED_COMPACT(rot, vheight, texlerp, def) ((rot)+4*(vheight)+16*(use)+32*(texlerp))" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_PACKED_COMPACT" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_LIGHTING_EXT' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2308, + "line": 1170, "column": 1, - "source_line": "static unsigned char stbvox_hasface[STBVOX_MAX_GEOM][STBVOX_NUM_ROTATION] =" + "source_line": "#define STBVOX_MAKE_LIGHTING_EXT(lighting, rot) (((lighting)&~3)+(rot))" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_LIGHTING_EXT" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_MAKE_LIGHTING' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2329, + "line": 1171, "column": 1, - "source_line": "static unsigned char stbvox_facetype[STBVOX_GEOM_count][6] =" + "source_line": "#define STBVOX_MAKE_LIGHTING(lighting) (lighting)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_MAKE_LIGHTING" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_NOTUSED' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2354, - "column": 1, - "source_line": "static unsigned char stbvox_floor_slope_for_rot[4] =" + "line": 1233, + "column": 4, + "source_line": " #define STBVOX_NOTUSED(v) (void)(v)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_NOTUSED" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_NOTUSED' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2362, - "column": 1, - "source_line": "static unsigned char stbvox_ceil_slope_for_rot[4] =" + "line": 1235, + "column": 4, + "source_line": " #define STBVOX_NOTUSED(v) (void)sizeof(v)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_NOTUSED" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'stbvox_vertex_encode' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2372, - "column": 1, - "source_line": "static unsigned short stbvox_face_visible[STBVOX_FT_count] =" + "line": 1322, + "column": 4, + "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "stbvox_vertex_encode" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'stbvox_vertex_encode' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2390, - "column": 1, - "source_line": "static stbvox_mesh_vertex stbvox_geometry_vheight[8][8] =" + "line": 1326, + "column": 4, + "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "stbvox_vertex_encode" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'stbvox_vertex_encode' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2413, - "column": 1, - "source_line": "static unsigned char stbvox_rotate_vertex[8][4] =" + "line": 1330, + "column": 4, + "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "stbvox_vertex_encode" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'stbvox_vertex_encode' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2427, - "column": 1, - "source_line": "static unsigned char stbvox_optimized_face_up_normal[4][4][4][4] =" + "line": 1334, + "column": 4, + "source_line": " #define stbvox_vertex_encode(x,y,z,ao,texlerp) \\" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "stbvox_vertex_encode" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_GET_GEO' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2523, + "line": 2015, "column": 1, - "source_line": "static unsigned char stbvox_planar_face_up_normal[4][4][4] =" + "source_line": "#define STBVOX_GET_GEO(geom_data) ((geom_data) & 15)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_GET_GEO" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_ROTATE' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2550, + "line": 2040, "column": 1, - "source_line": "static unsigned char stbvox_face_up_normal_012[4][4][4] =" + "source_line": "#define STBVOX_ROTATE(x,r) stbvox_rotate_face[x][r] // (((x)+(r))&3)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_ROTATE" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_HEIGHTS' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2575, - "column": 1, - "source_line": "static unsigned char stbvox_face_up_normal_013[4][4][4] =" + "line": 2392, + "column": 4, + "source_line": " #define STBVOX_HEIGHTS(a,b,c,d,e,f,g,h) \\" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_HEIGHTS" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_USE_PACKED' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2600, - "column": 1, - "source_line": "static unsigned char stbvox_face_up_normal_023[4][4][4] =" + "line": 2686, + "column": 7, + "source_line": " #define STBVOX_USE_PACKED(f) ((f) == STBVOX_FACE_up || (f) == STBVOX_FACE_down)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_USE_PACKED" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_USE_PACKED' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2625, - "column": 1, - "source_line": "static unsigned char stbvox_face_up_normal_123[4][4][4] =" + "line": 2688, + "column": 7, + "source_line": " #define STBVOX_USE_PACKED(f) ((f) == STBVOX_FACE_up )" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_USE_PACKED" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_USE_PACKED' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 2833, - "column": 1, - "source_line": "static unsigned char stbvox_reverse_face[STBVF_count] =" + "line": 2690, + "column": 7, + "source_line": " #define STBVOX_USE_PACKED(f) ( (f) == STBVOX_FACE_down)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_USE_PACKED" }, { - "code": "C_UNSUPPORTED_DECLARATION", - "message": "Braced or designated initializer declarations are not supported yet.", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_GET_LIGHTING' is recorded but not expanded.", "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 3659, - "column": 1, - "source_line": "static char *normal_names[32] =" + "line": 2790, + "column": 13, + "source_line": " #define STBVOX_GET_LIGHTING(light) ((light) & ~3)" }, - "unit_kind": "braced_initializer_declaration", - "unit_name": null + "unit_kind": "macro", + "unit_name": "STBVOX_GET_LIGHTING" }, { - "code": "C_CONFLICTING_TYPEDEF", - "message": "Conflicting typedef declarations for 'stbvox_block_type'.", - "severity": "error", + "code": "C_UNSUPPORTED_FUNCTION_LIKE_MACRO", + "message": "Function-like macro 'STBVOX_GET_LIGHTING' is recorded but not expanded.", + "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 707, - "column": 1, - "source_line": "typedef unsigned char stbvox_block_type;" + "line": 2793, + "column": 13, + "source_line": " #define STBVOX_GET_LIGHTING(light) (light)" }, - "unit_kind": "typedef", - "unit_name": "stbvox_block_type" + "unit_kind": "macro", + "unit_name": "STBVOX_GET_LIGHTING" }, { - "code": "C_CONFLICTING_TYPEDEF", - "message": "Conflicting typedef declarations for 'stbvox_uint16'.", - "severity": "error", + "code": "C_UNSUPPORTED_DECLARATOR", + "message": "Unsupported declarator syntax after parsed type layers: '\"C\"'.", + "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 1228, - "column": 4, - "source_line": " typedef unsigned short stbvox_uint16;" + "line": 243, + "column": 1, + "source_line": "extern \"C\" {" }, - "unit_kind": "typedef", - "unit_name": "stbvox_uint16" + "unit_kind": "declarator", + "unit_name": null }, { - "code": "C_CONFLICTING_TYPEDEF", - "message": "Conflicting typedef declarations for 'stbvox_uint32'.", - "severity": "error", + "code": "C_MACRO_DEPENDENT_DECLARATION", + "message": "Declaration depends on object-like macro 'STBVXDEC'; provide preprocessed input to parse it.", + "severity": "warning", "location": { "filename": "stb/stb_voxel_render.h", - "line": 1229, - "column": 4, - "source_line": " typedef unsigned int stbvox_uint32;" + "line": 1970, + "column": 1, + "source_line": "STBVXDEC char *stbvox_get_vertex_shader(void)" }, - "unit_kind": "typedef", - "unit_name": "stbvox_uint32" + "unit_kind": "macro_dependent_declaration", + "unit_name": "STBVXDEC" }, { - "code": "C_CONFLICTING_TYPEDEF", - "message": "Conflicting typedef declarations for 'stbvox_mesh_vertex'.", + "code": "C_MACRO_DEPENDENT_DECLARATION", + "message": "Declaration depends on object-like macro 'STBVXDEC'; provide preprocessed input to parse it.", + "severity": "warning", + "location": { + "filename": "stb/stb_voxel_render.h", + "line": 1975, + "column": 1, + "source_line": "STBVXDEC char *stbvox_get_fragment_shader(void)" + }, + "unit_kind": "macro_dependent_declaration", + "unit_name": "STBVXDEC" + }, + { + "code": "C_MACRO_DEPENDENT_DECLARATION", + "message": "Declaration depends on object-like macro 'STBVXDEC'; provide preprocessed input to parse it.", + "severity": "warning", + "location": { + "filename": "stb/stb_voxel_render.h", + "line": 1980, + "column": 1, + "source_line": "STBVXDEC char *stbvox_get_fragment_shader_alpha_only(void)" + }, + "unit_kind": "macro_dependent_declaration", + "unit_name": "STBVXDEC" + }, + { + "code": "C_MACRO_DEPENDENT_DECLARATION", + "message": "Declaration depends on object-like macro 'STBVXDEC'; provide preprocessed input to parse it.", + "severity": "warning", + "location": { + "filename": "stb/stb_voxel_render.h", + "line": 2006, + "column": 1, + "source_line": "STBVXDEC int stbvox_get_uniform_info(stbvox_uniform_info *info, int uniform)" + }, + "unit_kind": "macro_dependent_declaration", + "unit_name": "STBVXDEC" + }, + { + "code": "C_CONFLICTING_TYPEDEF", + "message": "Conflicting typedef declarations for 'stbvox_block_type'.", + "severity": "error", + "location": { + "filename": "stb/stb_voxel_render.h", + "line": 707, + "column": 1, + "source_line": "typedef unsigned char stbvox_block_type;" + }, + "unit_kind": "typedef", + "unit_name": "stbvox_block_type" + }, + { + "code": "C_CONFLICTING_TYPEDEF", + "message": "Conflicting typedef declarations for 'stbvox_uint16'.", + "severity": "error", + "location": { + "filename": "stb/stb_voxel_render.h", + "line": 1228, + "column": 4, + "source_line": " typedef unsigned short stbvox_uint16;" + }, + "unit_kind": "typedef", + "unit_name": "stbvox_uint16" + }, + { + "code": "C_CONFLICTING_TYPEDEF", + "message": "Conflicting typedef declarations for 'stbvox_uint32'.", + "severity": "error", + "location": { + "filename": "stb/stb_voxel_render.h", + "line": 1229, + "column": 4, + "source_line": " typedef unsigned int stbvox_uint32;" + }, + "unit_kind": "typedef", + "unit_name": "stbvox_uint32" + }, + { + "code": "C_CONFLICTING_TYPEDEF", + "message": "Conflicting typedef declarations for 'stbvox_mesh_vertex'.", "severity": "error", "location": { "filename": "stb/stb_voxel_render.h", @@ -10748,52 +11982,1445 @@ "column": 4, "source_line": " typedef stbvox_uint8 stbvox_mesh_vertex;" }, - "unit_kind": "typedef", - "unit_name": "stbvox_mesh_vertex" + "unit_kind": "typedef", + "unit_name": "stbvox_mesh_vertex" + } + ] + } + }, + "functions": { + "stbvox_build_default_palette": { + "name": "stbvox_build_default_palette", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [], + "storage": [ + "static" + ], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1544, + "column": 1, + "source_line": "static void stbvox_build_default_palette(void)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 1544, + "column": 1, + "source_line": "static void stbvox_build_default_palette(void)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 1553, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_compute_mesh_face_value": { + "name": "stbvox_compute_mesh_face_value", + "result_type": { + "reference": "stbvox_mesh_face" + }, + "parameters": [ + { + "name": "mm", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "rot", + "type": { + "reference": "stbvox_rotate" + }, + "declared_type": { + "reference": "stbvox_rotate" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "face", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int face" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int face" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "v_off", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "normal", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int normal" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int normal" + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 2042, + "column": 1, + "source_line": "stbvox_mesh_face stbvox_compute_mesh_face_value(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, int normal)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 2042, + "column": 1, + "source_line": "stbvox_mesh_face stbvox_compute_mesh_face_value(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, int normal)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 2143, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_get_quad_vertex_pointer": { + "name": "stbvox_get_quad_vertex_pointer", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [ + { + "name": "mm", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "mesh", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int mesh" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int mesh" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "vertices", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_vertex **vertices", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_vertex **vertices", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "face", + "type": { + "reference": "stbvox_mesh_face" + }, + "declared_type": { + "reference": "stbvox_mesh_face" + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 2651, + "column": 1, + "source_line": "void stbvox_get_quad_vertex_pointer(stbvox_mesh_maker *mm, int mesh, stbvox_mesh_vertex **vertices, stbvox_mesh_face face)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 2651, + "column": 1, + "source_line": "void stbvox_get_quad_vertex_pointer(stbvox_mesh_maker *mm, int mesh, stbvox_mesh_vertex **vertices, stbvox_mesh_face face)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 2674, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_make_mesh_for_face": { + "name": "stbvox_make_mesh_for_face", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [ + { + "name": "mm", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "rot", + "type": { + "reference": "stbvox_rotate" + }, + "declared_type": { + "reference": "stbvox_rotate" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "face", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int face" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int face" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "v_off", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "pos", + "type": { + "reference": "stbvox_pos" + }, + "declared_type": { + "reference": "stbvox_pos" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "vertbase", + "type": { + "reference": "stbvox_mesh_vertex" + }, + "declared_type": { + "reference": "stbvox_mesh_vertex" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "face_coord", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_vertex *face_coord", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_vertex *face_coord", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "mesh", + "type": { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char mesh" + }, + "declared_type": { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char mesh" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "normal", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int normal" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int normal" + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 2676, + "column": 1, + "source_line": "void stbvox_make_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, int normal)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 2676, + "column": 1, + "source_line": "void stbvox_make_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, int normal)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 2830, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_make_12_split_mesh_for_face": { + "name": "stbvox_make_12_split_mesh_for_face", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [ + { + "name": "mm", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "rot", + "type": { + "reference": "stbvox_rotate" + }, + "declared_type": { + "reference": "stbvox_rotate" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "face", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int face" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int face" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "v_off", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "pos", + "type": { + "reference": "stbvox_pos" + }, + "declared_type": { + "reference": "stbvox_pos" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "vertbase", + "type": { + "reference": "stbvox_mesh_vertex" + }, + "declared_type": { + "reference": "stbvox_mesh_vertex" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "face_coord", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_vertex *face_coord", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_vertex *face_coord", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "mesh", + "type": { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char mesh" + }, + "declared_type": { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char mesh" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "ht", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "unsigned char *ht", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "unsigned char *ht", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [ + "static" + ], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 2843, + "column": 1, + "source_line": "static void stbvox_make_12_split_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, unsigned char *ht)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 2843, + "column": 1, + "source_line": "static void stbvox_make_12_split_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, unsigned char *ht)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 2864, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_make_03_split_mesh_for_face": { + "name": "stbvox_make_03_split_mesh_for_face", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [ + { + "name": "mm", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "rot", + "type": { + "reference": "stbvox_rotate" + }, + "declared_type": { + "reference": "stbvox_rotate" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "face", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int face" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int face" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "v_off", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "pos", + "type": { + "reference": "stbvox_pos" + }, + "declared_type": { + "reference": "stbvox_pos" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "vertbase", + "type": { + "reference": "stbvox_mesh_vertex" + }, + "declared_type": { + "reference": "stbvox_mesh_vertex" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "face_coord", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_vertex *face_coord", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_vertex *face_coord", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "mesh", + "type": { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char mesh" + }, + "declared_type": { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char mesh" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "ht", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "unsigned char *ht", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "unsigned char *ht", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [ + "static" + ], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 2866, + "column": 1, + "source_line": "static void stbvox_make_03_split_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, unsigned char *ht)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 2866, + "column": 1, + "source_line": "static void stbvox_make_03_split_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, unsigned char *ht)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 2886, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_make_mesh_for_block": { + "name": "stbvox_make_mesh_for_block", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [ + { + "name": "mm", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "pos", + "type": { + "reference": "stbvox_pos" + }, + "declared_type": { + "reference": "stbvox_pos" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "v_off", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "vmesh", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_vertex *vmesh", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_vertex *vmesh", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [ + "static" + ], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 2894, + "column": 1, + "source_line": "static void stbvox_make_mesh_for_block(stbvox_mesh_maker *mm, stbvox_pos pos, int v_off, stbvox_mesh_vertex *vmesh)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 2894, + "column": 1, + "source_line": "static void stbvox_make_mesh_for_block(stbvox_mesh_maker *mm, stbvox_pos pos, int v_off, stbvox_mesh_vertex *vmesh)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 2953, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_make_mesh_for_block_with_geo": { + "name": "stbvox_make_mesh_for_block_with_geo", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [ + { + "name": "mm", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "pos", + "type": { + "reference": "stbvox_pos" + }, + "declared_type": { + "reference": "stbvox_pos" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "v_off", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int v_off" + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [ + "static" + ], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 2963, + "column": 1, + "source_line": "static void stbvox_make_mesh_for_block_with_geo(stbvox_mesh_maker *mm, stbvox_pos pos, int v_off)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 2963, + "column": 1, + "source_line": "static void stbvox_make_mesh_for_block_with_geo(stbvox_mesh_maker *mm, stbvox_pos pos, int v_off)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 3397, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_make_mesh_for_column": { + "name": "stbvox_make_mesh_for_column", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [ + { + "name": "mm", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "x", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int x" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int x" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "y", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int y" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int y" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "z0", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int z0" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int z0" + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [ + "static" + ], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3399, + "column": 1, + "source_line": "static void stbvox_make_mesh_for_column(stbvox_mesh_maker *mm, int x, int y, int z0)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 3399, + "column": 1, + "source_line": "static void stbvox_make_mesh_for_column(stbvox_mesh_maker *mm, int x, int y, int z0)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 3465, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_bring_up_to_date": { + "name": "stbvox_bring_up_to_date", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [ + { + "name": "mm", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [ + "static" + ], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3467, + "column": 1, + "source_line": "static void stbvox_bring_up_to_date(stbvox_mesh_maker *mm)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 3467, + "column": 1, + "source_line": "static void stbvox_bring_up_to_date(stbvox_mesh_maker *mm)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 3489, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_make_mesh": { + "name": "stbvox_make_mesh", + "result_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int" + }, + "parameters": [ + { + "name": "mm", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "declared_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] + }, + "source_location": null, + "callback_policy": null } - ] - } - }, - "functions": { - "stbvox_build_default_palette": { - "name": "stbvox_build_default_palette", - "result_type": { - "model": "CVoid", - "qualifiers": [], - "source_text": "void" - }, - "parameters": [], - "storage": [ - "static" ], + "storage": [], "specifiers": [], "is_variadic": false, "is_definition": true, "prototype_style": "prototype", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 1544, + "line": 3491, "column": 1, - "source_line": "static void stbvox_build_default_palette(void)" + "source_line": "int stbvox_make_mesh(stbvox_mesh_maker *mm)" }, "start": { "filename": "stb/stb_voxel_render.h", - "line": 1544, + "line": 3491, "column": 1, - "source_line": "static void stbvox_build_default_palette(void)" + "source_line": "int stbvox_make_mesh(stbvox_mesh_maker *mm)" }, "end": { "filename": "stb/stb_voxel_render.h", - "line": 1553, + "line": 3520, "column": 1, "source_line": "}" }, "declaration_locations": [] }, - "stbvox_compute_mesh_face_value": { - "name": "stbvox_compute_mesh_face_value", + "stbvox_init_mesh_maker": { + "name": "stbvox_init_mesh_maker", "result_type": { - "reference": "stbvox_mesh_face" + "model": "CVoid", + "qualifiers": [], + "source_text": "void" }, "parameters": [ { @@ -10830,59 +13457,72 @@ }, "source_location": null, "callback_policy": null - }, - { - "name": "rot", - "type": { - "reference": "stbvox_rotate" - }, - "declared_type": { - "reference": "stbvox_rotate" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "face", - "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int face" - }, - "declared_type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int face" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "v_off", - "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int v_off" - }, - "declared_type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int v_off" - }, - "source_location": null, - "callback_policy": null - }, + } + ], + "storage": [], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3522, + "column": 1, + "source_line": "void stbvox_init_mesh_maker(stbvox_mesh_maker *mm)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 3522, + "column": 1, + "source_line": "void stbvox_init_mesh_maker(stbvox_mesh_maker *mm)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 3529, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_get_buffer_count": { + "name": "stbvox_get_buffer_count", + "result_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int" + }, + "parameters": [ { - "name": "normal", + "name": "mm", "type": { - "model": "CInt", + "model": "CComposedType", "qualifiers": [], - "source_text": "int normal" + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] }, "declared_type": { - "model": "CInt", + "model": "CComposedType", "qualifiers": [], - "source_text": "int normal" + "source_text": "stbvox_mesh_maker *mm", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "reference": "stbvox_mesh_maker" + } + ] }, "source_location": null, "callback_policy": null @@ -10895,30 +13535,30 @@ "prototype_style": "prototype", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2042, + "line": 3531, "column": 1, - "source_line": "stbvox_mesh_face stbvox_compute_mesh_face_value(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, int normal)" + "source_line": "int stbvox_get_buffer_count(stbvox_mesh_maker *mm)" }, "start": { "filename": "stb/stb_voxel_render.h", - "line": 2042, + "line": 3531, "column": 1, - "source_line": "stbvox_mesh_face stbvox_compute_mesh_face_value(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, int normal)" + "source_line": "int stbvox_get_buffer_count(stbvox_mesh_maker *mm)" }, "end": { "filename": "stb/stb_voxel_render.h", - "line": 2143, + "line": 3535, "column": 1, "source_line": "}" }, "declaration_locations": [] }, - "stbvox_get_quad_vertex_pointer": { - "name": "stbvox_get_quad_vertex_pointer", + "stbvox_get_buffer_size_per_quad": { + "name": "stbvox_get_buffer_size_per_quad", "result_type": { - "model": "CVoid", + "model": "CInt", "qualifiers": [], - "source_text": "void" + "source_text": "int" }, "parameters": [ { @@ -10957,26 +13597,60 @@ "callback_policy": null }, { - "name": "mesh", + "name": "n", "type": { "model": "CInt", "qualifiers": [], - "source_text": "int mesh" + "source_text": "int n" }, "declared_type": { "model": "CInt", "qualifiers": [], - "source_text": "int mesh" + "source_text": "int n" }, "source_location": null, "callback_policy": null - }, + } + ], + "storage": [], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3537, + "column": 1, + "source_line": "int stbvox_get_buffer_size_per_quad(stbvox_mesh_maker *mm, int n)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 3537, + "column": 1, + "source_line": "int stbvox_get_buffer_size_per_quad(stbvox_mesh_maker *mm, int n)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 3540, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_reset_buffers": { + "name": "stbvox_reset_buffers", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [ { - "name": "vertices", + "name": "mm", "type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_vertex **vertices", + "source_text": "stbvox_mesh_maker *mm", "components": [ { "model": "CPointer", @@ -10984,19 +13658,14 @@ "source_text": "" }, { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_vertex" + "reference": "stbvox_mesh_maker" } ] }, "declared_type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_vertex **vertices", + "source_text": "stbvox_mesh_maker *mm", "components": [ { "model": "CPointer", @@ -11004,28 +13673,12 @@ "source_text": "" }, { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_vertex" + "reference": "stbvox_mesh_maker" } ] }, "source_location": null, "callback_policy": null - }, - { - "name": "face", - "type": { - "reference": "stbvox_mesh_face" - }, - "declared_type": { - "reference": "stbvox_mesh_face" - }, - "source_location": null, - "callback_policy": null } ], "storage": [], @@ -11035,26 +13688,26 @@ "prototype_style": "prototype", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2651, + "line": 3542, "column": 1, - "source_line": "void stbvox_get_quad_vertex_pointer(stbvox_mesh_maker *mm, int mesh, stbvox_mesh_vertex **vertices, stbvox_mesh_face face)" + "source_line": "void stbvox_reset_buffers(stbvox_mesh_maker *mm)" }, "start": { "filename": "stb/stb_voxel_render.h", - "line": 2651, + "line": 3542, "column": 1, - "source_line": "void stbvox_get_quad_vertex_pointer(stbvox_mesh_maker *mm, int mesh, stbvox_mesh_vertex **vertices, stbvox_mesh_face face)" + "source_line": "void stbvox_reset_buffers(stbvox_mesh_maker *mm)" }, "end": { "filename": "stb/stb_voxel_render.h", - "line": 2674, + "line": 3549, "column": 1, "source_line": "}" }, "declaration_locations": [] }, - "stbvox_make_mesh_for_face": { - "name": "stbvox_make_mesh_for_face", + "stbvox_set_buffer": { + "name": "stbvox_set_buffer", "result_type": { "model": "CVoid", "qualifiers": [], @@ -11097,74 +13750,41 @@ "callback_policy": null }, { - "name": "rot", - "type": { - "reference": "stbvox_rotate" - }, - "declared_type": { - "reference": "stbvox_rotate" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "face", + "name": "mesh", "type": { "model": "CInt", "qualifiers": [], - "source_text": "int face" + "source_text": "int mesh" }, "declared_type": { "model": "CInt", "qualifiers": [], - "source_text": "int face" + "source_text": "int mesh" }, "source_location": null, "callback_policy": null }, { - "name": "v_off", + "name": "slot", "type": { "model": "CInt", "qualifiers": [], - "source_text": "int v_off" + "source_text": "int slot" }, "declared_type": { "model": "CInt", "qualifiers": [], - "source_text": "int v_off" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "pos", - "type": { - "reference": "stbvox_pos" - }, - "declared_type": { - "reference": "stbvox_pos" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "vertbase", - "type": { - "reference": "stbvox_mesh_vertex" - }, - "declared_type": { - "reference": "stbvox_mesh_vertex" + "source_text": "int slot" }, "source_location": null, "callback_policy": null }, { - "name": "face_coord", + "name": "buffer", "type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_vertex *face_coord", + "source_text": "void *buffer", "components": [ { "model": "CPointer", @@ -11172,14 +13792,16 @@ "source_text": "" }, { - "reference": "stbvox_mesh_vertex" + "model": "CVoid", + "qualifiers": [], + "source_text": "void" } ] }, "declared_type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_vertex *face_coord", + "source_text": "void *buffer", "components": [ { "model": "CPointer", @@ -11187,7 +13809,9 @@ "source_text": "" }, { - "reference": "stbvox_mesh_vertex" + "model": "CVoid", + "qualifiers": [], + "source_text": "void" } ] }, @@ -11195,31 +13819,12 @@ "callback_policy": null }, { - "name": "mesh", - "type": { - "model": "CUnsignedChar", - "qualifiers": [], - "source_text": "unsigned char mesh" - }, - "declared_type": { - "model": "CUnsignedChar", - "qualifiers": [], - "source_text": "unsigned char mesh" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "normal", + "name": "len", "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int normal" + "reference": "size_t" }, "declared_type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int normal" + "reference": "size_t" }, "source_location": null, "callback_policy": null @@ -11232,26 +13837,26 @@ "prototype_style": "prototype", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2676, + "line": 3551, "column": 1, - "source_line": "void stbvox_make_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, int normal)" + "source_line": "void stbvox_set_buffer(stbvox_mesh_maker *mm, int mesh, int slot, void *buffer, size_t len)" }, "start": { "filename": "stb/stb_voxel_render.h", - "line": 2676, + "line": 3551, "column": 1, - "source_line": "void stbvox_make_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, int normal)" + "source_line": "void stbvox_set_buffer(stbvox_mesh_maker *mm, int mesh, int slot, void *buffer, size_t len)" }, "end": { "filename": "stb/stb_voxel_render.h", - "line": 2830, + "line": 3564, "column": 1, "source_line": "}" }, "declaration_locations": [] }, - "stbvox_make_12_split_mesh_for_face": { - "name": "stbvox_make_12_split_mesh_for_face", + "stbvox_set_default_mesh": { + "name": "stbvox_set_default_mesh", "result_type": { "model": "CVoid", "qualifiers": [], @@ -11294,74 +13899,60 @@ "callback_policy": null }, { - "name": "rot", - "type": { - "reference": "stbvox_rotate" - }, - "declared_type": { - "reference": "stbvox_rotate" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "face", - "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int face" - }, - "declared_type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int face" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "v_off", + "name": "mesh", "type": { "model": "CInt", "qualifiers": [], - "source_text": "int v_off" + "source_text": "int mesh" }, "declared_type": { "model": "CInt", "qualifiers": [], - "source_text": "int v_off" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "pos", - "type": { - "reference": "stbvox_pos" - }, - "declared_type": { - "reference": "stbvox_pos" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "vertbase", - "type": { - "reference": "stbvox_mesh_vertex" - }, - "declared_type": { - "reference": "stbvox_mesh_vertex" + "source_text": "int mesh" }, "source_location": null, "callback_policy": null - }, + } + ], + "storage": [], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3566, + "column": 1, + "source_line": "void stbvox_set_default_mesh(stbvox_mesh_maker *mm, int mesh)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 3566, + "column": 1, + "source_line": "void stbvox_set_default_mesh(stbvox_mesh_maker *mm, int mesh)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 3569, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_get_quad_count": { + "name": "stbvox_get_quad_count", + "result_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int" + }, + "parameters": [ { - "name": "face_coord", + "name": "mm", "type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_vertex *face_coord", + "source_text": "stbvox_mesh_maker *mm", "components": [ { "model": "CPointer", @@ -11369,14 +13960,14 @@ "source_text": "" }, { - "reference": "stbvox_mesh_vertex" + "reference": "stbvox_mesh_maker" } ] }, "declared_type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_vertex *face_coord", + "source_text": "stbvox_mesh_maker *mm", "components": [ { "model": "CPointer", @@ -11384,7 +13975,7 @@ "source_text": "" }, { - "reference": "stbvox_mesh_vertex" + "reference": "stbvox_mesh_maker" } ] }, @@ -11394,24 +13985,68 @@ { "name": "mesh", "type": { - "model": "CUnsignedChar", + "model": "CInt", "qualifiers": [], - "source_text": "unsigned char mesh" + "source_text": "int mesh" }, "declared_type": { - "model": "CUnsignedChar", + "model": "CInt", + "qualifiers": [], + "source_text": "int mesh" + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3571, + "column": 1, + "source_line": "int stbvox_get_quad_count(stbvox_mesh_maker *mm, int mesh)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 3571, + "column": 1, + "source_line": "int stbvox_get_quad_count(stbvox_mesh_maker *mm, int mesh)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 3574, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_get_input_description": { + "name": "stbvox_get_input_description", + "result_type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "stbvox_input_description", + "components": [ + { + "model": "CPointer", "qualifiers": [], - "source_text": "unsigned char mesh" + "source_text": "" }, - "source_location": null, - "callback_policy": null - }, + { + "reference": "stbvox_input_description" + } + ] + }, + "parameters": [ { - "name": "ht", + "name": "mm", "type": { "model": "CComposedType", "qualifiers": [], - "source_text": "unsigned char *ht", + "source_text": "stbvox_mesh_maker *mm", "components": [ { "model": "CPointer", @@ -11419,16 +14054,14 @@ "source_text": "" }, { - "model": "CUnsignedChar", - "qualifiers": [], - "source_text": "unsigned char" + "reference": "stbvox_mesh_maker" } ] }, "declared_type": { "model": "CComposedType", "qualifiers": [], - "source_text": "unsigned char *ht", + "source_text": "stbvox_mesh_maker *mm", "components": [ { "model": "CPointer", @@ -11436,9 +14069,7 @@ "source_text": "" }, { - "model": "CUnsignedChar", - "qualifiers": [], - "source_text": "unsigned char" + "reference": "stbvox_mesh_maker" } ] }, @@ -11446,35 +14077,33 @@ "callback_policy": null } ], - "storage": [ - "static" - ], + "storage": [], "specifiers": [], "is_variadic": false, "is_definition": true, "prototype_style": "prototype", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2843, + "line": 3576, "column": 1, - "source_line": "static void stbvox_make_12_split_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, unsigned char *ht)" + "source_line": "stbvox_input_description *stbvox_get_input_description(stbvox_mesh_maker *mm)" }, "start": { "filename": "stb/stb_voxel_render.h", - "line": 2843, + "line": 3576, "column": 1, - "source_line": "static void stbvox_make_12_split_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, unsigned char *ht)" + "source_line": "stbvox_input_description *stbvox_get_input_description(stbvox_mesh_maker *mm)" }, "end": { "filename": "stb/stb_voxel_render.h", - "line": 2864, + "line": 3579, "column": 1, "source_line": "}" }, "declaration_locations": [] }, - "stbvox_make_03_split_mesh_for_face": { - "name": "stbvox_make_03_split_mesh_for_face", + "stbvox_set_input_range": { + "name": "stbvox_set_input_range", "result_type": { "model": "CVoid", "qualifiers": [], @@ -11517,74 +14146,135 @@ "callback_policy": null }, { - "name": "rot", + "name": "x0", "type": { - "reference": "stbvox_rotate" + "model": "CInt", + "qualifiers": [], + "source_text": "int x0" }, "declared_type": { - "reference": "stbvox_rotate" + "model": "CInt", + "qualifiers": [], + "source_text": "int x0" }, "source_location": null, "callback_policy": null }, { - "name": "face", + "name": "y0", "type": { "model": "CInt", "qualifiers": [], - "source_text": "int face" + "source_text": "int y0" }, "declared_type": { "model": "CInt", "qualifiers": [], - "source_text": "int face" + "source_text": "int y0" }, "source_location": null, "callback_policy": null }, { - "name": "v_off", + "name": "z0", "type": { "model": "CInt", "qualifiers": [], - "source_text": "int v_off" + "source_text": "int z0" }, "declared_type": { "model": "CInt", "qualifiers": [], - "source_text": "int v_off" + "source_text": "int z0" }, "source_location": null, "callback_policy": null }, { - "name": "pos", + "name": "x1", "type": { - "reference": "stbvox_pos" + "model": "CInt", + "qualifiers": [], + "source_text": "int x1" }, "declared_type": { - "reference": "stbvox_pos" + "model": "CInt", + "qualifiers": [], + "source_text": "int x1" }, "source_location": null, "callback_policy": null }, { - "name": "vertbase", + "name": "y1", "type": { - "reference": "stbvox_mesh_vertex" + "model": "CInt", + "qualifiers": [], + "source_text": "int y1" }, "declared_type": { - "reference": "stbvox_mesh_vertex" + "model": "CInt", + "qualifiers": [], + "source_text": "int y1" }, "source_location": null, "callback_policy": null }, { - "name": "face_coord", + "name": "z1", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int z1" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int z1" + }, + "source_location": null, + "callback_policy": null + } + ], + "storage": [], + "specifiers": [], + "is_variadic": false, + "is_definition": true, + "prototype_style": "prototype", + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 3581, + "column": 1, + "source_line": "void stbvox_set_input_range(stbvox_mesh_maker *mm, int x0, int y0, int z0, int x1, int y1, int z1)" + }, + "start": { + "filename": "stb/stb_voxel_render.h", + "line": 3581, + "column": 1, + "source_line": "void stbvox_set_input_range(stbvox_mesh_maker *mm, int x0, int y0, int z0, int x1, int y1, int z1)" + }, + "end": { + "filename": "stb/stb_voxel_render.h", + "line": 3596, + "column": 1, + "source_line": "}" + }, + "declaration_locations": [] + }, + "stbvox_get_transform": { + "name": "stbvox_get_transform", + "result_type": { + "model": "CVoid", + "qualifiers": [], + "source_text": "void" + }, + "parameters": [ + { + "name": "mm", "type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_vertex *face_coord", + "source_text": "stbvox_mesh_maker *mm", "components": [ { "model": "CPointer", @@ -11592,14 +14282,14 @@ "source_text": "" }, { - "reference": "stbvox_mesh_vertex" + "reference": "stbvox_mesh_maker" } ] }, "declared_type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_vertex *face_coord", + "source_text": "stbvox_mesh_maker *mm", "components": [ { "model": "CPointer", @@ -11607,7 +14297,7 @@ "source_text": "" }, { - "reference": "stbvox_mesh_vertex" + "reference": "stbvox_mesh_maker" } ] }, @@ -11615,26 +14305,11 @@ "callback_policy": null }, { - "name": "mesh", - "type": { - "model": "CUnsignedChar", - "qualifiers": [], - "source_text": "unsigned char mesh" - }, - "declared_type": { - "model": "CUnsignedChar", - "qualifiers": [], - "source_text": "unsigned char mesh" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "ht", + "name": "transform", "type": { "model": "CComposedType", "qualifiers": [], - "source_text": "unsigned char *ht", + "source_text": "float transform[3][3]", "components": [ { "model": "CPointer", @@ -11642,26 +14317,48 @@ "source_text": "" }, { - "model": "CUnsignedChar", + "model": "CArray", "qualifiers": [], - "source_text": "unsigned char" + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" } ] }, "declared_type": { "model": "CComposedType", "qualifiers": [], - "source_text": "unsigned char *ht", + "source_text": "float transform[3][3]", "components": [ { - "model": "CPointer", + "model": "CArray", "qualifiers": [], - "source_text": "" + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, { - "model": "CUnsignedChar", + "model": "CArray", "qualifiers": [], - "source_text": "unsigned char" + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" } ] }, @@ -11669,35 +14366,33 @@ "callback_policy": null } ], - "storage": [ - "static" - ], + "storage": [], "specifiers": [], "is_variadic": false, "is_definition": true, "prototype_style": "prototype", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2866, + "line": 3598, "column": 1, - "source_line": "static void stbvox_make_03_split_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, unsigned char *ht)" + "source_line": "void stbvox_get_transform(stbvox_mesh_maker *mm, float transform[3][3])" }, "start": { "filename": "stb/stb_voxel_render.h", - "line": 2866, + "line": 3598, "column": 1, - "source_line": "static void stbvox_make_03_split_mesh_for_face(stbvox_mesh_maker *mm, stbvox_rotate rot, int face, int v_off, stbvox_pos pos, stbvox_mesh_vertex vertbase, stbvox_mesh_vertex *face_coord, unsigned char mesh, unsigned char *ht)" + "source_line": "void stbvox_get_transform(stbvox_mesh_maker *mm, float transform[3][3])" }, "end": { "filename": "stb/stb_voxel_render.h", - "line": 2886, + "line": 3616, "column": 1, "source_line": "}" }, "declaration_locations": [] }, - "stbvox_make_mesh_for_block": { - "name": "stbvox_make_mesh_for_block", + "stbvox_get_bounds": { + "name": "stbvox_get_bounds", "result_type": { "model": "CVoid", "qualifiers": [], @@ -11740,37 +14435,11 @@ "callback_policy": null }, { - "name": "pos", - "type": { - "reference": "stbvox_pos" - }, - "declared_type": { - "reference": "stbvox_pos" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "v_off", - "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int v_off" - }, - "declared_type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int v_off" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "vmesh", + "name": "bounds", "type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_vertex *vmesh", + "source_text": "float bounds[2][3]", "components": [ { "model": "CPointer", @@ -11778,22 +14447,48 @@ "source_text": "" }, { - "reference": "stbvox_mesh_vertex" + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" } ] }, "declared_type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_vertex *vmesh", + "source_text": "float bounds[2][3]", "components": [ { - "model": "CPointer", + "model": "CArray", "qualifiers": [], - "source_text": "" + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, { - "reference": "stbvox_mesh_vertex" + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" } ] }, @@ -11801,35 +14496,33 @@ "callback_policy": null } ], - "storage": [ - "static" - ], + "storage": [], "specifiers": [], "is_variadic": false, "is_definition": true, "prototype_style": "prototype", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2894, + "line": 3618, "column": 1, - "source_line": "static void stbvox_make_mesh_for_block(stbvox_mesh_maker *mm, stbvox_pos pos, int v_off, stbvox_mesh_vertex *vmesh)" + "source_line": "void stbvox_get_bounds(stbvox_mesh_maker *mm, float bounds[2][3])" }, "start": { "filename": "stb/stb_voxel_render.h", - "line": 2894, + "line": 3618, "column": 1, - "source_line": "static void stbvox_make_mesh_for_block(stbvox_mesh_maker *mm, stbvox_pos pos, int v_off, stbvox_mesh_vertex *vmesh)" + "source_line": "void stbvox_get_bounds(stbvox_mesh_maker *mm, float bounds[2][3])" }, "end": { "filename": "stb/stb_voxel_render.h", - "line": 2953, + "line": 3626, "column": 1, "source_line": "}" }, "declaration_locations": [] }, - "stbvox_make_mesh_for_block_with_geo": { - "name": "stbvox_make_mesh_for_block_with_geo", + "stbvox_set_mesh_coordinates": { + "name": "stbvox_set_mesh_coordinates", "result_type": { "model": "CVoid", "qualifiers": [], @@ -11872,61 +14565,78 @@ "callback_policy": null }, { - "name": "pos", + "name": "x", "type": { - "reference": "stbvox_pos" + "model": "CInt", + "qualifiers": [], + "source_text": "int x" }, "declared_type": { - "reference": "stbvox_pos" + "model": "CInt", + "qualifiers": [], + "source_text": "int x" }, "source_location": null, "callback_policy": null }, { - "name": "v_off", + "name": "y", "type": { "model": "CInt", "qualifiers": [], - "source_text": "int v_off" + "source_text": "int y" }, "declared_type": { "model": "CInt", "qualifiers": [], - "source_text": "int v_off" + "source_text": "int y" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "z", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int z" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int z" }, "source_location": null, "callback_policy": null } ], - "storage": [ - "static" - ], + "storage": [], "specifiers": [], "is_variadic": false, "is_definition": true, "prototype_style": "prototype", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 2963, + "line": 3628, "column": 1, - "source_line": "static void stbvox_make_mesh_for_block_with_geo(stbvox_mesh_maker *mm, stbvox_pos pos, int v_off)" + "source_line": "void stbvox_set_mesh_coordinates(stbvox_mesh_maker *mm, int x, int y, int z)" }, "start": { "filename": "stb/stb_voxel_render.h", - "line": 2963, + "line": 3628, "column": 1, - "source_line": "static void stbvox_make_mesh_for_block_with_geo(stbvox_mesh_maker *mm, stbvox_pos pos, int v_off)" + "source_line": "void stbvox_set_mesh_coordinates(stbvox_mesh_maker *mm, int x, int y, int z)" }, "end": { "filename": "stb/stb_voxel_render.h", - "line": 3397, + "line": 3633, "column": 1, "source_line": "}" }, "declaration_locations": [] }, - "stbvox_make_mesh_for_column": { - "name": "stbvox_make_mesh_for_column", + "stbvox_set_input_stride": { + "name": "stbvox_set_input_stride", "result_type": { "model": "CVoid", "qualifiers": [], @@ -11969,117 +14679,122 @@ "callback_policy": null }, { - "name": "x", - "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int x" - }, - "declared_type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int x" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "y", + "name": "x_stride_in_bytes", "type": { "model": "CInt", "qualifiers": [], - "source_text": "int y" + "source_text": "int x_stride_in_bytes" }, "declared_type": { "model": "CInt", "qualifiers": [], - "source_text": "int y" + "source_text": "int x_stride_in_bytes" }, "source_location": null, "callback_policy": null }, { - "name": "z0", + "name": "y_stride_in_bytes", "type": { "model": "CInt", "qualifiers": [], - "source_text": "int z0" + "source_text": "int y_stride_in_bytes" }, "declared_type": { "model": "CInt", "qualifiers": [], - "source_text": "int z0" + "source_text": "int y_stride_in_bytes" }, "source_location": null, "callback_policy": null } ], - "storage": [ - "static" - ], + "storage": [], "specifiers": [], "is_variadic": false, "is_definition": true, "prototype_style": "prototype", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3399, + "line": 3635, "column": 1, - "source_line": "static void stbvox_make_mesh_for_column(stbvox_mesh_maker *mm, int x, int y, int z0)" + "source_line": "void stbvox_set_input_stride(stbvox_mesh_maker *mm, int x_stride_in_bytes, int y_stride_in_bytes)" }, "start": { "filename": "stb/stb_voxel_render.h", - "line": 3399, + "line": 3635, "column": 1, - "source_line": "static void stbvox_make_mesh_for_column(stbvox_mesh_maker *mm, int x, int y, int z0)" + "source_line": "void stbvox_set_input_stride(stbvox_mesh_maker *mm, int x_stride_in_bytes, int y_stride_in_bytes)" }, "end": { "filename": "stb/stb_voxel_render.h", - "line": 3465, + "line": 3650, "column": 1, "source_line": "}" }, "declaration_locations": [] }, - "stbvox_bring_up_to_date": { - "name": "stbvox_bring_up_to_date", + "find_best_normal": { + "name": "find_best_normal", "result_type": { - "model": "CVoid", + "model": "CComposedType", "qualifiers": [], - "source_text": "void" + "source_text": "char", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CChar", + "qualifiers": [], + "source_text": "char" + } + ] }, "parameters": [ { - "name": "mm", + "name": "x", "type": { - "model": "CComposedType", + "model": "CFloat", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "float x" }, "declared_type": { - "model": "CComposedType", + "model": "CFloat", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "float x" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "y", + "type": { + "model": "CFloat", + "qualifiers": [], + "source_text": "float y" + }, + "declared_type": { + "model": "CFloat", + "qualifiers": [], + "source_text": "float y" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "z", + "type": { + "model": "CFloat", + "qualifiers": [], + "source_text": "float z" + }, + "declared_type": { + "model": "CFloat", + "qualifiers": [], + "source_text": "float z" }, "source_location": null, "callback_policy": null @@ -12094,26 +14809,26 @@ "prototype_style": "prototype", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3467, + "line": 3667, "column": 1, - "source_line": "static void stbvox_bring_up_to_date(stbvox_mesh_maker *mm)" + "source_line": "static char *find_best_normal(float x, float y, float z)" }, "start": { "filename": "stb/stb_voxel_render.h", - "line": 3467, + "line": 3667, "column": 1, - "source_line": "static void stbvox_bring_up_to_date(stbvox_mesh_maker *mm)" + "source_line": "static char *find_best_normal(float x, float y, float z)" }, "end": { "filename": "stb/stb_voxel_render.h", - "line": 3489, + "line": 3682, "column": 1, "source_line": "}" }, "declaration_locations": [] }, - "stbvox_make_mesh": { - "name": "stbvox_make_mesh", + "main": { + "name": "main", "result_type": { "model": "CInt", "qualifiers": [], @@ -12121,11 +14836,26 @@ }, "parameters": [ { - "name": "mm", + "name": "argc", + "type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int argc" + }, + "declared_type": { + "model": "CInt", + "qualifiers": [], + "source_text": "int argc" + }, + "source_location": null, + "callback_policy": null + }, + { + "name": "argv", "type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", + "source_text": "char **argv", "components": [ { "model": "CPointer", @@ -12133,14 +14863,21 @@ "source_text": "" }, { - "reference": "stbvox_mesh_maker" + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CChar", + "qualifiers": [], + "source_text": "char" } ] }, "declared_type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", + "source_text": "char **argv", "components": [ { "model": "CPointer", @@ -12148,7 +14885,14 @@ "source_text": "" }, { - "reference": "stbvox_mesh_maker" + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CChar", + "qualifiers": [], + "source_text": "char" } ] }, @@ -12163,1590 +14907,1741 @@ "prototype_style": "prototype", "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3491, + "line": 3684, "column": 1, - "source_line": "int stbvox_make_mesh(stbvox_mesh_maker *mm)" + "source_line": "int main(int argc, char **argv)" }, "start": { "filename": "stb/stb_voxel_render.h", - "line": 3491, + "line": 3684, "column": 1, - "source_line": "int stbvox_make_mesh(stbvox_mesh_maker *mm)" + "source_line": "int main(int argc, char **argv)" }, "end": { "filename": "stb/stb_voxel_render.h", - "line": 3520, + "line": 3702, "column": 1, "source_line": "}" }, "declaration_locations": [] + } + }, + "structs": { + "stbvox_input_description": { + "reference": "struct stbvox_input_description" }, - "stbvox_init_mesh_maker": { - "name": "stbvox_init_mesh_maker", - "result_type": { - "model": "CVoid", + "stbvox_mesh_maker": { + "reference": "struct stbvox_mesh_maker" + } + }, + "unions": {}, + "enums": {}, + "typedefs": { + "stbvox_mesh_maker": { + "reference": "stbvox_mesh_maker" + }, + "stbvox_input_description": { + "reference": "stbvox_input_description" + }, + "stbvox_block_type": { + "reference": "stbvox_block_type" + }, + "stbvox_rgb": { + "reference": "stbvox_rgb" + }, + "stbvox_uint16": { + "reference": "stbvox_uint16" + }, + "stbvox_uint32": { + "reference": "stbvox_uint32" + }, + "stbvox_mesh_vertex": { + "reference": "stbvox_mesh_vertex" + }, + "stbvox_mesh_face": { + "reference": "stbvox_mesh_face" + }, + "stbvox_rotate": { + "reference": "stbvox_rotate" + }, + "stbvox_pos": { + "reference": "stbvox_pos" + } + }, + "variables": { + "stbvox_default_texgen": { + "name": "stbvox_default_texgen", + "type": { + "model": "CComposedType", "qualifiers": [], - "source_text": "void" + "source_text": "static float stbvox_default_texgen[2][32][3]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "2", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "32", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] }, - "parameters": [ - { - "name": "mm", - "type": { - "model": "CComposedType", + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { { 0, 1,0 }, { 0, 0, 1 }, { 0,-1,0 }, { 0, 0,-1 },\n { -1, 0,0 }, { 0, 0, 1 }, { 1, 0,0 }, { 0, 0,-1 },\n { 0,-1,0 }, { 0, 0, 1 }, { 0, 1,0 }, { 0, 0,-1 },\n { 1, 0,0 }, { 0, 0, 1 }, { -1, 0,0 }, { 0, 0,-1 },\n\n { 1, 0,0 }, { 0, 1, 0 }, { -1, 0,0 }, { 0,-1, 0 },\n { -1, 0,0 }, { 0,-1, 0 }, { 1, 0,0 }, { 0, 1, 0 },\n { 1, 0,0 }, { 0, 1, 0 }, { -1, 0,0 }, { 0,-1, 0 },\n { -1, 0,0 }, { 0,-1, 0 }, { 1, 0,0 }, { 0, 1, 0 },\n },\n { { 0, 0,-1 }, { 0, 1,0 }, { 0, 0, 1 }, { 0,-1,0 },\n { 0, 0,-1 }, { -1, 0,0 }, { 0, 0, 1 }, { 1, 0,0 },\n { 0, 0,-1 }, { 0,-1,0 }, { 0, 0, 1 }, { 0, 1,0 },\n { 0, 0,-1 }, { 1, 0,0 }, { 0, 0, 1 }, { -1, 0,0 },\n\n { 0,-1, 0 }, { 1, 0,0 }, { 0, 1, 0 }, { -1, 0,0 },\n { 0, 1, 0 }, { -1, 0,0 }, { 0,-1, 0 }, { 1, 0,0 },\n { 0,-1, 0 }, { 1, 0,0 }, { 0, 1, 0 }, { -1, 0,0 },\n { 0, 1, 0 }, { -1, 0,0 }, { 0,-1, 0 }, { 1, 0,0 },\n },\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1428, + "column": 1, + "source_line": "static float stbvox_default_texgen[2][32][3] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_default_normals": { + "name": "stbvox_default_normals", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float stbvox_default_normals[32][3]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "", + "bound": "32", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CComposedType", + { + "model": "CArray", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - } + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, + "storage": [ + "static" ], - "storage": [], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", + "initializer": { + "source_text": "{\n { 1,0,0 }, \n { 0,1,0 }, \n { -1,0,0 }, \n { 0,-1,0 }, \n { 0,0,1 }, \n { 0,0,-1 }, \n { STBVOX_RSQRT2,0, STBVOX_RSQRT2 }, \n { STBVOX_RSQRT2,0, -STBVOX_RSQRT2 }, \n\n { STBVOX_RSQRT2,0, STBVOX_RSQRT2 }, \n { 0, STBVOX_RSQRT2, STBVOX_RSQRT2 }, \n { -STBVOX_RSQRT2,0, STBVOX_RSQRT2 }, \n { 0,-STBVOX_RSQRT2, STBVOX_RSQRT2 }, \n { STBVOX_RSQRT3, STBVOX_RSQRT3, STBVOX_RSQRT3 }, \n { STBVOX_RSQRT3, STBVOX_RSQRT3,-STBVOX_RSQRT3 }, \n { 0, STBVOX_RSQRT2, STBVOX_RSQRT2 }, \n { 0, STBVOX_RSQRT2, -STBVOX_RSQRT2 }, \n\n { STBVOX_RSQRT2,0, -STBVOX_RSQRT2 }, \n { 0, STBVOX_RSQRT2, -STBVOX_RSQRT2 }, \n { -STBVOX_RSQRT2,0, -STBVOX_RSQRT2 }, \n { 0,-STBVOX_RSQRT2, -STBVOX_RSQRT2 }, \n { -STBVOX_RSQRT3, STBVOX_RSQRT3, STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT3, STBVOX_RSQRT3,-STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT2,0, STBVOX_RSQRT2 }, \n { -STBVOX_RSQRT2,0, -STBVOX_RSQRT2 }, \n\n { STBVOX_RSQRT3, STBVOX_RSQRT3,STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT3, STBVOX_RSQRT3,STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT3,-STBVOX_RSQRT3,STBVOX_RSQRT3 }, \n { STBVOX_RSQRT3,-STBVOX_RSQRT3,STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT3,-STBVOX_RSQRT3, STBVOX_RSQRT3 }, \n { -STBVOX_RSQRT3,-STBVOX_RSQRT3,-STBVOX_RSQRT3 }, \n { 0,-STBVOX_RSQRT2, STBVOX_RSQRT2 }, \n { 0,-STBVOX_RSQRT2, -STBVOX_RSQRT2 }, \n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3522, + "line": 1455, "column": 1, - "source_line": "void stbvox_init_mesh_maker(stbvox_mesh_maker *mm)" + "source_line": "static float stbvox_default_normals[32][3] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_default_texscale": { + "name": "stbvox_default_texscale", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float stbvox_default_texscale[128][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "128", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n {1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},{1,1,0,0},\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1494, + "column": 1, + "source_line": "static float stbvox_default_texscale[128][4] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_default_palette_compact": { + "name": "stbvox_default_palette_compact", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_default_palette_compact[64][3]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "64", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] }, - "start": { - "filename": "stb/stb_voxel_render.h", - "line": 3522, - "column": 1, - "source_line": "void stbvox_init_mesh_maker(stbvox_mesh_maker *mm)" + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 255,255,255 }, { 238,238,238 }, { 221,221,221 }, { 204,204,204 },\n { 187,187,187 }, { 170,170,170 }, { 153,153,153 }, { 136,136,136 },\n { 119,119,119 }, { 102,102,102 }, { 85, 85, 85 }, { 68, 68, 68 },\n { 51, 51, 51 }, { 34, 34, 34 }, { 17, 17, 17 }, { 0, 0, 0 },\n { 255,240,240 }, { 255,220,220 }, { 255,160,160 }, { 255, 32, 32 },\n { 200,120,160 }, { 200, 60,150 }, { 220,100,130 }, { 255, 0,128 },\n { 240,240,255 }, { 220,220,255 }, { 160,160,255 }, { 32, 32,255 },\n { 120,160,200 }, { 60,150,200 }, { 100,130,220 }, { 0,128,255 },\n { 240,255,240 }, { 220,255,220 }, { 160,255,160 }, { 32,255, 32 },\n { 160,200,120 }, { 150,200, 60 }, { 130,220,100 }, { 128,255, 0 },\n { 255,255,240 }, { 255,255,220 }, { 220,220,180 }, { 255,255, 32 },\n { 200,160,120 }, { 200,150, 60 }, { 220,130,100 }, { 255,128, 0 },\n { 255,240,255 }, { 255,220,255 }, { 220,180,220 }, { 255, 32,255 },\n { 160,120,200 }, { 150, 60,200 }, { 130,100,220 }, { 128, 0,255 },\n { 240,255,255 }, { 220,255,255 }, { 180,220,220 }, { 32,255,255 },\n { 120,200,160 }, { 60,200,150 }, { 100,220,130 }, { 0,255,128 },\n}" }, - "end": { + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3529, + "line": 1514, "column": 1, - "source_line": "}" + "source_line": "static unsigned char stbvox_default_palette_compact[64][3] =" }, + "callback_policy": null, "declaration_locations": [] }, - "stbvox_get_buffer_count": { - "name": "stbvox_get_buffer_count", - "result_type": { - "model": "CInt", + "stbvox_default_ambient": { + "name": "stbvox_default_ambient", + "type": { + "model": "CComposedType", "qualifiers": [], - "source_text": "int" - }, - "parameters": [ - { - "name": "mm", - "type": { - "model": "CComposedType", + "source_text": "static float stbvox_default_ambient[4][4]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CComposedType", + { + "model": "CArray", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - } - ], - "storage": [], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", - "source_location": { - "filename": "stb/stb_voxel_render.h", - "line": 3531, - "column": 1, - "source_line": "int stbvox_get_buffer_count(stbvox_mesh_maker *mm)" + { + "model": "CFloat", + "qualifiers": [], + "source_text": "float" + } + ] }, - "start": { - "filename": "stb/stb_voxel_render.h", - "line": 3531, - "column": 1, - "source_line": "int stbvox_get_buffer_count(stbvox_mesh_maker *mm)" + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0,0,1 ,0 }, \n { 0.5,0.5,0.5,0 }, \n { 0.5,0.5,0.5,0 }, \n { 0.5,0.5,0.5,1.0f/1000.0f/1000.0f }, \n}" }, - "end": { + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3535, + "line": 1534, "column": 1, - "source_line": "}" + "source_line": "static float stbvox_default_ambient[4][4] =" }, + "callback_policy": null, "declaration_locations": [] }, - "stbvox_get_buffer_size_per_quad": { - "name": "stbvox_get_buffer_size_per_quad", - "result_type": { - "model": "CInt", + "stbvox_default_palette": { + "name": "stbvox_default_palette", + "type": { + "model": "CComposedType", "qualifiers": [], - "source_text": "int" - }, - "parameters": [ - { - "name": "mm", - "type": { - "model": "CComposedType", - "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] - }, - "declared_type": { - "model": "CComposedType", + "source_text": "static float stbvox_default_palette[64][4]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "", + "bound": "64", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - }, - { - "name": "n", - "type": { - "model": "CInt", + { + "model": "CArray", "qualifiers": [], - "source_text": "int n" + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CInt", + { + "model": "CFloat", "qualifiers": [], - "source_text": "int n" - }, - "source_location": null, - "callback_policy": null - } + "source_text": "float" + } + ] + }, + "storage": [ + "static" ], - "storage": [], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", + "initializer": null, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3537, - "column": 1, - "source_line": "int stbvox_get_buffer_size_per_quad(stbvox_mesh_maker *mm, int n)" - }, - "start": { - "filename": "stb/stb_voxel_render.h", - "line": 3537, - "column": 1, - "source_line": "int stbvox_get_buffer_size_per_quad(stbvox_mesh_maker *mm, int n)" - }, - "end": { - "filename": "stb/stb_voxel_render.h", - "line": 3540, + "line": 1542, "column": 1, - "source_line": "}" + "source_line": "static float stbvox_default_palette[64][4];" }, + "callback_policy": null, "declaration_locations": [] }, - "stbvox_reset_buffers": { - "name": "stbvox_reset_buffers", - "result_type": { - "model": "CVoid", + "stbvox_vertex_program": { + "name": "stbvox_vertex_program", + "type": { + "model": "CComposedType", "qualifiers": [], - "source_text": "void" - }, - "parameters": [ - { - "name": "mm", - "type": { - "model": "CComposedType", - "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] - }, - "declared_type": { - "model": "CComposedType", + "source_text": "static const char *stbvox_vertex_program", + "components": [ + { + "model": "CPointer", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "" }, - "source_location": null, - "callback_policy": null - } + { + "model": "CChar", + "qualifiers": [ + "const" + ], + "source_text": "const char" + } + ] + }, + "storage": [ + "static" ], - "storage": [], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", + "initializer": { + "source_text": "{\n STBVOX_SHADER_VERSION\n\n \n \"in uvec4 attr_face;\\n\"\n \n \"uniform usamplerBuffer facearray;\\n\"\n \n\n \n \"uniform usamplerBuffer facearray2;\\n\"\n \n\n \n \"in uint attr_vertex;\\n\"\n\n \n \"uniform vec3 transform[3];\\n\"\n\n \n \"uniform vec4 camera_pos;\\n\" \n\n \n \n \n \"uniform vec3 normal_table[32];\\n\"\n\n \n \"uniform mat4x4 model_view;\\n\"\n \n\n \n \"flat out uvec4 facedata;\\n\"\n \" out vec3 voxelspace_pos;\\n\"\n \" out vec3 vnormal;\\n\"\n \" out float texlerp;\\n\"\n \" out float amb_occ;\\n\"\n\n \n \"void main()\\n\"\n \"{\\n\"\n \n \" facedata = attr_face;\\n\"\n \n \" int faceID = gl_VertexID >> 2;\\n\"\n \" facedata = texelFetch(facearray, faceID);\\n\"\n \n\n \n \" vec3 offset;\\n\"\n \" offset.x = float( (attr_vertex ) & 127u );\\n\" \n \" offset.y = float( (attr_vertex >> 7u) & 127u );\\n\" \n \" offset.z = float( (attr_vertex >> 14u) & 511u );\\n\" \n \" amb_occ = float( (attr_vertex >> 23u) & 63u ) / 63.0;\\n\" \n \" texlerp = float( (attr_vertex >> 29u) ) / 7.0;\\n\" \n\n \" vnormal = normal_table[(facedata.w>>2u) & 31u];\\n\"\n \" voxelspace_pos = offset * transform[0];\\n\" \n \" vec3 position = voxelspace_pos + transform[1];\\n\" \n\n \n \" if ((facedata.w & 28u) == 16u || (facedata.w & 28u) == 24u)\\n\"\n \" position += vnormal.xyz * camera_pos.w;\\n\"\n \n\n \n \" gl_Position = model_view * vec4(position,1.0);\\n\"\n \n \" gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);\\n\"\n \n\n \"}\\n\"\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3542, + "line": 1570, "column": 1, - "source_line": "void stbvox_reset_buffers(stbvox_mesh_maker *mm)" + "source_line": "static const char *stbvox_vertex_program =" }, - "start": { - "filename": "stb/stb_voxel_render.h", - "line": 3542, - "column": 1, - "source_line": "void stbvox_reset_buffers(stbvox_mesh_maker *mm)" + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_fragment_program": { + "name": "stbvox_fragment_program", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static const char *stbvox_fragment_program", + "components": [ + { + "model": "CPointer", + "qualifiers": [], + "source_text": "" + }, + { + "model": "CChar", + "qualifiers": [ + "const" + ], + "source_text": "const char" + } + ] }, - "end": { + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBVOX_SHADER_VERSION\n\n \n \n \"#define rlerp(t,x,y) mix(x,y,t)\\n\"\n \n \"#define rlerp(t,x,y) lerp(x,y,t)\\n\"\n \n \n \n\n\n \n \"flat in uvec4 facedata;\\n\"\n \" in vec3 voxelspace_pos;\\n\"\n \" in vec3 vnormal;\\n\"\n \" in float texlerp;\\n\"\n \" in float amb_occ;\\n\"\n\n \n \"uniform vec3 transform[3];\\n\"\n\n \n \"uniform vec4 camera_pos;\\n\" \n\n \n \"uniform vec4 ambient[4];\\n\"\n\n \n \n \"uniform sampler2DArray tex_array[2];\\n\"\n\n \n \"uniform samplerBuffer color_table;\\n\"\n \"uniform samplerBuffer texscale;\\n\"\n \"uniform samplerBuffer texgen;\\n\"\n \n \"uniform vec4 color_table[64];\\n\"\n \"uniform vec4 texscale[64];\\n\" \n \"uniform vec3 texgen[64];\\n\"\n \n \n\n \"out vec4 outcolor;\\n\"\n\n \n \"vec3 compute_lighting(vec3 pos, vec3 norm, vec3 albedo, vec3 ambient);\\n\"\n \n \n \"vec3 compute_fog(vec3 color, vec3 relative_pos, float fragment_alpha);\\n\"\n \n\n \"void main()\\n\"\n \"{\\n\"\n \" vec3 albedo;\\n\"\n \" float fragment_alpha;\\n\"\n\n \n \n \" uint tex1_id = facedata.x;\\n\"\n \" uint tex2_id = facedata.y;\\n\"\n \" uint texprojid = facedata.w & 31u;\\n\"\n \" uint color_id = facedata.z;\\n\"\n\n \n \n \" vec3 texgen_s = texgen[texprojid];\\n\"\n \" vec3 texgen_t = texgen[texprojid+32u];\\n\"\n \" float tex1_scale = texscale[tex1_id & 63u].x;\\n\"\n \" vec4 color = color_table[color_id & 63u];\\n\"\n \n \" vec4 tex2_props = texscale[tex2_id & 63u];\\n\"\n \n \n \" vec3 texgen_s = texelFetch(texgen, int(texprojid)).xyz;\\n\"\n \" vec3 texgen_t = texelFetch(texgen, int(texprojid+32u)).xyz;\\n\"\n \" float tex1_scale = texelFetch(texscale, int(tex1_id & 127u)).x;\\n\"\n \" vec4 color = texelFetch(color_table, int(color_id & 63u));\\n\"\n \n \" vec4 tex2_props = texelFetch(texscale, int(tex1_id & 127u));\\n\"\n \n \n\n \n \" float tex2_scale = tex2_props.y;\\n\"\n \" bool texblend_mode = tex2_props.z != 0.0;\\n\"\n \n \" vec2 texcoord;\\n\"\n \" vec3 texturespace_pos = voxelspace_pos + transform[2].xyz;\\n\"\n \" texcoord.s = dot(texturespace_pos, texgen_s);\\n\"\n \" texcoord.t = dot(texturespace_pos, texgen_t);\\n\"\n\n \" vec2 texcoord_1 = tex1_scale * texcoord;\\n\"\n \n \" vec2 texcoord_2 = tex2_scale * texcoord;\\n\"\n \n\n \n \" texcoord_1 = texcoord_1 - floor(texcoord_1);\\n\"\n \" vec4 tex1 = textureGrad(tex_array[0], vec3(texcoord_1, float(tex1_id)), dFdx(tex1_scale*texcoord), dFdy(tex1_scale*texcoord));\\n\"\n \n \" vec4 tex1 = texture(tex_array[0], vec3(texcoord_1, float(tex1_id)));\\n\"\n \n\n \n \n \" texcoord_2 = texcoord_2 - floor(texcoord_2);\\n\"\n \" vec4 tex2 = textureGrad(tex_array[0], vec3(texcoord_2, float(tex2_id)), dFdx(tex2_scale*texcoord), dFdy(tex2_scale*texcoord));\\n\"\n \n \" vec4 tex2 = texture(tex_array[1], vec3(texcoord_2, float(tex2_id)));\\n\"\n \n \n\n \" bool emissive = (color.a > 1.0);\\n\"\n \" color.a = min(color.a, 1.0);\\n\"\n\n \n \" if ((color_id & 64u) != 0u) tex1.rgba *= color.rgba;\\n\"\n \" fragment_alpha = tex1.a;\\n\"\n \n \" if ((color_id & 128u) != 0u) tex2.rgba *= color.rgba;\\n\"\n\n \n \" tex2.rgba *= texlerp;\\n\"\n \n \" tex2.a *= texlerp;\\n\"\n \n\n \" if (texblend_mode)\\n\"\n \" albedo = tex1.xyz * rlerp(tex2.a, vec3(1.0,1.0,1.0), 2.0*tex2.xyz);\\n\"\n \" else {\\n\"\n \n \" albedo = (1.0-tex2.a)*tex1.xyz + tex2.xyz;\\n\"\n \n \" albedo = rlerp(tex2.a, tex1.xyz, tex2.xyz);\\n\"\n \n \" fragment_alpha = tex1.a*(1-tex2.a)+tex2.a;\\n\"\n \" }\\n\"\n \n \" albedo = tex1.xyz;\\n\"\n \n\n \n \" vec4 color;\"\n \" color.xyz = vec3(facedata.xyz) / 255.0;\\n\"\n \" bool emissive = false;\\n\"\n \" albedo = color.xyz;\\n\"\n \" fragment_alpha = 1.0;\\n\"\n \n\n \n \n \n \" vec3 normal = normalize(vnormal);\\n\"\n \n \" vec3 normal = vnormal;\\n\"\n \n\n \" vec3 ambient_color = dot(normal, ambient[0].xyz) * ambient[1].xyz + ambient[2].xyz;\\n\"\n\n \" ambient_color = clamp(ambient_color, 0.0, 1.0);\"\n \" ambient_color *= amb_occ;\\n\"\n\n \" vec3 lit_color;\\n\"\n \" if (!emissive)\\n\"\n \n \" lit_color = compute_lighting(voxelspace_pos + transform[1], normal, albedo, ambient_color);\\n\"\n \n \" lit_color = albedo * ambient_color ;\\n\"\n \n \" else\\n\"\n \" lit_color = albedo;\\n\"\n\n \n \" vec3 dist = voxelspace_pos + (transform[1] - camera_pos.xyz);\\n\"\n \" lit_color = compute_fog(lit_color, dist, fragment_alpha);\\n\"\n \n\n \n \" vec4 final_color = vec4(lit_color/fragment_alpha, fragment_alpha);\\n\"\n \n \" vec4 final_color = vec4(lit_color, fragment_alpha);\\n\"\n \n \" outcolor = final_color;\\n\"\n \"}\\n\"\n\n \n \"\\n\"\n \"uniform vec3 light_source[2];\\n\"\n \"vec3 compute_lighting(vec3 pos, vec3 norm, vec3 albedo, vec3 ambient)\\n\"\n \"{\\n\"\n \" vec3 light_dir = light_source[0] - pos;\\n\"\n \" float lambert = dot(light_dir, norm) / dot(light_dir, light_dir);\\n\"\n \" vec3 diffuse = clamp(light_source[1] * clamp(lambert, 0.0, 1.0), 0.0, 1.0);\\n\"\n \" return (diffuse + ambient) * albedo;\\n\"\n \"}\\n\"\n \n\n \n \"\\n\"\n \"vec3 compute_fog(vec3 color, vec3 relative_pos, float fragment_alpha)\\n\"\n \"{\\n\"\n \" float f = dot(relative_pos,relative_pos)*ambient[3].w;\\n\"\n \n \" f = clamp(f, 0.0, 1.0);\\n\"\n \" f = 3.0*f*f - 2.0*f*f*f;\\n\" \n \n \n \" return rlerp(f, color.xyz, ambient[3].xyz*fragment_alpha);\\n\"\n \n \" return rlerp(f, color.xyz, ambient[3].xyz);\\n\"\n \n \"}\\n\"\n \n}" + }, + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3549, + "line": 1646, "column": 1, - "source_line": "}" + "source_line": "static const char *stbvox_fragment_program =" }, + "callback_policy": null, "declaration_locations": [] }, - "stbvox_set_buffer": { - "name": "stbvox_set_buffer", - "result_type": { - "model": "CVoid", + "stbvox_fragment_program_alpha_only": { + "name": "stbvox_fragment_program_alpha_only", + "type": { + "model": "CComposedType", "qualifiers": [], - "source_text": "void" - }, - "parameters": [ - { - "name": "mm", - "type": { - "model": "CComposedType", - "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] - }, - "declared_type": { - "model": "CComposedType", - "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "mesh", - "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int mesh" - }, - "declared_type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int mesh" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "slot", - "type": { - "model": "CInt", + "source_text": "static const char *stbvox_fragment_program_alpha_only", + "components": [ + { + "model": "CPointer", "qualifiers": [], - "source_text": "int slot" + "source_text": "" }, - "declared_type": { - "model": "CInt", + { + "model": "CChar", + "qualifiers": [ + "const" + ], + "source_text": "const char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBVOX_SHADER_VERSION\n\n \n \"flat in uvec4 facedata;\\n\"\n \" in vec3 voxelspace_pos;\\n\"\n \" in float texlerp;\\n\"\n\n \n \"uniform vec3 transform[3];\\n\"\n\n \n \n \"uniform sampler2DArray tex_array[2];\\n\"\n\n \n \"uniform samplerBuffer texscale;\\n\"\n \"uniform samplerBuffer texgen;\\n\"\n \n \"uniform vec4 texscale[64];\\n\" \n \"uniform vec3 texgen[64];\\n\"\n \n \n\n \"out vec4 outcolor;\\n\"\n\n \"void main()\\n\"\n \"{\\n\"\n \" vec3 albedo;\\n\"\n \" float fragment_alpha;\\n\"\n\n \n \n \" uint tex1_id = facedata.x;\\n\"\n \" uint tex2_id = facedata.y;\\n\"\n \" uint texprojid = facedata.w & 31u;\\n\"\n \" uint color_id = facedata.z;\\n\"\n\n \n \n \" vec3 texgen_s = texgen[texprojid];\\n\"\n \" vec3 texgen_t = texgen[texprojid+32u];\\n\"\n \" float tex1_scale = texscale[tex1_id & 63u].x;\\n\"\n \" vec4 color = color_table[color_id & 63u];\\n\"\n \" vec4 tex2_props = texscale[tex2_id & 63u];\\n\"\n \n \" vec3 texgen_s = texelFetch(texgen, int(texprojid)).xyz;\\n\"\n \" vec3 texgen_t = texelFetch(texgen, int(texprojid+32u)).xyz;\\n\"\n \" float tex1_scale = texelFetch(texscale, int(tex1_id & 127u)).x;\\n\"\n \" vec4 color = texelFetch(color_table, int(color_id & 63u));\\n\"\n \" vec4 tex2_props = texelFetch(texscale, int(tex2_id & 127u));\\n\"\n \n\n \n \" float tex2_scale = tex2_props.y;\\n\"\n \" bool texblend_mode = tex2_props.z &((facedata.w & 128u) != 0u);\\n\"\n \n\n \" color.a = min(color.a, 1.0);\\n\"\n\n \" vec2 texcoord;\\n\"\n \" vec3 texturespace_pos = voxelspace_pos + transform[2].xyz;\\n\"\n \" texcoord.s = dot(texturespace_pos, texgen_s);\\n\"\n \" texcoord.t = dot(texturespace_pos, texgen_t);\\n\"\n\n \" vec2 texcoord_1 = tex1_scale * texcoord;\\n\"\n \" vec2 texcoord_2 = tex2_scale * texcoord;\\n\"\n\n \n \" texcoord_1 = texcoord_1 - floor(texcoord_1);\\n\"\n \" vec4 tex1 = textureGrad(tex_array[0], vec3(texcoord_1, float(tex1_id)), dFdx(tex1_scale*texcoord), dFdy(tex1_scale*texcoord));\\n\"\n \n \" vec4 tex1 = texture(tex_array[0], vec3(texcoord_1, float(tex1_id)));\\n\"\n \n\n \" if ((color_id & 64u) != 0u) tex1.a *= color.a;\\n\"\n \" fragment_alpha = tex1.a;\\n\"\n\n \n \" if (!texblend_mode) {\\n\"\n \n \" texcoord_2 = texcoord_2 - floor(texcoord_2);\\n\"\n \" vec4 tex2 = textureGrad(tex_array[0], vec3(texcoord_2, float(tex2_id)), dFdx(tex2_scale*texcoord), dFdy(tex2_scale*texcoord));\\n\"\n \n \" vec4 tex2 = texture(tex_array[1], vec3(texcoord_2, float(tex2_id)));\\n\"\n \n\n \" tex2.a *= texlerp;\\n\"\n \" if ((color_id & 128u) != 0u) tex2.rgba *= color.a;\\n\"\n \" fragment_alpha = tex1.a*(1-tex2.a)+tex2.a;\\n\"\n \"}\\n\"\n \"\\n\"\n \n\n \n \" fragment_alpha = 1.0;\\n\"\n \n\n \" outcolor = vec4(0.0, 0.0, 0.0, fragment_alpha);\\n\"\n \"}\\n\"\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 1866, + "column": 1, + "source_line": "static const char *stbvox_fragment_program_alpha_only =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_dummy_transform": { + "name": "stbvox_dummy_transform", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static float stbvox_dummy_transform[3][3]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "int slot" + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - }, - { - "name": "buffer", - "type": { - "model": "CComposedType", + { + "model": "CArray", "qualifiers": [], - "source_text": "void *buffer", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "model": "CVoid", - "qualifiers": [], - "source_text": "void" - } - ] + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CComposedType", + { + "model": "CFloat", "qualifiers": [], - "source_text": "void *buffer", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "model": "CVoid", - "qualifiers": [], - "source_text": "void" - } - ] - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "len", - "type": { - "reference": "size_t" - }, - "declared_type": { - "reference": "size_t" - }, - "source_location": null, - "callback_policy": null - } + "source_text": "float" + } + ] + }, + "storage": [ + "static" ], - "storage": [], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", + "initializer": null, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3551, + "line": 1985, "column": 1, - "source_line": "void stbvox_set_buffer(stbvox_mesh_maker *mm, int mesh, int slot, void *buffer, size_t len)" + "source_line": "static float stbvox_dummy_transform[3][3];" }, - "start": { - "filename": "stb/stb_voxel_render.h", - "line": 3551, - "column": 1, - "source_line": "void stbvox_set_buffer(stbvox_mesh_maker *mm, int mesh, int slot, void *buffer, size_t len)" + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_uniforms": { + "name": "stbvox_uniforms", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbvox_uniform_info stbvox_uniforms[]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": null, + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbvox_uniform_info" + } + ] }, - "end": { + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { STBVOX_UNIFORM_TYPE_sampler , 4, 1, (char*) \"facearray\" , 0 },\n { STBVOX_UNIFORM_TYPE_vec3 , 12, 3, (char*) \"transform\" , stbvox_dummy_transform[0] },\n { STBVOX_UNIFORM_TYPE_sampler , 4, 2, (char*) \"tex_array\" , 0 },\n { STBVOX_UNIFORM_TYPE_vec4 , 16, 128, (char*) \"texscale\" , stbvox_default_texscale[0] , STBVOX_TEXBUF },\n { STBVOX_UNIFORM_TYPE_vec4 , 16, 64, (char*) \"color_table\" , stbvox_default_palette[0] , STBVOX_TEXBUF },\n { STBVOX_UNIFORM_TYPE_vec3 , 12, 32, (char*) \"normal_table\" , stbvox_default_normals[0] },\n { STBVOX_UNIFORM_TYPE_vec3 , 12, 64, (char*) \"texgen\" , stbvox_default_texgen[0][0], STBVOX_TEXBUF },\n { STBVOX_UNIFORM_TYPE_vec4 , 16, 4, (char*) \"ambient\" , stbvox_default_ambient[0] },\n { STBVOX_UNIFORM_TYPE_vec4 , 16, 1, (char*) \"camera_pos\" , stbvox_dummy_transform[0] },\n}" + }, + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3564, + "line": 1993, "column": 1, - "source_line": "}" + "source_line": "static stbvox_uniform_info stbvox_uniforms[] =" }, + "callback_policy": null, "declaration_locations": [] }, - "stbvox_set_default_mesh": { - "name": "stbvox_set_default_mesh", - "result_type": { - "model": "CVoid", + "stbvox_rotate_face": { + "name": "stbvox_rotate_face", + "type": { + "model": "CComposedType", "qualifiers": [], - "source_text": "void" - }, - "parameters": [ - { - "name": "mm", - "type": { - "model": "CComposedType", - "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] - }, - "declared_type": { - "model": "CComposedType", + "source_text": "static unsigned char stbvox_rotate_face[6][4]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - }, - { - "name": "mesh", - "type": { - "model": "CInt", + { + "model": "CArray", "qualifiers": [], - "source_text": "int mesh" + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CInt", + { + "model": "CUnsignedChar", "qualifiers": [], - "source_text": "int mesh" - }, - "source_location": null, - "callback_policy": null - } + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" ], - "storage": [], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", + "initializer": { + "source_text": "{\n { 0,1,2,3 },\n { 1,2,3,0 },\n { 2,3,0,1 },\n { 3,0,1,2 },\n { 4,4,4,4 },\n { 5,5,5,5 },\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3566, + "line": 2030, "column": 1, - "source_line": "void stbvox_set_default_mesh(stbvox_mesh_maker *mm, int mesh)" + "source_line": "static unsigned char stbvox_rotate_face[6][4] =" }, - "start": { - "filename": "stb/stb_voxel_render.h", - "line": 3566, - "column": 1, - "source_line": "void stbvox_set_default_mesh(stbvox_mesh_maker *mm, int mesh)" + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_face_lerp": { + "name": "stbvox_face_lerp", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_face_lerp[6]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] }, - "end": { + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,2,0,2,4,4 }" + }, + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3569, + "line": 2162, "column": 1, - "source_line": "}" + "source_line": "static unsigned char stbvox_face_lerp[6] = { 0,2,0,2,4,4 };" }, + "callback_policy": null, "declaration_locations": [] }, - "stbvox_get_quad_count": { - "name": "stbvox_get_quad_count", - "result_type": { - "model": "CInt", + "stbvox_vert3_lerp": { + "name": "stbvox_vert3_lerp", + "type": { + "model": "CComposedType", "qualifiers": [], - "source_text": "int" - }, - "parameters": [ - { - "name": "mm", - "type": { - "model": "CComposedType", + "source_text": "static unsigned char stbvox_vert3_lerp[5]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "", + "bound": "5", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CComposedType", + { + "model": "CUnsignedChar", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "mesh", - "type": { - "model": "CInt", + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,3,6,9,12 }" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 2163, + "column": 1, + "source_line": "static unsigned char stbvox_vert3_lerp[5] = { 0,3,6,9,12 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_vert_lerp_for_face_lerp": { + "name": "stbvox_vert_lerp_for_face_lerp", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_vert_lerp_for_face_lerp[4]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "int mesh" + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CInt", + { + "model": "CUnsignedChar", "qualifiers": [], - "source_text": "int mesh" - }, - "source_location": null, - "callback_policy": null - } + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" ], - "storage": [], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", + "initializer": { + "source_text": "{ 0, 4, 7, 7 }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3571, + "line": 2164, "column": 1, - "source_line": "int stbvox_get_quad_count(stbvox_mesh_maker *mm, int mesh)" + "source_line": "static unsigned char stbvox_vert_lerp_for_face_lerp[4] = { 0, 4, 7, 7 };" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_face3_lerp": { + "name": "stbvox_face3_lerp", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_face3_lerp[6]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] }, - "start": { - "filename": "stb/stb_voxel_render.h", - "line": 3571, - "column": 1, - "source_line": "int stbvox_get_quad_count(stbvox_mesh_maker *mm, int mesh)" + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,3,6,9,12,14 }" }, - "end": { + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3574, + "line": 2165, "column": 1, - "source_line": "}" + "source_line": "static unsigned char stbvox_face3_lerp[6] = { 0,3,6,9,12,14 };" }, + "callback_policy": null, "declaration_locations": [] }, - "stbvox_get_input_description": { - "name": "stbvox_get_input_description", - "result_type": { + "stbvox_vert_lerp_for_simple": { + "name": "stbvox_vert_lerp_for_simple", + "type": { "model": "CComposedType", "qualifiers": [], - "source_text": "stbvox_input_description", + "source_text": "static unsigned char stbvox_vert_lerp_for_simple[4]", "components": [ { - "model": "CPointer", + "model": "CArray", "qualifiers": [], - "source_text": "" + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, { - "reference": "stbvox_input_description" + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" } ] }, - "parameters": [ - { - "name": "mm", - "type": { - "model": "CComposedType", - "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] - }, - "declared_type": { - "model": "CComposedType", - "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] - }, - "source_location": null, - "callback_policy": null - } + "storage": [ + "static" ], - "storage": [], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", + "initializer": { + "source_text": "{ 0,2,5,7 }" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3576, + "line": 2166, "column": 1, - "source_line": "stbvox_input_description *stbvox_get_input_description(stbvox_mesh_maker *mm)" + "source_line": "static unsigned char stbvox_vert_lerp_for_simple[4] = { 0,2,5,7 };" }, - "start": { - "filename": "stb/stb_voxel_render.h", - "line": 3576, - "column": 1, - "source_line": "stbvox_input_description *stbvox_get_input_description(stbvox_mesh_maker *mm)" + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_face3_updown": { + "name": "stbvox_face3_updown", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_face3_updown[8]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "8", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] }, - "end": { + "storage": [ + "static" + ], + "initializer": { + "source_text": "{ 0,2,5,7,0,2,5,7 }" + }, + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3579, + "line": 2167, "column": 1, - "source_line": "}" + "source_line": "static unsigned char stbvox_face3_updown[8] = { 0,2,5,7,0,2,5,7 }; // ignore top bit" }, + "callback_policy": null, "declaration_locations": [] }, - "stbvox_set_input_range": { - "name": "stbvox_set_input_range", - "result_type": { - "model": "CVoid", + "stbvox_vertex_vector": { + "name": "stbvox_vertex_vector", + "type": { + "model": "CComposedType", "qualifiers": [], - "source_text": "void" - }, - "parameters": [ - { - "name": "mm", - "type": { - "model": "CComposedType", - "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] - }, - "declared_type": { - "model": "CComposedType", - "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "x0", - "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int x0" - }, - "declared_type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int x0" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "y0", - "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int y0" - }, - "declared_type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int y0" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "z0", - "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int z0" - }, - "declared_type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int z0" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "x1", - "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int x1" - }, - "declared_type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int x1" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "y1", - "type": { - "model": "CInt", - "qualifiers": [], - "source_text": "int y1" - }, - "declared_type": { - "model": "CInt", + "source_text": "static unsigned char stbvox_vertex_vector[6][4][3]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "int y1" - }, - "source_location": null, - "callback_policy": null - }, - { - "name": "z1", - "type": { - "model": "CInt", + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", "qualifiers": [], - "source_text": "int z1" + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CInt", + { + "model": "CArray", "qualifiers": [], - "source_text": "int z1" + "source_text": "", + "bound": "3", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - } + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" ], - "storage": [], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", + "initializer": { + "source_text": "{\n { { 1,0,1 }, { 1,1,1 }, { 1,1,0 }, { 1,0,0 } }, \n { { 1,1,1 }, { 0,1,1 }, { 0,1,0 }, { 1,1,0 } }, \n { { 0,1,1 }, { 0,0,1 }, { 0,0,0 }, { 0,1,0 } }, \n { { 0,0,1 }, { 1,0,1 }, { 1,0,0 }, { 0,0,0 } }, \n { { 0,1,1 }, { 1,1,1 }, { 1,0,1 }, { 0,0,1 } }, \n { { 0,0,0 }, { 1,0,0 }, { 1,1,0 }, { 0,1,0 } }, \n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3581, + "line": 2170, "column": 1, - "source_line": "void stbvox_set_input_range(stbvox_mesh_maker *mm, int x0, int y0, int z0, int x1, int y1, int z1)" + "source_line": "static unsigned char stbvox_vertex_vector[6][4][3] =" }, - "start": { - "filename": "stb/stb_voxel_render.h", - "line": 3581, - "column": 1, - "source_line": "void stbvox_set_input_range(stbvox_mesh_maker *mm, int x0, int y0, int z0, int x1, int y1, int z1)" + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_vertex_selector": { + "name": "stbvox_vertex_selector", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_vertex_selector[6][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] }, - "end": { + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 5,7,3,1 },\n { 7,6,2,3 },\n { 6,4,0,2 },\n { 4,5,1,0 },\n { 6,7,5,4 },\n { 0,1,3,2 },\n}" + }, + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3596, + "line": 2181, "column": 1, - "source_line": "}" + "source_line": "static unsigned char stbvox_vertex_selector[6][4] =" }, + "callback_policy": null, "declaration_locations": [] }, - "stbvox_get_transform": { - "name": "stbvox_get_transform", - "result_type": { - "model": "CVoid", + "stbvox_vmesh_delta_normal": { + "name": "stbvox_vmesh_delta_normal", + "type": { + "model": "CComposedType", "qualifiers": [], - "source_text": "void" - }, - "parameters": [ - { - "name": "mm", - "type": { - "model": "CComposedType", + "source_text": "static stbvox_mesh_vertex stbvox_vmesh_delta_normal[6][4]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CComposedType", + { + "model": "CArray", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - }, - { - "name": "transform", - "type": { - "model": "CComposedType", + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { stbvox_vertex_encode(1,0,1,0,0) ,\n stbvox_vertex_encode(1,1,1,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) },\n { stbvox_vertex_encode(1,1,1,0,0) ,\n stbvox_vertex_encode(0,1,1,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) },\n { stbvox_vertex_encode(0,1,1,0,0) ,\n stbvox_vertex_encode(0,0,1,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) },\n { stbvox_vertex_encode(0,0,1,0,0) ,\n stbvox_vertex_encode(1,0,1,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) },\n { stbvox_vertex_encode(0,1,1,0,0) ,\n stbvox_vertex_encode(1,1,1,0,0) ,\n stbvox_vertex_encode(1,0,1,0,0) ,\n stbvox_vertex_encode(0,0,1,0,0) },\n { stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) }\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 2191, + "column": 1, + "source_line": "static stbvox_mesh_vertex stbvox_vmesh_delta_normal[6][4] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_vmesh_pre_vheight": { + "name": "stbvox_vmesh_pre_vheight", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbvox_mesh_vertex stbvox_vmesh_pre_vheight[6][4]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "float transform[3][3]", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "model": "CArray", - "qualifiers": [], - "source_text": "", - "bound": "3", - "is_static_minimum": false, - "is_variable_length": false, - "is_flexible": false - }, - { - "model": "CFloat", - "qualifiers": [], - "source_text": "float" - } - ] + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CComposedType", + { + "model": "CArray", "qualifiers": [], - "source_text": "float transform[3][3]", - "components": [ - { - "model": "CArray", - "qualifiers": [], - "source_text": "", - "bound": "3", - "is_static_minimum": false, - "is_variable_length": false, - "is_flexible": false - }, - { - "model": "CArray", - "qualifiers": [], - "source_text": "", - "bound": "3", - "is_static_minimum": false, - "is_variable_length": false, - "is_flexible": false - }, - { - "model": "CFloat", - "qualifiers": [], - "source_text": "float" - } - ] + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) },\n { stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) },\n { stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) },\n { stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) },\n { stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) },\n { stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) }\n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 2219, + "column": 1, + "source_line": "static stbvox_mesh_vertex stbvox_vmesh_pre_vheight[6][4] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_vmesh_delta_half_z": { + "name": "stbvox_vmesh_delta_half_z", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbvox_mesh_vertex stbvox_vmesh_delta_half_z[6][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - } + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "storage": [ + "static" ], - "storage": [], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", + "initializer": { + "source_text": "{\n { stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) },\n { stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) },\n { stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(0,0,2,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) },\n { stbvox_vertex_encode(0,0,2,0,0) ,\n stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) },\n { stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(0,0,2,0,0) },\n { stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) }\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3598, + "line": 2247, "column": 1, - "source_line": "void stbvox_get_transform(stbvox_mesh_maker *mm, float transform[3][3])" + "source_line": "static stbvox_mesh_vertex stbvox_vmesh_delta_half_z[6][4] =" }, - "start": { + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_vmesh_crossed_pair": { + "name": "stbvox_vmesh_crossed_pair", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static stbvox_mesh_vertex stbvox_vmesh_crossed_pair[6][4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "reference": "stbvox_mesh_vertex" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) },\n { stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(0,0,2,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) },\n { stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) },\n { stbvox_vertex_encode(0,0,2,0,0) ,\n stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,0,0,0,0) },\n \n { stbvox_vertex_encode(0,1,2,0,0) ,\n stbvox_vertex_encode(1,1,2,0,0) ,\n stbvox_vertex_encode(1,0,2,0,0) ,\n stbvox_vertex_encode(0,0,2,0,0) },\n { stbvox_vertex_encode(0,0,0,0,0) ,\n stbvox_vertex_encode(1,0,0,0,0) ,\n stbvox_vertex_encode(1,1,0,0,0) ,\n stbvox_vertex_encode(0,1,0,0,0) }\n}" + }, + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3598, + "line": 2275, "column": 1, - "source_line": "void stbvox_get_transform(stbvox_mesh_maker *mm, float transform[3][3])" + "source_line": "static stbvox_mesh_vertex stbvox_vmesh_crossed_pair[6][4] =" }, - "end": { + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_hasface": { + "name": "stbvox_hasface", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_hasface[STBVOX_MAX_GEOM][STBVOX_NUM_ROTATION]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBVOX_MAX_GEOM", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBVOX_NUM_ROTATION", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0,0,0,0 }, \n { 0,0,0,0 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 1|2|4|48, 8|1|2|48, 4|8|1|48, 2|4|8|48, }, \n { 1|2|4|48, 8|1|2|48, 4|8|1|48, 2|4|8|48, }, \n { 47,47,47,47 }, \n { 31,31,31,31 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n { 63,63,63,63 }, \n}" + }, + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3616, + "line": 2308, "column": 1, - "source_line": "}" + "source_line": "static unsigned char stbvox_hasface[STBVOX_MAX_GEOM][STBVOX_NUM_ROTATION] =" }, + "callback_policy": null, "declaration_locations": [] }, - "stbvox_get_bounds": { - "name": "stbvox_get_bounds", - "result_type": { - "model": "CVoid", + "stbvox_facetype": { + "name": "stbvox_facetype", + "type": { + "model": "CComposedType", "qualifiers": [], - "source_text": "void" - }, - "parameters": [ - { - "name": "mm", - "type": { - "model": "CComposedType", + "source_text": "static unsigned char stbvox_facetype[STBVOX_GEOM_count][6]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "", + "bound": "STBVOX_GEOM_count", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "declared_type": { - "model": "CComposedType", + { + "model": "CArray", "qualifiers": [], - "source_text": "stbvox_mesh_maker *mm", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "reference": "stbvox_mesh_maker" - } - ] + "source_text": "", + "bound": "6", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - }, - { - "name": "bounds", - "type": { - "model": "CComposedType", + { + "model": "CUnsignedChar", "qualifiers": [], - "source_text": "float bounds[2][3]", - "components": [ - { - "model": "CPointer", - "qualifiers": [], - "source_text": "" - }, - { - "model": "CArray", - "qualifiers": [], - "source_text": "", - "bound": "3", - "is_static_minimum": false, - "is_variable_length": false, - "is_flexible": false - }, - { - "model": "CFloat", - "qualifiers": [], - "source_text": "float" - } - ] - }, - "declared_type": { - "model": "CComposedType", + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n { 0, }, \n { STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid }, \n { STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid, STBVOX_FT_solid }, \n { STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force }, \n\n { STBVOX_FT_upper, STBVOX_FT_upper, STBVOX_FT_upper, STBVOX_FT_upper, STBVOX_FT_solid, STBVOX_FT_force },\n { STBVOX_FT_lower, STBVOX_FT_lower, STBVOX_FT_lower, STBVOX_FT_lower, STBVOX_FT_force, STBVOX_FT_solid },\n { STBVOX_FT_diag_123, STBVOX_FT_solid, STBVOX_FT_diag_023, STBVOX_FT_none, STBVOX_FT_force, STBVOX_FT_solid },\n { STBVOX_FT_diag_012, STBVOX_FT_solid, STBVOX_FT_diag_013, STBVOX_FT_none, STBVOX_FT_solid, STBVOX_FT_force },\n\n { STBVOX_FT_diag_123, STBVOX_FT_solid, STBVOX_FT_diag_023, STBVOX_FT_force, STBVOX_FT_none, STBVOX_FT_solid },\n { STBVOX_FT_diag_012, STBVOX_FT_solid, STBVOX_FT_diag_013, STBVOX_FT_force, STBVOX_FT_solid, STBVOX_FT_none },\n { STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, 0,0 }, \n { STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force, STBVOX_FT_force }, \n\n { STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial, STBVOX_FT_force, STBVOX_FT_solid }, \n { STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial, STBVOX_FT_force, STBVOX_FT_solid }, \n { STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial, STBVOX_FT_solid, STBVOX_FT_force }, \n { STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial,STBVOX_FT_partial, STBVOX_FT_solid, STBVOX_FT_force }, \n}" + }, + "bit_width": null, + "source_location": { + "filename": "stb/stb_voxel_render.h", + "line": 2329, + "column": 1, + "source_line": "static unsigned char stbvox_facetype[STBVOX_GEOM_count][6] =" + }, + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_floor_slope_for_rot": { + "name": "stbvox_floor_slope_for_rot", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_floor_slope_for_rot[4]", + "components": [ + { + "model": "CArray", "qualifiers": [], - "source_text": "float bounds[2][3]", - "components": [ - { - "model": "CArray", - "qualifiers": [], - "source_text": "", - "bound": "2", - "is_static_minimum": false, - "is_variable_length": false, - "is_flexible": false - }, - { - "model": "CArray", - "qualifiers": [], - "source_text": "", - "bound": "3", - "is_static_minimum": false, - "is_variable_length": false, - "is_flexible": false - }, - { - "model": "CFloat", - "qualifiers": [], - "source_text": "float" - } - ] + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false }, - "source_location": null, - "callback_policy": null - } + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" ], - "storage": [], - "specifiers": [], - "is_variadic": false, - "is_definition": true, - "prototype_style": "prototype", + "initializer": { + "source_text": "{\n STBVF_su,\n STBVF_wu, \n STBVF_nu,\n STBVF_eu,\n}" + }, + "bit_width": null, "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3618, + "line": 2354, "column": 1, - "source_line": "void stbvox_get_bounds(stbvox_mesh_maker *mm, float bounds[2][3])" + "source_line": "static unsigned char stbvox_floor_slope_for_rot[4] =" }, - "start": { + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_ceil_slope_for_rot": { + "name": "stbvox_ceil_slope_for_rot", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned char stbvox_ceil_slope_for_rot[4]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "4", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedChar", + "qualifiers": [], + "source_text": "unsigned char" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n STBVF_sd,\n STBVF_ed,\n STBVF_nd,\n STBVF_wd,\n}" + }, + "bit_width": null, + "source_location": { "filename": "stb/stb_voxel_render.h", - "line": 3618, + "line": 2362, "column": 1, - "source_line": "void stbvox_get_bounds(stbvox_mesh_maker *mm, float bounds[2][3])" + "source_line": "static unsigned char stbvox_ceil_slope_for_rot[4] =" }, - "end": { + "callback_policy": null, + "declaration_locations": [] + }, + "stbvox_face_visible": { + "name": "stbvox_face_visible", + "type": { + "model": "CComposedType", + "qualifiers": [], + "source_text": "static unsigned short stbvox_face_visible[STBVOX_FT_count]", + "components": [ + { + "model": "CArray", + "qualifiers": [], + "source_text": "", + "bound": "STBVOX_FT_count", + "is_static_minimum": false, + "is_variable_length": false, + "is_flexible": false + }, + { + "model": "CUnsignedShort", + "qualifiers": [], + "source_text": "unsigned short" + } + ] + }, + "storage": [ + "static" + ], + "initializer": { + "source_text": "{\n \n \n (unsigned short) ((~0x07ffu )<<5), \n (unsigned short) ((~((1u<" in source + assert "#include " in source + assert "#include " in source + assert "#include " in source + assert 'X2PY_PRINT_ARITHMETIC("size_t"' in source + assert 'X2PY_PRINT_ARITHMETIC("uint32_t"' in source + assert 'X2PY_PRINT_ARITHMETIC("time_t"' in source + assert "sizeof(FILE *)" in source + assert "sizeof(FILE)" not in source + + +def test_c_standard_type_probe_requires_an_explicit_compiler(): + with pytest.raises(CStandardTypeProbeError, match="exact compiler"): + probe_c_standard_types(PreprocessingConfig(mode="compiler")) + + +@pytest.mark.skipif(_CC is None, reason="requires an available native C compiler") +def test_c_standard_type_probe_reports_semantic_facts_from_native_compiler(): + report = probe_c_standard_types( + PreprocessingConfig(mode="compiler", compiler=_CC, std="c11") + ) + + size_t = report.types["size_t"] + assert size_t["available"] is True + assert size_t["kind"] == "integer" + assert size_t["signed"] is False + assert size_t["semantic_category"] == "unsigned_integer" + assert size_t["bits"] > 0 + + uint32_t = report.types["uint32_t"] + if uint32_t["available"]: + assert uint32_t["kind"] == "integer" + assert uint32_t["signed"] is False + assert uint32_t["bits"] == 32 + + time_t = report.types["time_t"] + assert time_t["available"] is True + assert time_t["semantic_category"] in { + "signed_integer", + "unsigned_integer", + "real", + "integer_implementation_signedness", + "implementation_defined", + } + + file_type = report.types["FILE"] + assert file_type["kind"] == "opaque_handle" + assert file_type["pointer_bits"] > 0 + assert report.recipe.compiler == _CC + assert "-std=c11" in report.recipe.compile_argv + assert "#include " in report.source_text + + +@pytest.mark.skipif(_CC is None, reason="requires an available native C compiler") +def test_c_standard_type_probe_carries_target_relevant_user_flags(tmp_path): + include_dir = tmp_path / "include" + include_dir.mkdir() + + report = probe_c_standard_types( + PreprocessingConfig( + mode="compiler", + compiler=_CC, + include_dirs=[str(include_dir)], + defines=["X2PY_FEATURE=1"], + undefs=["X2PY_OLD_FEATURE"], + std="c99", + compiler_args=["-funsigned-char"], + ) + ) + + argv = report.recipe.compile_argv + assert f"-I{include_dir}" in argv + assert "-DX2PY_FEATURE=1" in argv + assert "-UX2PY_OLD_FEATURE" in argv + assert "-std=c11" in argv + assert "-funsigned-char" in argv + assert report.recipe.requested_standard == "c99" + assert report.recipe.include_dirs == [str(include_dir)] + assert report.recipe.defines == ["X2PY_FEATURE=1"] + assert report.recipe.undefs == ["X2PY_OLD_FEATURE"] + assert report.recipe.compiler_args == ["-funsigned-char"] + + +@pytest.mark.skipif(_CC is None, reason="requires an available native C compiler") +def test_c_standard_type_probe_module_cli_emits_json_for_semantic_input(): + completed = subprocess.run( + [sys.executable, "-m", "x2py.c_type_probe", "--compiler", _CC], + capture_output=True, + text=True, + check=True, + ) + + payload = json.loads(completed.stdout) + assert payload["types"]["size_t"]["semantic_category"] == "unsigned_integer" + assert payload["types"]["FILE"]["kind"] == "opaque_handle" + assert payload["recipe"]["compiler"] == _CC + assert payload["source_text"].startswith("#include ") diff --git a/tests/parser/test_fortran_type_probe.py b/tests/parser/test_fortran_type_probe.py new file mode 100644 index 000000000..2c7472797 --- /dev/null +++ b/tests/parser/test_fortran_type_probe.py @@ -0,0 +1,204 @@ +# -*- coding: utf-8 -*- +"""Compiler-derived Fortran kind expression probe tests.""" + +import json +import shutil +import subprocess +import sys + +import pytest + +from semantics.fortran2ir import ( + collect_semantic_compile_time_requirements, + fortran_module_to_semantic_module, +) +from x2py import parse_fortran_file as parse_fortran_source +from x2py.fortran_type_probe import ( + FortranTypeProbeError, + build_fortran_type_probe_source, + evaluate_fortran_type_requirements, + fortran_type_probe_expressions, + probe_fortran_type_expressions, +) +from x2py.preprocessing import PreprocessingConfig + + +_FC = shutil.which("gfortran") or shutil.which("f95") + + +def test_fortran_type_probe_source_evaluates_integer_initialization_expressions(): + source = build_fortran_type_probe_source( + ["selected_real_kind(12)", "real64", "c_double"] + ) + + assert "use, intrinsic :: iso_fortran_env, only: real64" in source + assert "use, intrinsic :: iso_c_binding, only: c_double" in source + assert "integer, parameter :: x2py_value_0 = selected_real_kind(12)" in source + assert "integer, parameter :: x2py_value_1 = real64" in source + assert "integer, parameter :: x2py_value_2 = c_double" in source + assert '{"values":[' in source + + +def test_fortran_type_probe_rejects_statement_injection(): + with pytest.raises(FortranTypeProbeError, match="single initialization expression"): + build_fortran_type_probe_source(["selected_real_kind(12); stop"]) + + +def test_fortran_type_probe_requires_an_explicit_compiler(): + with pytest.raises(FortranTypeProbeError, match="exact compiler"): + probe_fortran_type_expressions( + PreprocessingConfig(mode="compiler"), + ["selected_real_kind(12)"], + ) + + +def test_fortran_type_probe_expressions_extracts_semantic_requirement_inputs(): + requirements = [ + {"code": "parameter_value", "symbol": "rk", "expression": "selected_real_kind(12)"}, + {"code": "unsupported_kind", "symbol": "x", "expression": "selected_real_kind(12)"}, + {"code": "parameter_value", "symbol": "ik", "expression": "selected_int_kind(9)"}, + ] + + assert fortran_type_probe_expressions(requirements) == [ + "selected_real_kind(12)", + "selected_int_kind(9)", + ] + + +@pytest.mark.skipif(_FC is None, reason="requires an available native Fortran compiler") +def test_fortran_type_probe_reports_values_from_native_compiler(): + report = probe_fortran_type_expressions( + PreprocessingConfig(mode="compiler", compiler=_FC), + ["selected_int_kind(9)", "selected_real_kind(12)", "kind(1.0d0)"], + ) + + assert report.values["selected_int_kind(9)"] > 0 + assert report.values["selected_real_kind(12)"] > 0 + assert report.values["kind(1.0d0)"] > 0 + assert report.recipe.compiler == _FC + assert "-cpp" in report.recipe.compile_argv + assert "selected_real_kind(12)" in report.source_text + + +@pytest.mark.skipif(_FC is None, reason="requires an available native Fortran compiler") +def test_fortran_type_probe_carries_target_relevant_user_flags(tmp_path): + include_dir = tmp_path / "include" + include_dir.mkdir() + + report = probe_fortran_type_expressions( + PreprocessingConfig( + mode="compiler", + compiler=_FC, + include_dirs=[str(include_dir)], + defines=["X2PY_FEATURE=1"], + undefs=["X2PY_OLD_FEATURE"], + std="f2008", + compiler_args=["-fno-range-check"], + ), + ["selected_real_kind(12)"], + ) + + argv = report.recipe.compile_argv + assert "-cpp" in argv + assert f"-I{include_dir}" in argv + assert "-DX2PY_FEATURE=1" in argv + assert "-UX2PY_OLD_FEATURE" in argv + assert "-std=f2008" in argv + assert "-fno-range-check" in argv + assert report.recipe.requested_standard == "f2008" + assert report.recipe.include_dirs == [str(include_dir)] + assert report.recipe.defines == ["X2PY_FEATURE=1"] + assert report.recipe.undefs == ["X2PY_OLD_FEATURE"] + assert report.recipe.compiler_args == ["-fno-range-check"] + + +@pytest.mark.skipif(_FC is None, reason="requires an available native Fortran compiler") +def test_fortran_type_probe_evaluates_collected_semantic_requirements(): + parsed = parse_fortran_source( + """ +module solver_mod + integer, parameter :: rk = selected_real_kind(12) +contains +subroutine scale(x) + real(kind=rk), intent(inout) :: x +end subroutine scale +end module solver_mod +""" + ) + requirements = collect_semantic_compile_time_requirements(parsed) + + values = evaluate_fortran_type_requirements( + PreprocessingConfig(mode="compiler", compiler=_FC), + requirements, + ) + module = fortran_module_to_semantic_module(parsed, compile_time_values=values) + + assert values["rk"] == values["selected_real_kind(12)"] + assert module.functions[0].arguments[0].semantic_type.name == "Float64" + + +@pytest.mark.skipif(_FC is None, reason="requires an available native Fortran compiler") +def test_fortran_type_probe_module_cli_emits_json_for_semantic_input(): + completed = subprocess.run( + [ + sys.executable, + "-m", + "x2py.fortran_type_probe", + "--compiler", + _FC, + "--expr", + "selected_int_kind(9)", + "--expr", + "selected_real_kind(12)", + ], + capture_output=True, + text=True, + check=True, + ) + + payload = json.loads(completed.stdout) + assert payload["values"]["selected_int_kind(9)"] > 0 + assert payload["values"]["selected_real_kind(12)"] > 0 + assert payload["recipe"]["compiler"] == _FC + assert payload["source_text"].startswith("program x2py_fortran_type_probe") + + +@pytest.mark.skipif(_FC is None, reason="requires an available native Fortran compiler") +def test_x2py_semantics_cli_evaluates_collected_fortran_type_requirements(tmp_path): + source = tmp_path / "solver.f90" + source.write_text( + """ +module solver_mod + integer, parameter :: rk = selected_real_kind(12) +contains +subroutine scale(x) + real(kind=rk), intent(inout) :: x +end subroutine scale +end module solver_mod +""", + encoding="utf-8", + ) + + completed = subprocess.run( + [ + sys.executable, + "-m", + "x2py", + str(source), + "--semantics", + "--preprocess", + "compiler", + "--compiler", + _FC, + "--json", + ], + capture_output=True, + text=True, + check=True, + ) + + payload = json.loads(completed.stdout) + semantic_type = payload[str(source)]["semantic_modules"][0]["functions"][0]["arguments"][0][ + "semantic_type" + ] + assert semantic_type["name"] == "Float64" diff --git a/tests/parser/test_preprocessing_cli.py b/tests/parser/test_preprocessing_cli.py new file mode 100644 index 000000000..aaf5cfcb9 --- /dev/null +++ b/tests/parser/test_preprocessing_cli.py @@ -0,0 +1,517 @@ +# -*- coding: utf-8 -*- +"""Shared preprocessing CLI and compiler-command contract tests.""" + +import json +import os +import subprocess +import sys +from pathlib import Path + +from x2py.preprocessing import ( + PreprocessingConfig, + build_compile_commands_invocation, + build_direct_preprocess_invocation, +) + + +def _fake_compiler(tmp_path: Path, output: str) -> tuple[Path, Path, dict[str, str]]: + script = tmp_path / "fake-cc" + args_file = tmp_path / "compiler-args.txt" + script.write_text( + f"""#!{sys.executable} +import os +import pathlib +import sys + +pathlib.Path(os.environ["X2PY_FAKE_COMPILER_ARGS"]).write_text("\\n".join(sys.argv[1:]), encoding="utf-8") +sys.stdout.write(os.environ["X2PY_FAKE_COMPILER_OUTPUT"]) +""", + encoding="utf-8", + ) + script.chmod(0o755) + env = { + **os.environ, + "X2PY_FAKE_COMPILER_ARGS": str(args_file), + "X2PY_FAKE_COMPILER_OUTPUT": output, + } + return script, args_file, env + + +def test_direct_c_preprocess_invocation_uses_exact_compiler_and_flags(tmp_path: Path): + source = tmp_path / "api.h" + config = PreprocessingConfig( + mode="compiler", + compiler="/usr/bin/clang-18", + include_dirs=["include", "/opt/sdk/include"], + defines=["API_EXPORT=", "USE_FAST"], + undefs=["DEBUG"], + std="c11", + compiler_args=["--sysroot=/opt/sdk", "-target", "x86_64-linux-gnu"], + ) + + invocation = build_direct_preprocess_invocation(source, language="c", config=config) + + assert invocation.argv == [ + "/usr/bin/clang-18", + "-E", + "-x", + "c", + "-Iinclude", + "-I/opt/sdk/include", + "-DAPI_EXPORT=", + "-DUSE_FAST", + "-UDEBUG", + "-std=c11", + "--sysroot=/opt/sdk", + "-target", + "x86_64-linux-gnu", + str(source), + ] + + +def test_direct_fortran_preprocess_invocation_uses_exact_compiler_and_cpp(tmp_path: Path): + source = tmp_path / "solver.F90" + config = PreprocessingConfig( + mode="compiler", + compiler="/usr/bin/gfortran-12", + include_dirs=["include"], + defines=["USE_MPI"], + undefs=["DEBUG"], + std="f2018", + ) + + invocation = build_direct_preprocess_invocation(source, language="fortran", config=config) + + assert invocation.argv == [ + "/usr/bin/gfortran-12", + "-E", + "-cpp", + "-Iinclude", + "-DUSE_MPI", + "-UDEBUG", + "-std=f2018", + str(source), + ] + + +def test_compile_commands_invocation_uses_database_compiler_and_filters_compile_only_args(tmp_path: Path): + source = tmp_path / "src" / "api.c" + source.parent.mkdir() + source.write_text("int api(void);\n", encoding="utf-8") + fake_compiler = tmp_path / "toolchains" / "gcc-13" + fake_compiler.parent.mkdir() + database = tmp_path / "compile_commands.json" + database.write_text( + json.dumps( + [ + { + "directory": str(tmp_path), + "file": str(source), + "arguments": [ + str(fake_compiler), + "-Iproject/include", + "-DPROJECT_API=", + "-c", + str(source), + "-o", + "api.o", + ], + } + ] + ), + encoding="utf-8", + ) + config = PreprocessingConfig(mode="compiler", compile_commands=str(database), defines=["CLI_DEFINE=1"]) + + invocation = build_compile_commands_invocation(source, config=config) + + assert invocation.cwd == str(tmp_path) + assert invocation.argv == [ + str(fake_compiler), + "-E", + "-DCLI_DEFINE=1", + "-Iproject/include", + "-DPROJECT_API=", + str(source), + ] + + +def test_cli_help_documents_exact_compiler_and_preprocessing_examples(): + res = subprocess.run( + [sys.executable, "-m", "x2py", "--help"], + capture_output=True, + text=True, + check=True, + ) + + assert "--preprocess {internal,compiler}" in res.stdout + assert "--compiler COMPILER" in res.stdout + assert "gcc-13" in res.stdout + assert "clang-18" in res.stdout + assert "/usr/bin/gfortran-12" in res.stdout + assert "--compile-commands build/compile_commands.json" in res.stdout + assert "-D USE_MPI" in res.stdout + + +def test_cli_c_internal_mode_accepts_include_dirs_for_raw_include_resolution(tmp_path: Path): + include_dir = tmp_path / "include" + include_dir.mkdir() + dependency = include_dir / "types.h" + header = tmp_path / "api.h" + dependency.write_text("typedef int api_int;\n", encoding="utf-8") + header.write_text('#include "types.h"\nint run(void);\n', encoding="utf-8") + + res = subprocess.run( + [ + sys.executable, + "-m", + "x2py", + str(header), + "--language", + "c", + "--parse", + "--json", + "-I", + str(include_dir), + ], + capture_output=True, + text=True, + check=True, + ) + payload = json.loads(res.stdout)[str(header)] + + assert payload["preprocessing"] == "raw" + assert payload["includes"][0]["resolved_path"] == str(dependency) + + +def test_cli_c_internal_mode_rejects_define_flags_that_need_compiler_selection(tmp_path: Path): + header = tmp_path / "api.h" + header.write_text("int run(void);\n", encoding="utf-8") + + res = subprocess.run( + [ + sys.executable, + "-m", + "x2py", + str(header), + "--language", + "c", + "--parse", + "-D", + "USE_FAST", + ], + capture_output=True, + text=True, + ) + + assert res.returncode == 2 + assert "raw C mode records source macros" in res.stderr + + +def test_cli_compiler_mode_requires_exact_compiler_or_compile_database(tmp_path: Path): + header = tmp_path / "api.h" + header.write_text("int run(void);\n", encoding="utf-8") + + res = subprocess.run( + [ + sys.executable, + "-m", + "x2py", + str(header), + "--language", + "c", + "--parse", + "--preprocess", + "compiler", + ], + capture_output=True, + text=True, + ) + + assert res.returncode == 2 + assert "requires --compiler with an exact executable" in res.stderr + + +def test_cli_compiler_specific_flags_require_compiler_mode(tmp_path: Path): + header = tmp_path / "api.h" + header.write_text("int run(void);\n", encoding="utf-8") + + res = subprocess.run( + [ + sys.executable, + "-m", + "x2py", + str(header), + "--language", + "c", + "--parse", + "--compiler", + "gcc-13", + ], + capture_output=True, + text=True, + ) + + assert res.returncode == 2 + assert "--compiler requires --preprocess compiler" in res.stderr + + +def test_cli_c_compiler_mode_runs_exact_compiler_and_parses_preprocessed_stdout(tmp_path: Path): + header = tmp_path / "api.h" + header.write_text("#define API(ret) ret\nAPI(int) hidden(void);\n", encoding="utf-8") + compiler, args_file, env = _fake_compiler(tmp_path, '# 44 "include/api.h"\nint expanded(void);\n') + + res = subprocess.run( + [ + sys.executable, + "-m", + "x2py", + str(header), + "--language", + "c", + "--parse", + "--json", + "--preprocess", + "compiler", + "--compiler", + str(compiler), + "-I", + "include", + "-D", + "API_EXPORT=", + "-U", + "DEBUG", + "--std", + "c11", + "--compiler-arg=--sysroot=/opt/sdk", + ], + capture_output=True, + text=True, + check=True, + env=env, + ) + payload = json.loads(res.stdout)[str(header)] + compiler_args = args_file.read_text(encoding="utf-8").splitlines() + + assert payload["preprocessing"] == "compiler" + assert [fn["name"] for fn in payload["functions"]] == ["expanded"] + assert payload["functions"][0]["origin"] == "preprocessed" + assert payload["functions"][0]["source_location"]["filename"] == "include/api.h" + assert payload["functions"][0]["source_location"]["line"] == 44 + assert compiler_args == [ + "-E", + "-x", + "c", + "-Iinclude", + "-DAPI_EXPORT=", + "-UDEBUG", + "-std=c11", + "--sysroot=/opt/sdk", + str(header), + ] + recipe = payload["preprocessing_recipe"] + assert recipe["mode"] == "compiler" + assert recipe["language"] == "c" + assert recipe["source_path"] == str(header) + assert recipe["compiler"] == str(compiler) + assert recipe["argv"] == [str(compiler), *compiler_args] + assert recipe["include_dirs"] == ["include"] + assert recipe["defines"] == ["API_EXPORT="] + assert recipe["undefs"] == ["DEBUG"] + assert recipe["standard"] == "c11" + assert recipe["compiler_args"] == ["--sysroot=/opt/sdk"] + assert recipe["compile_commands"] is None + assert recipe["compile_commands_entry"] is None + assert payload["original_source_paths"] == ["include/api.h"] + + +def test_cli_c_compile_commands_mode_uses_exact_database_compiler(tmp_path: Path): + source = tmp_path / "api.c" + source.write_text("API(int) hidden(void);\n", encoding="utf-8") + compiler, args_file, env = _fake_compiler(tmp_path, '#line 12 "generated/api.h"\nint from_database(void);\n') + database = tmp_path / "compile_commands.json" + database.write_text( + json.dumps( + [ + { + "directory": str(tmp_path), + "file": str(source), + "arguments": [ + str(compiler), + "-Iproject/include", + "-DPROJECT_API=", + "-c", + str(source), + "-o", + "api.o", + ], + } + ] + ), + encoding="utf-8", + ) + + res = subprocess.run( + [ + sys.executable, + "-m", + "x2py", + str(source), + "--language", + "c", + "--parse", + "--json", + "--preprocess", + "compiler", + "--compile-commands", + str(database), + ], + capture_output=True, + text=True, + check=True, + env=env, + ) + payload = json.loads(res.stdout)[str(source)] + compiler_args = args_file.read_text(encoding="utf-8").splitlines() + + assert [fn["name"] for fn in payload["functions"]] == ["from_database"] + assert payload["functions"][0]["source_location"]["filename"] == "generated/api.h" + assert payload["functions"][0]["source_location"]["line"] == 12 + assert compiler_args == ["-E", "-Iproject/include", "-DPROJECT_API=", str(source)] + recipe = payload["preprocessing_recipe"] + assert recipe["compiler"] == str(compiler) + assert recipe["argv"] == [str(compiler), *compiler_args] + assert recipe["cwd"] == str(tmp_path) + assert recipe["compile_commands"] == str(database) + assert recipe["compile_commands_entry"]["file"] == str(source) + assert recipe["compile_commands_entry"]["arguments"][0] == str(compiler) + + +def test_cli_fortran_internal_mode_uses_define_and_undef_for_branch_selection(tmp_path: Path): + source = tmp_path / "branch.F90" + source.write_text( + """ +#ifdef USE_MPI +subroutine selected() +end subroutine selected +#else +subroutine fallback() +end subroutine fallback +#endif +""".strip(), + encoding="utf-8", + ) + + selected = subprocess.run( + [sys.executable, "-m", "x2py", str(source), "--parse", "-D", "USE_MPI"], + capture_output=True, + text=True, + check=True, + ) + fallback = subprocess.run( + [sys.executable, "-m", "x2py", str(source), "--parse", "-U", "USE_MPI"], + capture_output=True, + text=True, + check=True, + ) + + assert "subroutine selected" in selected.stdout + assert "subroutine fallback" not in selected.stdout + assert "subroutine fallback" in fallback.stdout + assert "subroutine selected" not in fallback.stdout + + +def test_cli_fortran_internal_json_records_macro_selection_recipe(tmp_path: Path): + source = tmp_path / "branch.F90" + source.write_text( + "#ifdef USE_MPI\nsubroutine selected()\nend subroutine selected\n#endif\n", + encoding="utf-8", + ) + + res = subprocess.run( + [sys.executable, "-m", "x2py", str(source), "--parse", "--json", "-D", "USE_MPI", "-U", "DEBUG"], + capture_output=True, + text=True, + check=True, + ) + recipe = json.loads(res.stdout)[str(source)]["preprocessing_recipe"] + + assert recipe["mode"] == "internal" + assert recipe["language"] == "fortran" + assert recipe["source_path"] == str(source) + assert recipe["compiler"] is None + assert recipe["argv"] == [] + assert recipe["defines"] == ["USE_MPI"] + assert recipe["undefs"] == ["DEBUG"] + + +def test_cli_fortran_internal_mode_rejects_include_dirs_that_need_compiler(tmp_path: Path): + source = tmp_path / "mini.F90" + source.write_text("subroutine work()\nend subroutine work\n", encoding="utf-8") + + res = subprocess.run( + [sys.executable, "-m", "x2py", str(source), "--parse", "-I", "include"], + capture_output=True, + text=True, + ) + + assert res.returncode == 2 + assert "affects Fortran only with --preprocess compiler" in res.stderr + + +def test_cli_fortran_compiler_mode_runs_exact_compiler_and_parses_stdout(tmp_path: Path): + source = tmp_path / "generated.F90" + source.write_text("#define MAKE_SUBROUTINE name\n", encoding="utf-8") + compiler, args_file, env = _fake_compiler( + tmp_path, + "subroutine from_compiler()\nend subroutine from_compiler\n", + ) + + res = subprocess.run( + [ + sys.executable, + "-m", + "x2py", + str(source), + "--parse", + "--json", + "--preprocess", + "compiler", + "--compiler", + str(compiler), + "-I", + "include", + "-D", + "USE_MPI", + "-U", + "DEBUG", + "--std", + "f2018", + ], + capture_output=True, + text=True, + check=True, + env=env, + ) + compiler_args = args_file.read_text(encoding="utf-8").splitlines() + payload = json.loads(res.stdout)[str(source)] + + assert [signature["name"] for signature in payload["signatures"]] == ["from_compiler"] + assert compiler_args == [ + "-E", + "-cpp", + "-Iinclude", + "-DUSE_MPI", + "-UDEBUG", + "-std=f2018", + str(source), + ] + recipe = payload["preprocessing_recipe"] + assert recipe["mode"] == "compiler" + assert recipe["language"] == "fortran" + assert recipe["compiler"] == str(compiler) + assert recipe["argv"] == [str(compiler), *compiler_args] + assert recipe["include_dirs"] == ["include"] + assert recipe["defines"] == ["USE_MPI"] + assert recipe["undefs"] == ["DEBUG"] + assert recipe["standard"] == "f2018" diff --git a/x2py/__init__.py b/x2py/__init__.py index f6ad8819a..5f25e1c52 100644 --- a/x2py/__init__.py +++ b/x2py/__init__.py @@ -1,5 +1,7 @@ """Public x2py API.""" +from importlib import import_module + from fortran_parser.models import ( FortranArgument, FortranBlockData, @@ -25,7 +27,25 @@ from .cli import main +_FORTRAN_TYPE_PROBE_EXPORTS = { + "FortranTypeProbeError", + "FortranTypeProbeReport", + "build_fortran_type_probe_source", + "evaluate_fortran_type_requirements", + "fortran_type_probe_expressions", + "probe_fortran_type_expressions", +} + + +def __getattr__(name: str): + if name in _FORTRAN_TYPE_PROBE_EXPORTS: + module = import_module("x2py.fortran_type_probe") + return getattr(module, name) + raise AttributeError(f"module 'x2py' has no attribute {name!r}") + __all__ = ( + "FortranTypeProbeError", + "FortranTypeProbeReport", "FortranArgument", "FortranBlockData", "FortranDerivedType", @@ -39,14 +59,18 @@ "FortranSubmodule", "assess_pyi_wrap_readiness", "assess_semantic_wrap_readiness", + "build_fortran_type_probe_source", "collect_semantic_compile_time_requirements", "convert_pyi_to_ir", + "evaluate_fortran_type_requirements", "fortran_file_to_semantic_modules", + "fortran_type_probe_expressions", "fortran_module_to_semantic_module", "load_pyi_file", "main", "parse_fortran_file", "parse_fortran_project", "parse_pyi_text", + "probe_fortran_type_expressions", "resolve_semantic_compile_time_values", ) diff --git a/x2py/c_type_probe.py b/x2py/c_type_probe.py new file mode 100644 index 000000000..13bb67eb5 --- /dev/null +++ b/x2py/c_type_probe.py @@ -0,0 +1,310 @@ +# -*- coding: utf-8 -*- +"""Compiler-derived ABI facts for common C standard-library types. + +This module deliberately runs a generated C executable instead of hard-coding +typedef spellings. Names such as ``size_t`` and ``time_t`` are target/compiler +facts, while ``FILE`` is an opaque library handle for wrapper purposes. +""" + +from __future__ import annotations + +import argparse +from dataclasses import asdict, dataclass +import json +import os +from pathlib import Path +import shlex +import subprocess +import tempfile +from collections.abc import Sequence + +from .preprocessing import PreprocessingConfig, validate_macro_name + + +class CStandardTypeProbeError(ValueError): + """Raised when a compiler-derived C standard type probe cannot run.""" + + +@dataclass(frozen=True) +class CStandardTypeProbeRecipe: + """Commands and input flags needed to reproduce one probe result.""" + + compiler: str + compile_argv: list[str] + run_argv: list[str] + probe_standard: str = "c11" + requested_standard: str | None = None + include_dirs: list[str] | None = None + defines: list[str] | None = None + undefs: list[str] | None = None + compiler_args: list[str] | None = None + + +@dataclass(frozen=True) +class CStandardTypeProbeReport: + """JSON-stable ABI facts suitable as input to later C semantic mapping.""" + + types: dict[str, dict[str, object]] + recipe: CStandardTypeProbeRecipe + source_text: str + + def to_dict(self) -> dict[str, object]: + """Return a JSON-compatible report.""" + return asdict(self) + + +_SIGNED_INTEGER_TYPES = { + "signed char", + "short", + "int", + "long", + "long long", +} +_UNSIGNED_INTEGER_TYPES = { + "unsigned char", + "unsigned short", + "unsigned int", + "unsigned long", + "unsigned long long", +} +_REAL_TYPES = {"float", "double", "long double"} + + +def build_c_standard_type_probe_source() -> str: + """Return the C11 source compiled by :func:`probe_c_standard_types`.""" + return r"""#include +#include +#include +#include +#include + +#define X2PY_BASE_TYPE(value) _Generic((value), \ + char: "char", \ + signed char: "signed char", \ + unsigned char: "unsigned char", \ + short: "short", \ + unsigned short: "unsigned short", \ + int: "int", \ + unsigned int: "unsigned int", \ + long: "long", \ + unsigned long: "unsigned long", \ + long long: "long long", \ + unsigned long long: "unsigned long long", \ + float: "float", \ + double: "double", \ + long double: "long double", \ + default: "other") + +#define X2PY_PRINT_ARITHMETIC(name, header, type) \ + printf("\"" name "\":{\"header\":\"" header "\",\"available\":true," \ + "\"kind\":\"arithmetic\",\"underlying_c_type\":\"%s\"," \ + "\"bits\":%zu,\"alignment_bits\":%zu}", \ + X2PY_BASE_TYPE((type)0), \ + sizeof(type) * (size_t)CHAR_BIT, \ + _Alignof(type) * (size_t)CHAR_BIT) + +int main(void) { + printf("{\"types\":{"); + X2PY_PRINT_ARITHMETIC("size_t", "stddef.h", size_t); + printf(","); +#ifdef UINT32_MAX + X2PY_PRINT_ARITHMETIC("uint32_t", "stdint.h", uint32_t); +#else + printf("\"uint32_t\":{\"header\":\"stdint.h\",\"available\":false}"); +#endif + printf(","); + X2PY_PRINT_ARITHMETIC("time_t", "time.h", time_t); + printf(",\"FILE\":{\"header\":\"stdio.h\",\"available\":true," + "\"kind\":\"opaque_handle\",\"pointer_bits\":%zu," + "\"pointer_alignment_bits\":%zu}", + sizeof(FILE *) * (size_t)CHAR_BIT, + _Alignof(FILE *) * (size_t)CHAR_BIT); + printf("}}\n"); + return 0; +} +""" + + +def _probe_compile_flags(config: PreprocessingConfig) -> list[str]: + """Carry target-relevant compiler flags into the generated C11 probe.""" + flags = [f"-I{path}" for path in config.include_dirs] + flags.extend(f"-D{define}" for define in config.defines) + flags.extend(f"-U{undef}" for undef in config.undefs) + flags.append("-std=c11") + flags.extend(config.compiler_args) + return flags + + +def _semantic_type_facts(types: dict[str, dict[str, object]]) -> None: + """Classify arithmetic results for later semantic type conversion.""" + for fact in types.values(): + if not fact.get("available") or fact.get("kind") != "arithmetic": + continue + underlying = fact.get("underlying_c_type") + if underlying in _SIGNED_INTEGER_TYPES: + fact["kind"] = "integer" + fact["signed"] = True + fact["semantic_category"] = "signed_integer" + elif underlying in _UNSIGNED_INTEGER_TYPES: + fact["kind"] = "integer" + fact["signed"] = False + fact["semantic_category"] = "unsigned_integer" + elif underlying in _REAL_TYPES: + fact["kind"] = "real" + fact["semantic_category"] = "real" + elif underlying == "char": + fact["kind"] = "integer" + fact["semantic_category"] = "integer_implementation_signedness" + else: + fact["semantic_category"] = "implementation_defined" + + +def probe_c_standard_types( + config: PreprocessingConfig, + *, + runner: Sequence[str] | None = None, +) -> CStandardTypeProbeReport: + """Compile and execute the standard-type probe for one compiler target. + + The default runner executes the produced binary directly, which is + appropriate for native builds. Cross-compiled targets must provide a + runner such as an emulator; the command is recorded in the result. + """ + if not config.compiler: + raise CStandardTypeProbeError( + "C standard type probing requires an exact compiler executable" + ) + if config.compile_commands: + raise CStandardTypeProbeError( + "C standard type probing does not consume compile_commands directly; " + "pass the selected target/include/compiler flags explicitly" + ) + + with tempfile.TemporaryDirectory(prefix="x2py-c-type-probe-") as temp_dir: + source_path = Path(temp_dir) / "c_standard_type_probe.c" + executable_path = Path(temp_dir) / ( + "c_standard_type_probe.exe" if os.name == "nt" else "c_standard_type_probe" + ) + source_text = build_c_standard_type_probe_source() + source_path.write_text(source_text, encoding="utf-8") + + compile_argv = [ + config.compiler, + "-x", + "c", + *_probe_compile_flags(config), + str(source_path), + "-o", + str(executable_path), + ] + try: + compiled = subprocess.run( + compile_argv, + capture_output=True, + text=True, + check=False, + ) + except OSError as exc: + raise CStandardTypeProbeError( + f"failed to run C type probe compiler {config.compiler!r}: {exc}" + ) from exc + if compiled.returncode != 0: + command = " ".join(shlex.quote(arg) for arg in compile_argv) + detail = f": {compiled.stderr.strip()}" if compiled.stderr.strip() else "" + raise CStandardTypeProbeError( + f"C standard type probe compilation failed with `{command}`{detail}" + ) + + run_argv = [*(runner or ()), str(executable_path)] + try: + completed = subprocess.run( + run_argv, + capture_output=True, + text=True, + check=False, + ) + except OSError as exc: + raise CStandardTypeProbeError( + "failed to execute C standard type probe; provide a compatible " + f"runner for cross-compiled targets: {exc}" + ) from exc + if completed.returncode != 0: + command = " ".join(shlex.quote(arg) for arg in run_argv) + detail = f": {completed.stderr.strip()}" if completed.stderr.strip() else "" + raise CStandardTypeProbeError( + f"C standard type probe execution failed with `{command}`{detail}" + ) + try: + payload = json.loads(completed.stdout) + except json.JSONDecodeError as exc: + raise CStandardTypeProbeError( + f"C standard type probe produced invalid JSON: {exc}" + ) from exc + + types = payload.get("types") + if not isinstance(types, dict): + raise CStandardTypeProbeError("C standard type probe output is missing 'types'") + _semantic_type_facts(types) + return CStandardTypeProbeReport( + types=types, + recipe=CStandardTypeProbeRecipe( + compiler=config.compiler, + compile_argv=compile_argv, + run_argv=run_argv, + requested_standard=config.std, + include_dirs=list(config.include_dirs), + defines=list(config.defines), + undefs=list(config.undefs), + compiler_args=list(config.compiler_args), + ), + source_text=source_text, + ) + + +def main(argv: list[str] | None = None) -> int: + """Run a compiler-derived C standard type probe and write JSON.""" + parser = argparse.ArgumentParser( + description="Probe C standard-library typedef ABI facts through an exact compiler." + ) + parser.add_argument("--compiler", required=True, help="Exact native or cross C compiler executable.") + parser.add_argument("-I", "--include-dir", dest="include_dirs", action="append", default=[]) + parser.add_argument("-D", "--define", dest="defines", action="append", default=[]) + parser.add_argument("-U", "--undef", dest="undefs", action="append", default=[]) + parser.add_argument("--std", help="Original project standard recorded as provenance; the probe itself uses C11.") + parser.add_argument("--compiler-arg", dest="compiler_args", action="append", default=[]) + parser.add_argument("--runner", dest="runner", action="append", default=[], help="Runner command item for cross targets; repeat for arguments.") + args = parser.parse_args(argv) + try: + for define in args.defines: + validate_macro_name(define, "--define/-D") + for undef in args.undefs: + validate_macro_name(undef, "--undef/-U") + report = probe_c_standard_types( + PreprocessingConfig( + mode="compiler", + compiler=args.compiler, + include_dirs=args.include_dirs, + defines=args.defines, + undefs=args.undefs, + std=args.std, + compiler_args=args.compiler_args, + ), + runner=args.runner or None, + ) + except ValueError as exc: + parser.error(str(exc)) + print(json.dumps(report.to_dict(), indent=2)) + return 0 + + +if __name__ == "__main__": # pragma: no cover - exercised through CLI tests. + raise SystemExit(main()) + + +__all__ = ( + "CStandardTypeProbeError", + "CStandardTypeProbeRecipe", + "CStandardTypeProbeReport", + "build_c_standard_type_probe_source", + "probe_c_standard_types", +) diff --git a/x2py/cli.py b/x2py/cli.py index f18d9f056..0da4f0401 100644 --- a/x2py/cli.py +++ b/x2py/cli.py @@ -15,6 +15,12 @@ from semantics.fortran2ir import fortran_file_to_semantic_modules from semantics.pyi_parser import load_pyi_file from semantics.readiness import assess_semantic_wrap_readiness +from x2py.preprocessing import ( + PreprocessingConfig, + PreprocessingError, + run_compiler_preprocessor_with_recipe, + validate_macro_name, +) _TRUE_VALUES = {"1", "true", "yes", "on"} @@ -80,13 +86,52 @@ def _expand_readiness_paths(paths: list[str]) -> list[Path]: return sorted(set(expanded)) -def _parse_report(paths: list[str]) -> dict[str, dict]: +def _fortran_source_for_path( + path: Path, + preprocessing: PreprocessingConfig, +) -> tuple[str, dict[str, int | str] | None, dict[str, object] | None]: + if preprocessing.uses_compiler: + source, recipe = run_compiler_preprocessor_with_recipe( + path, + language="fortran", + config=preprocessing, + ) + return source, None, recipe.to_dict() + macro_defines = preprocessing.fortran_macro_defines() + return ( + path.read_text(encoding="utf-8"), + macro_defines or None, + preprocessing.fortran_internal_recipe(path), + ) + + +def _c_source_loader(preprocessing: PreprocessingConfig): + if not preprocessing.uses_compiler: + return None + + def load(path: Path) -> tuple[str, dict[str, object]]: + source, recipe = run_compiler_preprocessor_with_recipe( + path, + language="c", + config=preprocessing, + ) + return source, recipe.to_dict() + + return load + + +def _c_parser_preprocessing_mode(preprocessing: PreprocessingConfig) -> str: + return "compiler" if preprocessing.uses_compiler else "raw" + + +def _parse_report(paths: list[str], preprocessing: PreprocessingConfig | None = None) -> dict[str, dict]: + preprocessing = preprocessing or PreprocessingConfig() out: dict[str, dict] = {} parser = FortranParser() for p in _expand_paths(paths): - code = p.read_text(encoding="utf-8") - parsed = parser.visit_file(code, filename=str(p)) - out[str(p)] = { + code, macro_defines, preprocessing_recipe = _fortran_source_for_path(p, preprocessing) + parsed = parser.visit_file(code, filename=str(p), macro_defines=macro_defines) + payload = { "signatures": [_to_dict_no_parent(s) for s in parsed.procedures], "types": [_to_dict_no_parent(t) for t in parsed.derived_types], "modules": [_to_dict_no_parent(m) for m in parsed.modules], @@ -94,19 +139,27 @@ def _parse_report(paths: list[str]) -> dict[str, dict]: "programs": [_to_dict_no_parent(m) for m in parsed.programs], "block_data": [_to_dict_no_parent(m) for m in parsed.block_data_units], } + if preprocessing_recipe is not None: + payload["preprocessing_recipe"] = preprocessing_recipe + out[str(p)] = payload return out -def _semantic_report(paths: list[str]) -> dict[str, dict]: +def _semantic_report(paths: list[str], preprocessing: PreprocessingConfig | None = None) -> dict[str, dict]: from semantics.fortran2ir import fortran_module_to_semantic_module from semantics.pyi_printer import emit_module + preprocessing = preprocessing or PreprocessingConfig() out: dict[str, dict] = {} parser = FortranParser() for p in _expand_paths(paths): - code = p.read_text(encoding="utf-8") - fobj = parser.visit_file(code, filename=str(p)) - modules = [fortran_module_to_semantic_module(m) for m in fobj.modules] + code, macro_defines, _preprocessing_recipe = _fortran_source_for_path(p, preprocessing) + fobj = parser.visit_file(code, filename=str(p), macro_defines=macro_defines) + compile_time_values = _fortran_compile_time_values(fobj, preprocessing) + modules = [ + fortran_module_to_semantic_module(m, compile_time_values=compile_time_values) + for m in fobj.modules + ] out[str(p)] = { "semantic_modules": [asdict(m) for m in modules], "pyi": "\n\n".join(emit_module(m) for m in modules).strip(), @@ -123,7 +176,8 @@ def _format_pyi_report(semantic_report: dict[str, dict]) -> str: return "\n".join(lines).rstrip() -def _wrap_readiness_report(paths: list[str]) -> dict[str, dict]: +def _wrap_readiness_report(paths: list[str], preprocessing: PreprocessingConfig | None = None) -> dict[str, dict]: + preprocessing = preprocessing or PreprocessingConfig() out: dict[str, dict] = {} parser = FortranParser() for p in _expand_readiness_paths(paths): @@ -131,9 +185,14 @@ def _wrap_readiness_report(paths: list[str]) -> dict[str, dict]: modules = [load_pyi_file(p)] source_kind = "pyi" else: - code = p.read_text(encoding="utf-8") - parsed = parser.visit_file(code, filename=str(p)) - modules = fortran_file_to_semantic_modules(parsed, standalone_module_name=p.stem) + code, macro_defines, _preprocessing_recipe = _fortran_source_for_path(p, preprocessing) + parsed = parser.visit_file(code, filename=str(p), macro_defines=macro_defines) + compile_time_values = _fortran_compile_time_values(parsed, preprocessing) + modules = fortran_file_to_semantic_modules( + parsed, + standalone_module_name=p.stem, + compile_time_values=compile_time_values, + ) source_kind = "fortran" out[str(p)] = { @@ -144,6 +203,23 @@ def _wrap_readiness_report(paths: list[str]) -> dict[str, dict]: return out +def _fortran_compile_time_values( + parsed, + preprocessing: PreprocessingConfig, +) -> dict[str, int] | None: + """Evaluate compiler-dependent Fortran values when a compiler is configured.""" + if not preprocessing.uses_compiler or not preprocessing.compiler: + return None + + from semantics.fortran2ir import collect_semantic_compile_time_requirements + from x2py.fortran_type_probe import evaluate_fortran_type_requirements + + requirements = collect_semantic_compile_time_requirements(parsed) + if not requirements: + return None + return evaluate_fortran_type_requirements(preprocessing, requirements) + + def _attach_wrap_readiness(payload: dict[str, dict] | None, readiness_report: dict[str, dict] | None) -> None: if not payload or not readiness_report: return @@ -198,6 +274,55 @@ def _format_semantic_readiness(readiness_report: dict[str, dict]) -> str: return "\n".join(lines).rstrip() +def _build_preprocessing_config(args: argparse.Namespace, parser: argparse.ArgumentParser) -> PreprocessingConfig: + """Build and validate the shared preprocessing CLI configuration.""" + defines = list(args.defines or []) + undefs = list(args.undefs or []) + for define in defines: + try: + validate_macro_name(define, "--define/-D") + except PreprocessingError as exc: + parser.error(str(exc)) + for undef in undefs: + try: + validate_macro_name(undef, "--undef/-U") + except PreprocessingError as exc: + parser.error(str(exc)) + + config = PreprocessingConfig( + mode=args.preprocess, + compiler=args.compiler, + compile_commands=args.compile_commands, + include_dirs=list(args.include_dirs or []), + defines=defines, + undefs=undefs, + std=args.std, + compiler_args=list(args.compiler_args or []), + ) + + compiler_only_flags = [ + ("--compiler", args.compiler), + ("--compile-commands", args.compile_commands), + ("--std", args.std), + ("--compiler-arg", args.compiler_args), + ] + for option, value in compiler_only_flags: + if value and not config.uses_compiler: + parser.error(f"{option} requires --preprocess compiler") + + if config.uses_compiler and not config.compiler and not config.compile_commands: + parser.error("--preprocess compiler requires --compiler with an exact executable, for example gcc-13 or /usr/bin/clang-18") + if config.compile_commands and args.language != "c": + parser.error("--compile-commands is only supported with --language c") + if config.compile_commands and not config.uses_compiler: + parser.error("--compile-commands requires --preprocess compiler") + if args.language == "c" and not config.uses_compiler and (defines or undefs): + parser.error("-D/--define and -U/--undef affect C only with --preprocess compiler; raw C mode records source macros without selecting branches") + if args.language == "fortran" and not config.uses_compiler and config.include_dirs: + parser.error("-I/--include-dir affects Fortran only with --preprocess compiler") + return config + + def print_pyi_output(code: str) -> None: # Safe fallback for files, pipes, CI, unsupported terminals, etc. if not sys.stdout.isatty(): @@ -246,6 +371,16 @@ def main() -> int: " python -m x2py path/to/file.f90 --parse --json\n" " Parse C subset JSON:\n" " python -m x2py path/to/api.h --language c --parse --json\n" + " Parse C with an exact compiler executable and API flags:\n" + " python -m x2py path/to/api.h --language c --parse --preprocess compiler --compiler clang-18 -I include -D API_EXPORT= --std c11\n" + " Parse C with a compiler path and target/sysroot passthrough flags:\n" + " python -m x2py path/to/api.c --language c --parse --preprocess compiler --compiler /usr/bin/gcc-13 --compiler-arg=--sysroot=/opt/sdk\n" + " Parse C with compile_commands.json for project flags:\n" + " python -m x2py path/to/api.c --language c --parse --preprocess compiler --compile-commands build/compile_commands.json\n" + " Parse Fortran with internal macro branch selection:\n" + " python -m x2py path/to/file.F90 --parse -D USE_MPI -U DEBUG\n" + " Parse Fortran with an exact compiler executable:\n" + " python -m x2py path/to/file.F90 --parse --preprocess compiler --compiler /usr/bin/gfortran-12 -I include -D USE_MPI\n" " Write parser JSON:\n" " python -m x2py path/to/file.f90 --parse --json --out report.json\n" " Write one JSON file next to each source:\n" @@ -277,6 +412,64 @@ def main() -> int: help="Frontend language. Defaults to fortran; C currently supports partial --parse output.", ) parser.add_argument("--parse", action="store_true", help="Run and output parser stage report") + parser.add_argument( + "--preprocess", + choices=("internal", "compiler"), + default="internal", + help=( + "Preprocessing mode. 'internal' keeps the current lightweight parser preprocessing " + "(Fortran macro selection, C raw directive metadata). 'compiler' runs the exact " + "compiler/preprocessor configured by --compiler or --compile-commands." + ), + ) + parser.add_argument( + "--compiler", + help=( + "Exact compiler/preprocessor executable for --preprocess compiler, e.g. gcc-13, " + "clang-18, /usr/bin/gfortran-12, or /opt/intel/oneapi/compiler/latest/bin/ifx." + ), + ) + parser.add_argument( + "--compile-commands", + metavar="PATH", + help="C compile_commands.json database used with --language c --preprocess compiler.", + ) + parser.add_argument( + "-I", + "--include-dir", + dest="include_dirs", + action="append", + metavar="DIR", + help="Include directory passed as -IDIR during compiler preprocessing.", + ) + parser.add_argument( + "-D", + "--define", + dest="defines", + action="append", + metavar="NAME[=VALUE]", + help="Define a preprocessing macro. NAME means NAME=1; NAME=VALUE preserves VALUE.", + ) + parser.add_argument( + "-U", + "--undef", + dest="undefs", + action="append", + metavar="NAME", + help="Undefine a preprocessing macro.", + ) + parser.add_argument( + "--std", + metavar="STANDARD", + help="Language standard passed to compiler mode, e.g. c11, c23, f2008, or f2018.", + ) + parser.add_argument( + "--compiler-arg", + dest="compiler_args", + action="append", + metavar="ARG", + help="Raw compiler preprocessing argument. Use --compiler-arg=-target for values starting with '-'.", + ) parser.add_argument( "--show-vars", action="store_true", @@ -306,6 +499,7 @@ def main() -> int: parser.add_argument("--no-color", action="store_true", help="Disable ANSI color in parse diagnostics") parser.add_argument("--debug-traceback", action="store_true", help="Re-raise parser errors for debug") args = parser.parse_args() + preprocessing = _build_preprocessing_config(args, parser) if args.language == "c": if not (args.parse or args.semantics or args.pyi or args.wrap_readiness): @@ -334,12 +528,17 @@ def main() -> int: try: parse_payload = ( - parse_c_report(args.paths) + parse_c_report( + args.paths, + include_dirs=preprocessing.include_dirs, + preprocessing=_c_parser_preprocessing_mode(preprocessing), + source_loader=_c_source_loader(preprocessing), + ) if args.parse and args.language == "c" - else _parse_report(args.paths) if args.parse else None + else _parse_report(args.paths, preprocessing) if args.parse else None ) - semantic_payload = _semantic_report(args.paths) if (args.semantics or args.pyi) else None - readiness_payload = _wrap_readiness_report(args.paths) if args.wrap_readiness else None + semantic_payload = _semantic_report(args.paths, preprocessing) if (args.semantics or args.pyi) else None + readiness_payload = _wrap_readiness_report(args.paths, preprocessing) if args.wrap_readiness else None _attach_wrap_readiness(semantic_payload, readiness_payload) except CParseError as exc: if args.debug_traceback or _env_flag("C_PARSER_DEBUG"): diff --git a/x2py/fortran_type_probe.py b/x2py/fortran_type_probe.py new file mode 100644 index 000000000..20ca686a7 --- /dev/null +++ b/x2py/fortran_type_probe.py @@ -0,0 +1,421 @@ +# -*- coding: utf-8 -*- +"""Compiler-derived Fortran kind expression facts. + +Fortran kind values and intrinsics such as ``selected_real_kind`` are +processor/compiler facts. This module evaluates the exact initialization +expressions requested by the semantic layer through the user-selected Fortran +compiler and flags, then returns values suitable for +``FortranToIRConverter(..., compile_time_values=...)``. +""" + +from __future__ import annotations + +import argparse +from collections.abc import Iterable, Mapping, Sequence +from dataclasses import asdict, dataclass +import json +import os +from pathlib import Path +import re +import shlex +import subprocess +import tempfile + +from .preprocessing import PreprocessingConfig, validate_macro_name + + +class FortranTypeProbeError(ValueError): + """Raised when a compiler-derived Fortran type probe cannot run.""" + + +@dataclass(frozen=True) +class FortranTypeProbeRecipe: + """Commands and input flags needed to reproduce one probe result.""" + + compiler: str + compile_argv: list[str] + run_argv: list[str] + expressions: list[str] + requested_standard: str | None = None + include_dirs: list[str] | None = None + defines: list[str] | None = None + undefs: list[str] | None = None + compiler_args: list[str] | None = None + + +@dataclass(frozen=True) +class FortranTypeProbeReport: + """JSON-stable Fortran kind expression values for semantic conversion.""" + + values: dict[str, int] + recipe: FortranTypeProbeRecipe + source_text: str + + def to_dict(self) -> dict[str, object]: + """Return a JSON-compatible report.""" + return asdict(self) + + def to_compile_time_values( + self, + requirements: Iterable[Mapping[str, object]] | None = None, + ) -> dict[str, int]: + """Return values keyed for semantic compile-time substitution. + + Exact expression keys are always included. When semantic requirement + records are supplied, parameter requirements also add ``symbol -> value`` + mappings, so a parameter such as ``rk = selected_real_kind(12)`` resolves + both ``selected_real_kind(12)`` and later uses of ``rk``. + """ + values = dict(self.values) + if requirements is None: + return values + for item in requirements: + expression = str(item.get("expression") or "").strip() + symbol = str(item.get("symbol") or "").strip() + if item.get("code") != "parameter_value" or not expression or not symbol: + continue + value = _value_for_expression(self.values, expression) + if value is not None: + values[symbol] = value + return values + + +_SAFE_EXPRESSION_RE = re.compile(r"^[A-Za-z0-9_+\-*/().,= :]+$") +_TOKEN_RE = re.compile(r"\b[A-Za-z_][A-Za-z0-9_]*\b") + +_ISO_FORTRAN_ENV_NAMES = { + "int8", + "int16", + "int32", + "int64", + "real32", + "real64", + "real128", +} +_ISO_C_BINDING_NAMES = { + "c_bool", + "c_char", + "c_double", + "c_double_complex", + "c_float", + "c_float_complex", + "c_int", + "c_int16_t", + "c_int32_t", + "c_int64_t", + "c_int8_t", + "c_long", + "c_long_double", + "c_long_double_complex", + "c_long_long", + "c_short", + "c_signed_char", + "c_size_t", +} + + +def fortran_type_probe_expressions( + requirements: Iterable[Mapping[str, object]], +) -> list[str]: + """Return unique semantic requirement expressions that need probing.""" + expressions: list[str] = [] + seen: set[str] = set() + for item in requirements: + expression = str(item.get("expression") or "").strip() + if not expression: + continue + key = expression.lower() + if key in seen: + continue + seen.add(key) + expressions.append(expression) + return expressions + + +def build_fortran_type_probe_source(expressions: Sequence[str]) -> str: + """Return free-form Fortran source that evaluates integer expressions.""" + unique_expressions = _normalize_expressions(expressions) + imports = _probe_import_lines(unique_expressions) + declarations = [ + f" integer, parameter :: x2py_value_{index} = {expression}" + for index, expression in enumerate(unique_expressions) + ] + + lines = [ + "program x2py_fortran_type_probe", + *imports, + " implicit none", + *declarations, + " write(*,'(A)', advance='no') '{\"values\":['", + ] + for index, _expression in enumerate(unique_expressions): + if index: + lines.append(" write(*,'(A)', advance='no') ','") + lines.append(f" write(*,'(I0)', advance='no') x2py_value_{index}") + lines.extend( + [ + " write(*,'(A)') ']}'", + "end program x2py_fortran_type_probe", + "", + ] + ) + return "\n".join(lines) + + +def probe_fortran_type_expressions( + config: PreprocessingConfig, + expressions: Sequence[str], + *, + runner: Sequence[str] | None = None, +) -> FortranTypeProbeReport: + """Compile and execute a Fortran expression probe for one compiler target. + + The default runner executes the produced binary directly, which matches the + current native-target assumption. Cross targets can pass an emulator/runner + command; the command is recorded in the result. + """ + if not config.compiler: + raise FortranTypeProbeError( + "Fortran type probing requires an exact compiler executable" + ) + if config.compile_commands: + raise FortranTypeProbeError( + "Fortran type probing does not consume compile_commands directly; " + "pass the selected target/include/compiler flags explicitly" + ) + + unique_expressions = _normalize_expressions(expressions) + source_text = build_fortran_type_probe_source(unique_expressions) + + with tempfile.TemporaryDirectory(prefix="x2py-fortran-type-probe-") as temp_dir: + source_path = Path(temp_dir) / "fortran_type_probe.F90" + executable_path = Path(temp_dir) / ( + "fortran_type_probe.exe" if os.name == "nt" else "fortran_type_probe" + ) + source_path.write_text(source_text, encoding="utf-8") + + compile_argv = [ + config.compiler, + *_probe_compile_flags(config), + str(source_path), + "-o", + str(executable_path), + ] + try: + compiled = subprocess.run( + compile_argv, + capture_output=True, + text=True, + check=False, + ) + except OSError as exc: + raise FortranTypeProbeError( + f"failed to run Fortran type probe compiler {config.compiler!r}: {exc}" + ) from exc + if compiled.returncode != 0: + command = " ".join(shlex.quote(arg) for arg in compile_argv) + detail = f": {compiled.stderr.strip()}" if compiled.stderr.strip() else "" + raise FortranTypeProbeError( + f"Fortran type probe compilation failed with `{command}`{detail}" + ) + + run_argv = [*(runner or ()), str(executable_path)] + try: + completed = subprocess.run( + run_argv, + capture_output=True, + text=True, + check=False, + ) + except OSError as exc: + raise FortranTypeProbeError( + "failed to execute Fortran type probe; provide a compatible " + f"runner for cross-compiled targets: {exc}" + ) from exc + if completed.returncode != 0: + command = " ".join(shlex.quote(arg) for arg in run_argv) + detail = f": {completed.stderr.strip()}" if completed.stderr.strip() else "" + raise FortranTypeProbeError( + f"Fortran type probe execution failed with `{command}`{detail}" + ) + try: + payload = json.loads(completed.stdout) + except json.JSONDecodeError as exc: + raise FortranTypeProbeError( + f"Fortran type probe produced invalid JSON: {exc}" + ) from exc + + raw_values = payload.get("values") + if not isinstance(raw_values, list): + raise FortranTypeProbeError("Fortran type probe output is missing 'values'") + if len(raw_values) != len(unique_expressions): + raise FortranTypeProbeError("Fortran type probe output count does not match input expressions") + + values: dict[str, int] = {} + for expression, value in zip(unique_expressions, raw_values): + if not isinstance(value, int): + raise FortranTypeProbeError( + f"Fortran type probe value for {expression!r} is not an integer" + ) + values[expression] = value + + return FortranTypeProbeReport( + values=values, + recipe=FortranTypeProbeRecipe( + compiler=config.compiler, + compile_argv=compile_argv, + run_argv=run_argv, + expressions=list(unique_expressions), + requested_standard=config.std, + include_dirs=list(config.include_dirs), + defines=list(config.defines), + undefs=list(config.undefs), + compiler_args=list(config.compiler_args), + ), + source_text=source_text, + ) + + +def evaluate_fortran_type_requirements( + config: PreprocessingConfig, + requirements: Iterable[Mapping[str, object]], + *, + runner: Sequence[str] | None = None, +) -> dict[str, int]: + """Evaluate collected semantic requirements into compile-time values.""" + requirement_list = list(requirements) + expressions = fortran_type_probe_expressions(requirement_list) + if not expressions: + return {} + report = probe_fortran_type_expressions( + config, + expressions, + runner=runner, + ) + return report.to_compile_time_values(requirement_list) + + +def _normalize_expressions(expressions: Sequence[str]) -> list[str]: + normalized: list[str] = [] + seen: set[str] = set() + for expression in expressions: + text = str(expression).strip() + if not text: + continue + _validate_expression(text) + key = text.lower() + if key in seen: + continue + seen.add(key) + normalized.append(text) + return normalized + + +def _validate_expression(expression: str) -> None: + if "\n" in expression or "\r" in expression or ";" in expression: + raise FortranTypeProbeError( + f"Fortran type probe expression is not a single initialization expression: {expression!r}" + ) + if _SAFE_EXPRESSION_RE.fullmatch(expression) is None: + raise FortranTypeProbeError( + f"Fortran type probe expression contains unsupported characters: {expression!r}" + ) + + +def _probe_import_lines(expressions: Sequence[str]) -> list[str]: + tokens = { + token.lower() + for expression in expressions + for token in _TOKEN_RE.findall(expression) + } + lines: list[str] = [] + env_names = sorted(tokens & _ISO_FORTRAN_ENV_NAMES) + c_names = sorted(tokens & _ISO_C_BINDING_NAMES) + if env_names: + lines.append(f" use, intrinsic :: iso_fortran_env, only: {', '.join(env_names)}") + if c_names: + lines.append(f" use, intrinsic :: iso_c_binding, only: {', '.join(c_names)}") + return lines + + +def _probe_compile_flags(config: PreprocessingConfig) -> list[str]: + """Carry target-relevant compiler flags into the generated probe.""" + flags = ["-cpp"] + flags.extend(f"-I{path}" for path in config.include_dirs) + flags.extend(f"-D{define}" for define in config.defines) + flags.extend(f"-U{undef}" for undef in config.undefs) + if config.std: + flags.append(f"-std={config.std}") + flags.extend(config.compiler_args) + return flags + + +def _value_for_expression(values: Mapping[str, int], expression: str) -> int | None: + exact = values.get(expression) + if exact is not None: + return exact + target = expression.strip().lower() + for key, value in values.items(): + if key.strip().lower() == target: + return value + return None + + +def main(argv: list[str] | None = None) -> int: + """Run a compiler-derived Fortran type probe and write JSON.""" + parser = argparse.ArgumentParser( + description="Probe Fortran kind/compile-time expressions through an exact compiler." + ) + parser.add_argument("--compiler", required=True, help="Exact native or cross Fortran compiler executable.") + parser.add_argument( + "--expr", + "--expression", + dest="expressions", + action="append", + default=[], + help="Integer initialization expression to evaluate; repeat for multiple expressions.", + ) + parser.add_argument("-I", "--include-dir", dest="include_dirs", action="append", default=[]) + parser.add_argument("-D", "--define", dest="defines", action="append", default=[]) + parser.add_argument("-U", "--undef", dest="undefs", action="append", default=[]) + parser.add_argument("--std", help="Project Fortran standard passed to the probe compiler.") + parser.add_argument("--compiler-arg", dest="compiler_args", action="append", default=[]) + parser.add_argument("--runner", dest="runner", action="append", default=[], help="Runner command item for cross targets; repeat for arguments.") + args = parser.parse_args(argv) + try: + for define in args.defines: + validate_macro_name(define, "--define/-D") + for undef in args.undefs: + validate_macro_name(undef, "--undef/-U") + report = probe_fortran_type_expressions( + PreprocessingConfig( + mode="compiler", + compiler=args.compiler, + include_dirs=args.include_dirs, + defines=args.defines, + undefs=args.undefs, + std=args.std, + compiler_args=args.compiler_args, + ), + args.expressions, + runner=args.runner or None, + ) + except ValueError as exc: + parser.error(str(exc)) + print(json.dumps(report.to_dict(), indent=2)) + return 0 + + +if __name__ == "__main__": # pragma: no cover - exercised through CLI tests. + raise SystemExit(main()) + + +__all__ = ( + "FortranTypeProbeError", + "FortranTypeProbeRecipe", + "FortranTypeProbeReport", + "build_fortran_type_probe_source", + "evaluate_fortran_type_requirements", + "fortran_type_probe_expressions", + "probe_fortran_type_expressions", +) diff --git a/x2py/preprocessing.py b/x2py/preprocessing.py new file mode 100644 index 000000000..2b6120baa --- /dev/null +++ b/x2py/preprocessing.py @@ -0,0 +1,369 @@ +# -*- coding: utf-8 -*- +from __future__ import annotations + +from dataclasses import asdict, dataclass, field +import json +from pathlib import Path +import shlex +import subprocess +from collections.abc import Sequence + + +class PreprocessingError(ValueError): + """Raised when compiler-assisted preprocessing cannot produce source text.""" + + +@dataclass(frozen=True) +class PreprocessingConfig: + """User-selected preprocessing settings shared by language frontends. + + `compiler` is intentionally the exact executable supplied by the user or a + build database. x2py does not guess compiler versions when compiler mode is + requested. + """ + + mode: str = "internal" + compiler: str | None = None + compile_commands: str | None = None + include_dirs: list[str] = field(default_factory=list) + defines: list[str] = field(default_factory=list) + undefs: list[str] = field(default_factory=list) + std: str | None = None + compiler_args: list[str] = field(default_factory=list) + + @property + def uses_compiler(self) -> bool: + """Return whether this configuration asks x2py to run a compiler.""" + return self.mode == "compiler" + + def fortran_macro_defines(self) -> dict[str, int | str]: + """Return macro selections for the Fortran internal preprocessor.""" + macros: dict[str, int | str] = {} + for define in self.defines: + name, value = _split_define(define) + macros[name] = 1 if value is None else value + for name in self.undefs: + macros[name] = 0 + return macros + + def fortran_internal_recipe(self, source_path: str | Path) -> dict[str, object] | None: + """Return JSON provenance when internal Fortran macro selection is active.""" + if not (self.defines or self.undefs): + return None + return PreprocessingRecipe( + mode=self.mode, + language="fortran", + source_path=str(source_path), + include_dirs=list(self.include_dirs), + defines=list(self.defines), + undefs=list(self.undefs), + standard=self.std, + compiler_args=list(self.compiler_args), + ).to_dict() + + +@dataclass(frozen=True) +class PreprocessingRecipe: + """JSON-stable recipe for reproducing parser input preprocessing.""" + + mode: str + language: str + source_path: str + compiler: str | None = None + argv: list[str] = field(default_factory=list) + cwd: str | None = None + include_dirs: list[str] = field(default_factory=list) + defines: list[str] = field(default_factory=list) + undefs: list[str] = field(default_factory=list) + standard: str | None = None + compiler_args: list[str] = field(default_factory=list) + compile_commands: str | None = None + compile_commands_entry: dict[str, object] | None = None + + def to_dict(self) -> dict[str, object]: + """Return JSON-compatible recipe metadata.""" + return asdict(self) + + +@dataclass(frozen=True) +class CompilerInvocation: + """Concrete compiler-preprocessor command and working directory.""" + + argv: list[str] + cwd: str | None = None + compile_commands_entry: dict[str, object] | None = None + + +_COMPILE_ONLY_FLAGS = {"-c", "/c"} +_SKIP_VALUE_FLAGS = {"-o", "/Fo", "-MF", "-MT", "-MQ"} +_SKIP_PREFIX_FLAGS = ("-o", "/Fo") +_SOURCE_SUFFIXES = { + ".c", + ".cc", + ".cpp", + ".cxx", + ".h", + ".hh", + ".hpp", + ".hxx", + ".f", + ".for", + ".ftn", + ".f77", + ".f90", + ".f95", + ".f03", + ".f08", +} + + +def _split_define(define: str) -> tuple[str, str | None]: + """Split a `-D` style value into macro name and optional value.""" + if "=" in define: + name, value = define.split("=", 1) + return name, value + return define, None + + +def validate_macro_name(value: str, option: str) -> None: + """Validate that a macro flag has a non-empty name.""" + name = value.split("=", 1)[0] + if not name: + raise PreprocessingError(f"{option} requires a macro name") + + +def _std_arg(language: str, standard: str | None) -> list[str]: + """Return compiler standard arguments for the active frontend.""" + if not standard: + return [] + return [f"-std={standard}"] + + +def _common_compiler_flags(config: PreprocessingConfig, language: str) -> list[str]: + """Build flags shared by direct and compile-database preprocessing.""" + flags: list[str] = [] + for include_dir in config.include_dirs: + flags.append(f"-I{include_dir}") + for define in config.defines: + flags.append(f"-D{define}") + for undef in config.undefs: + flags.append(f"-U{undef}") + flags.extend(_std_arg(language, config.std)) + flags.extend(config.compiler_args) + return flags + + +def build_direct_preprocess_invocation( + source_path: str | Path, + *, + language: str, + config: PreprocessingConfig, +) -> CompilerInvocation: + """Build a direct compiler-preprocessor invocation for one source path.""" + if not config.compiler: + raise PreprocessingError("--preprocess compiler requires --compiler with an exact executable") + + source = Path(source_path) + argv = [config.compiler, "-E"] + if language == "fortran": + argv.append("-cpp") + elif language == "c": + argv.extend(["-x", "c"]) + else: + raise PreprocessingError(f"compiler preprocessing is not supported for language {language!r}") + argv.extend(_common_compiler_flags(config, language)) + argv.append(str(source)) + return CompilerInvocation(argv=argv) + + +def _compile_command_arguments(entry: dict) -> list[str]: + """Return argv from a compile_commands.json entry.""" + if isinstance(entry.get("arguments"), list): + return [str(arg) for arg in entry["arguments"]] + command = entry.get("command") + if isinstance(command, str): + return shlex.split(command) + raise PreprocessingError("compile_commands entry must contain 'arguments' or 'command'") + + +def _entry_file_path(entry: dict) -> Path: + """Return the absolute source path for a compile database entry.""" + directory = Path(str(entry.get("directory") or ".")) + file_path = Path(str(entry.get("file") or "")) + if not file_path: + raise PreprocessingError("compile_commands entry is missing 'file'") + return file_path if file_path.is_absolute() else directory / file_path + + +def _matches_compile_entry(entry: dict, source_path: Path) -> bool: + """Return whether a compile database entry describes `source_path`.""" + entry_path = _entry_file_path(entry) + try: + return entry_path.resolve() == source_path.resolve() + except OSError: + return entry_path == source_path or entry_path.name == source_path.name + + +def _load_compile_command_entry(compile_commands: str | Path, source_path: str | Path) -> dict: + """Load the compile database entry for one source path.""" + database_path = Path(compile_commands) + source = Path(source_path) + try: + entries = json.loads(database_path.read_text(encoding="utf-8")) + except OSError as exc: + raise PreprocessingError(f"cannot read compile commands file {database_path}: {exc}") from exc + except json.JSONDecodeError as exc: + raise PreprocessingError(f"invalid compile commands JSON {database_path}: {exc}") from exc + if not isinstance(entries, list): + raise PreprocessingError("compile_commands JSON must contain a list of entries") + + matches = [entry for entry in entries if isinstance(entry, dict) and _matches_compile_entry(entry, source)] + if not matches: + raise PreprocessingError(f"no compile_commands entry found for {source}") + if len(matches) > 1: + raise PreprocessingError(f"multiple compile_commands entries found for {source}; pass --compiler explicitly") + return matches[0] + + +def _is_source_arg(arg: str, entry_source: Path) -> bool: + """Return whether an argv item is the compiled source path.""" + path = Path(arg) + if path.suffix.lower() not in _SOURCE_SUFFIXES: + return False + if path == entry_source or path.name == entry_source.name: + return True + try: + return path.resolve() == entry_source.resolve() + except OSError: + return False + + +def _filter_compile_args(args: Sequence[str], entry_source: Path) -> list[str]: + """Remove compile-only/output/source args while preserving API flags.""" + filtered: list[str] = [] + index = 0 + while index < len(args): + arg = args[index] + if arg in _COMPILE_ONLY_FLAGS: + index += 1 + continue + if arg in _SKIP_VALUE_FLAGS: + index += 2 + continue + if any(arg.startswith(prefix) and arg != prefix for prefix in _SKIP_PREFIX_FLAGS): + index += 1 + continue + if _is_source_arg(arg, entry_source): + index += 1 + continue + filtered.append(arg) + index += 1 + return filtered + + +def build_compile_commands_invocation( + source_path: str | Path, + *, + config: PreprocessingConfig, +) -> CompilerInvocation: + """Build a C preprocessing command from `compile_commands.json`.""" + if not config.compile_commands: + raise PreprocessingError("compile command database path is missing") + entry = _load_compile_command_entry(config.compile_commands, source_path) + argv = _compile_command_arguments(entry) + if not argv: + raise PreprocessingError("compile_commands entry has an empty command") + + directory = str(entry.get("directory") or ".") + entry_source = _entry_file_path(entry) + compiler = config.compiler or argv[0] + filtered_args = _filter_compile_args(argv[1:], entry_source) + command = [compiler, "-E", *_common_compiler_flags(config, "c"), *filtered_args, str(entry_source)] + return CompilerInvocation(argv=command, cwd=directory, compile_commands_entry=entry) + + +def build_preprocess_invocation( + source_path: str | Path, + *, + language: str, + config: PreprocessingConfig, +) -> CompilerInvocation: + """Build the compiler-preprocessor invocation for one source path.""" + if config.compile_commands: + if language != "c": + raise PreprocessingError("--compile-commands is only supported for --language c") + return build_compile_commands_invocation(source_path, config=config) + return build_direct_preprocess_invocation(source_path, language=language, config=config) + + +def run_compiler_preprocessor_with_recipe( + source_path: str | Path, + *, + language: str, + config: PreprocessingConfig, +) -> tuple[str, PreprocessingRecipe]: + """Run compiler preprocessing and return source text plus its exact recipe.""" + invocation = build_preprocess_invocation(source_path, language=language, config=config) + try: + completed = subprocess.run( + invocation.argv, + cwd=invocation.cwd, + capture_output=True, + text=True, + check=False, + ) + except OSError as exc: + raise PreprocessingError( + f"failed to run compiler preprocessor {invocation.argv[0]!r}: {exc}" + ) from exc + + if completed.returncode != 0: + command = " ".join(shlex.quote(arg) for arg in invocation.argv) + stderr = completed.stderr.strip() + detail = f": {stderr}" if stderr else "" + raise PreprocessingError(f"compiler preprocessing failed for {source_path} with `{command}`{detail}") + recipe = PreprocessingRecipe( + mode=config.mode, + language=language, + source_path=str(source_path), + compiler=invocation.argv[0], + argv=list(invocation.argv), + cwd=invocation.cwd, + include_dirs=list(config.include_dirs), + defines=list(config.defines), + undefs=list(config.undefs), + standard=config.std, + compiler_args=list(config.compiler_args), + compile_commands=config.compile_commands, + compile_commands_entry=invocation.compile_commands_entry, + ) + return completed.stdout, recipe + + +def run_compiler_preprocessor( + source_path: str | Path, + *, + language: str, + config: PreprocessingConfig, +) -> str: + """Run the configured compiler preprocessor and return stdout source text.""" + source, _recipe = run_compiler_preprocessor_with_recipe( + source_path, + language=language, + config=config, + ) + return source + + +__all__ = ( + "CompilerInvocation", + "PreprocessingConfig", + "PreprocessingError", + "PreprocessingRecipe", + "build_compile_commands_invocation", + "build_direct_preprocess_invocation", + "build_preprocess_invocation", + "run_compiler_preprocessor", + "run_compiler_preprocessor_with_recipe", + "validate_macro_name", +)