[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] libpoke: rename pkl_ast_type_promoteable to pkl_ast_type_promote
From: |
Jose E. Marchesi |
Subject: |
[PATCH] libpoke: rename pkl_ast_type_promoteable to pkl_ast_type_promoteable_p |
Date: |
Sun, 08 Nov 2020 20:56:44 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h: Rename pkl_ast_type_promoteable to
pkl_ast_type_promoteable_p.
* libpoke/pkl-ast.c: Likewise.
* libpoke/pkl-typify.c: Likewise.
---
ChangeLog | 7 +++++++
libpoke/pkl-ast.c | 10 +++++-----
libpoke/pkl-ast.h | 4 ++--
libpoke/pkl-typify.c | 42 +++++++++++++++++++++---------------------
4 files changed, 35 insertions(+), 28 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6c8424a3..184d945b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
+
+ * libpoke/pkl-ast.h: Rename pkl_ast_type_promoteable to
+ pkl_ast_type_promoteable_p.
+ * libpoke/pkl-ast.c: Likewise.
+ * libpoke/pkl-typify.c: Likewise.
+
2020-11-08 Jose E. Marchesi <jemarch@gnu.org>
* libpoke/pkl-ast.h: Rename pkl_ast_type_equal to
diff --git a/libpoke/pkl-ast.c b/libpoke/pkl-ast.c
index 109fafa2..099a0e23 100644
--- a/libpoke/pkl-ast.c
+++ b/libpoke/pkl-ast.c
@@ -852,8 +852,8 @@ pkl_ast_type_equal_p (pkl_ast_node a, pkl_ast_node b)
generally commutative. */
int
-pkl_ast_type_promoteable (pkl_ast_node ft, pkl_ast_node tt,
- int promote_array_of_any)
+pkl_ast_type_promoteable_p (pkl_ast_node ft, pkl_ast_node tt,
+ int promote_array_of_any)
{
if (pkl_ast_type_equal_p (ft, tt))
return 1;
@@ -904,9 +904,9 @@ pkl_ast_type_promoteable (pkl_ast_node ft, pkl_ast_node tt,
}
return 1;
- // return pkl_ast_type_promoteable (PKL_AST_TYPE_A_ETYPE (ft),
- // PKL_AST_TYPE_A_ETYPE (tt),
- // promote_array_of_any);
+ // return pkl_ast_type_promoteable_p (PKL_AST_TYPE_A_ETYPE (ft),
+ // PKL_AST_TYPE_A_ETYPE (tt),
+ // promote_array_of_any);
}
/* A struct type is promoteable to any integral type if the struct
diff --git a/libpoke/pkl-ast.h b/libpoke/pkl-ast.h
index 01a380fd..87268385 100644
--- a/libpoke/pkl-ast.h
+++ b/libpoke/pkl-ast.h
@@ -986,8 +986,8 @@ int pkl_ast_type_mappable_p (pkl_ast_node type);
int pkl_ast_type_is_exception (pkl_ast_node type);
-int pkl_ast_type_promoteable (pkl_ast_node ft, pkl_ast_node tt,
- int promote_array_of_any);
+int pkl_ast_type_promoteable_p (pkl_ast_node ft, pkl_ast_node tt,
+ int promote_array_of_any);
pkl_ast_node pkl_ast_sizeof_type (pkl_ast ast, pkl_ast_node type);
diff --git a/libpoke/pkl-typify.c b/libpoke/pkl-typify.c
index d6795788..072116f1 100644
--- a/libpoke/pkl-typify.c
+++ b/libpoke/pkl-typify.c
@@ -969,9 +969,9 @@ expected array");
PKL_PASS_ERROR;
}
- if (!pkl_ast_type_promoteable (t1,
- PKL_AST_TYPE_A_ETYPE (t2),
- 0 /* promote_array_of_any */))
+ if (!pkl_ast_type_promoteable_p (t1,
+ PKL_AST_TYPE_A_ETYPE (t2),
+ 0 /* promote_array_of_any */))
{
char *t1_str = pkl_type_str (t1, 1);
char *t2_str = pkl_type_str (t2, 1);
@@ -1586,8 +1586,8 @@ with prototype %s",
pkl_ast_node aa_type = PKL_AST_TYPE (aa_exp);
if (!PKL_AST_FUNC_TYPE_ARG_VARARG (fa)
- && !pkl_ast_type_promoteable (aa_type, fa_type,
- 1 /* promote_array_of_any */))
+ && !pkl_ast_type_promoteable_p (aa_type, fa_type,
+ 1 /* promote_array_of_any */))
{
char *passed_type = pkl_type_str (aa_type, 1);
char *expected_type = pkl_type_str (fa_type, 1);
@@ -1964,8 +1964,8 @@ PKL_PHASE_BEGIN_HANDLER (pkl_typify1_ps_scons)
found = 1;
- if (!pkl_ast_type_promoteable (elem_type, type_elem_type,
- 0 /* promote array of any */))
+ if (!pkl_ast_type_promoteable_p (elem_type, type_elem_type,
+ 0 /* promote array of any
*/))
{
char *expected_type = pkl_type_str (type_elem_type, 1);
char *found_type = pkl_type_str (elem_type, 1);
@@ -2481,8 +2481,8 @@ PKL_PHASE_BEGIN_HANDLER (pkl_typify1_ps_struct_type_field)
pkl_ast_node constraint_type
= PKL_AST_TYPE (elem_constraint);
- if (!pkl_ast_type_promoteable (constraint_type, bool_type,
- 1 /* promote_array_of_any */))
+ if (!pkl_ast_type_promoteable_p (constraint_type, bool_type,
+ 1 /* promote_array_of_any */))
{
PKL_ERROR (PKL_AST_LOC (elem_constraint),
"struct field constraint should evaluate to a boolean");
@@ -2501,8 +2501,8 @@ PKL_PHASE_BEGIN_HANDLER (pkl_typify1_ps_struct_type_field)
pkl_ast_node optcond_type
= PKL_AST_TYPE (elem_optcond);
- if (!pkl_ast_type_promoteable (optcond_type, bool_type,
- 1 /* promote_array_of_any */))
+ if (!pkl_ast_type_promoteable_p (optcond_type, bool_type,
+ 1 /* promote_array_of_any */))
{
PKL_ERROR (PKL_AST_LOC (elem_optcond),
"expected boolean expression");
@@ -2522,8 +2522,8 @@ PKL_PHASE_BEGIN_HANDLER (pkl_typify1_ps_struct_type_field)
pkl_ast_node initializer_type
= PKL_AST_TYPE (elem_initializer);
- if (!pkl_ast_type_promoteable (initializer_type, field_type,
- 0 /* promote_array_of_any */))
+ if (!pkl_ast_type_promoteable_p (initializer_type, field_type,
+ 0 /* promote_array_of_any */))
{
char *field_type_str = pkl_type_str (field_type, 1);
char *initializer_type_str = pkl_type_str (initializer_type, 1);
@@ -2551,8 +2551,8 @@ expected %s, got %s",
pkl_ast_make_integer (PKL_PASS_AST, 1));
- if (!pkl_ast_type_promoteable (label_type, offset_type,
- 1 /* promote_array_of_any */))
+ if (!pkl_ast_type_promoteable_p (label_type, offset_type,
+ 1 /* promote_array_of_any */))
{
PKL_ERROR (PKL_AST_LOC (elem_label),
"struct field label should evaluate to an offset");
@@ -2584,8 +2584,8 @@ PKL_PHASE_BEGIN_HANDLER (pkl_typify1_ps_return_stmt)
expected_type = PKL_AST_FUNC_RET_TYPE (function);
if (PKL_AST_TYPE_CODE (expected_type) != PKL_TYPE_VOID
- && !pkl_ast_type_promoteable (returned_type, expected_type,
- 1 /* promote_array_of_any */))
+ && !pkl_ast_type_promoteable_p (returned_type, expected_type,
+ 1 /* promote_array_of_any */))
{
char *returned_type_str = pkl_type_str (returned_type, 1);
char *expected_type_str = pkl_type_str (expected_type, 1);
@@ -2616,8 +2616,8 @@ PKL_PHASE_BEGIN_HANDLER (pkl_typify1_ps_func_arg)
pkl_ast_node arg_type = PKL_AST_FUNC_ARG_TYPE (func_arg);
pkl_ast_node initial_type = PKL_AST_TYPE (initial);
- if (!pkl_ast_type_promoteable (initial_type, arg_type,
- 1 /* promote_aray_of_any */))
+ if (!pkl_ast_type_promoteable_p (initial_type, arg_type,
+ 1 /* promote_aray_of_any */))
{
char *arg_type_str = pkl_type_str (arg_type, 1);
char *initial_type_str = pkl_type_str (initial_type, 1);
@@ -2734,8 +2734,8 @@ PKL_PHASE_BEGIN_HANDLER (pkl_typify1_ps_ass_stmt)
pkl_ast_node lvalue_type = PKL_AST_TYPE (lvalue);
pkl_ast_node exp_type = PKL_AST_TYPE (exp);
- if (!pkl_ast_type_promoteable (exp_type, lvalue_type,
- 1 /* promote_array_of_any */))
+ if (!pkl_ast_type_promoteable_p (exp_type, lvalue_type,
+ 1 /* promote_array_of_any */))
{
char *expected_type = pkl_type_str (lvalue_type, 1);
char *found_type = pkl_type_str (exp_type, 1);
--
2.25.0.2.g232378479e
- [PATCH] libpoke: rename pkl_ast_type_promoteable to pkl_ast_type_promoteable_p,
Jose E. Marchesi <=