diff options
author | Kevin Newton <[email protected]> | 2023-10-26 22:04:54 -0400 |
---|---|---|
committer | git <[email protected]> | 2023-10-27 14:23:17 +0000 |
commit | 26a05c42173f0f6ad188a28c3ea508b18b376d6b (patch) | |
tree | bc3d301cf6eb5954cec8b7d1c6189ce2a84cf653 /prism/templates/src | |
parent | 15ee9c7c1b693f29b6b2dbe7b47488bf154e481c (diff) |
[ruby/prism] Use printf attribute and then fix warnings
https://github.com/ruby/prism/commit/3193902c43
Diffstat (limited to 'prism/templates/src')
-rw-r--r-- | prism/templates/src/prettyprint.c.erb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prism/templates/src/prettyprint.c.erb b/prism/templates/src/prettyprint.c.erb index ecd2c227df..2309a86f1f 100644 --- a/prism/templates/src/prettyprint.c.erb +++ b/prism/templates/src/prettyprint.c.erb @@ -39,7 +39,7 @@ static inline void prettyprint_location(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm_location_t *location) { pm_line_column_t start = pm_newline_list_line_column(&parser->newline_list, location->start); pm_line_column_t end = pm_newline_list_line_column(&parser->newline_list, location->end); - pm_buffer_append_format(output_buffer, "(%d,%d)-(%d,%d)", start.line + 1, start.column, end.line + 1, end.column); + pm_buffer_append_format(output_buffer, "(%lu,%lu)-(%lu,%lu)", (unsigned long) (start.line + 1), (unsigned long) start.column, (unsigned long) (end.line + 1), (unsigned long) end.column); } static inline void @@ -95,7 +95,7 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm prettyprint_source(output_buffer, pm_string_source(&cast-><%= field.name %>), pm_string_length(&cast-><%= field.name %>)); pm_buffer_append_string(output_buffer, "\"\n", 2); <%- when Prism::NodeListField -%> - pm_buffer_append_format(output_buffer, " (length: %d)\n", cast-><%= field.name %>.size); + pm_buffer_append_format(output_buffer, " (length: %lu)\n", (unsigned long) (cast-><%= field.name %>.size)); size_t last_index = cast-><%= field.name %>.size; for (uint32_t index = 0; index < last_index; index++) { |