From 6100dbc3d05a4e271879c42c011a805dc593be99 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 23 Jun 2025 18:38:33 -0400 Subject: [PATCH] compiler: Generate files with newline at end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These generator scripts use the `write` function that, unlike `print`, doesn't print a trailing newline. So let's add one to the template. Reviewed-by: Faith Ekstrand Reviewed-by: Marek Olšák Part-of: --- src/compiler/builtin_types_h.py | 3 ++- src/compiler/nir/nir_intrinsics_h.py | 3 ++- src/compiler/nir/nir_intrinsics_indices_h.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/compiler/builtin_types_h.py b/src/compiler/builtin_types_h.py index afffff84a15..bc95283b84b 100644 --- a/src/compiler/builtin_types_h.py +++ b/src/compiler/builtin_types_h.py @@ -21,7 +21,8 @@ template = """\ extern const struct glsl_type glsl_type_builtin_${t["name"]}; %endfor -#endif /* _BUILTIN_TYPES_ */""" +#endif /* _BUILTIN_TYPES_ */ +""" if len(sys.argv) < 2: print('Missing output argument', file=sys.stderr) diff --git a/src/compiler/nir/nir_intrinsics_h.py b/src/compiler/nir/nir_intrinsics_h.py index 1a2350b9abd..64e7425941a 100644 --- a/src/compiler/nir/nir_intrinsics_h.py +++ b/src/compiler/nir/nir_intrinsics_h.py @@ -45,7 +45,8 @@ typedef enum { extern const char *nir_intrinsic_index_names[NIR_INTRINSIC_NUM_INDEX_FLAGS]; -#endif /* _NIR_INTRINSICS_ */""" +#endif /* _NIR_INTRINSICS_ */ +""" from nir_intrinsics import INTR_OPCODES, INTR_INDICES from mako.template import Template diff --git a/src/compiler/nir/nir_intrinsics_indices_h.py b/src/compiler/nir/nir_intrinsics_indices_h.py index 9d5dbb30025..9f20814b1b7 100644 --- a/src/compiler/nir/nir_intrinsics_indices_h.py +++ b/src/compiler/nir/nir_intrinsics_indices_h.py @@ -69,7 +69,8 @@ nir_intrinsic_has_${name}(const nir_intrinsic_instr *instr) } % endfor -#endif /* _NIR_INTRINSICS_INDICES_ */""" +#endif /* _NIR_INTRINSICS_INDICES_ */ +""" from nir_intrinsics import INTR_INDICES from mako.template import Template