[PATCH 1/7] pip.c: move_parameters: fix harmless typo

2 views
Skip to first unread message

skim...@kotnet.org

unread,
Sep 24, 2021, 5:33:45 PMSep 24
to isl-dev...@googlegroups.com, Michael Kruse
From: Sven Verdoolaege <sven.ver...@gmail.com>

The code was meant to use a logical or, but was using a bitwise or.

Reported-by: Michael Kruse <Michae...@meinersbur.de>
Signed-off-by: Sven Verdoolaege <sven.ver...@gmail.com>
---
pip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pip.c b/pip.c
index 9e6c1ec011..4d0da4d11f 100644
--- a/pip.c
+++ b/pip.c
@@ -112,7 +112,7 @@ static __isl_give isl_basic_set *move_parameters(__isl_take isl_basic_set *bset,

nparam = isl_basic_set_dim(context, isl_dim_param);
nparam_bset = isl_basic_set_dim(bset, isl_dim_param);
- if (nparam < 0 | nparam_bset < 0)
+ if (nparam < 0 || nparam_bset < 0)
return isl_basic_set_free(bset);
if (nparam == nparam_bset)
return bset;
--
2.25.1

skim...@kotnet.org

unread,
Sep 24, 2021, 5:33:45 PMSep 24
to isl-dev...@googlegroups.com, Michael Kruse
From: Sven Verdoolaege <sven.ver...@gmail.com>

Additionally, plug in the assigned value where it could have been used.

Reported-by: Michael Kruse <Michae...@meinersbur.de>
Signed-off-by: Sven Verdoolaege <sven.ver...@gmail.com>
---
isl_aff.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/isl_aff.c b/isl_aff.c
index 75a10ba255..6137ce5ac5 100644
--- a/isl_aff.c
+++ b/isl_aff.c
@@ -2590,12 +2590,10 @@ isl_bool isl_aff_involves_locals(__isl_keep isl_aff *aff)
__isl_give isl_aff *isl_aff_drop_dims(__isl_take isl_aff *aff,
enum isl_dim_type type, unsigned first, unsigned n)
{
- isl_ctx *ctx;
-
if (!aff)
return NULL;
if (type == isl_dim_out)
- isl_die(aff->v->ctx, isl_error_invalid,
+ isl_die(isl_aff_get_ctx(aff), isl_error_invalid,
"cannot drop output/set dimension",
return isl_aff_free(aff));
if (type == isl_dim_in)
@@ -2603,7 +2601,6 @@ __isl_give isl_aff *isl_aff_drop_dims(__isl_take isl_aff *aff,
if (n == 0 && !isl_local_space_is_named_or_nested(aff->ls, type))
return aff;

- ctx = isl_aff_get_ctx(aff);
if (isl_local_space_check_range(aff->ls, type, first, n) < 0)
return isl_aff_free(aff);

--
2.25.1

skim...@kotnet.org

unread,
Sep 24, 2021, 5:33:46 PMSep 24
to isl-dev...@googlegroups.com, Michael Kruse
From: Sven Verdoolaege <sven.ver...@gmail.com>

Additionally, plug in the assigned value where it could have been used.

Reported-by: Michael Kruse <Michae...@meinersbur.de>
Signed-off-by: Sven Verdoolaege <sven.ver...@gmail.com>
---
isl_aff.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/isl_aff.c b/isl_aff.c
index 6137ce5ac5..3a1091e188 100644
--- a/isl_aff.c
+++ b/isl_aff.c
@@ -2666,12 +2666,10 @@ __isl_give isl_aff *isl_aff_from_range(__isl_take isl_aff *aff)
__isl_give isl_aff *isl_aff_insert_dims(__isl_take isl_aff *aff,
enum isl_dim_type type, unsigned first, unsigned n)
{
- isl_ctx *ctx;
-
if (!aff)
return NULL;
if (type == isl_dim_out)
- isl_die(aff->v->ctx, isl_error_invalid,
+ isl_die(isl_aff_get_ctx(aff), isl_error_invalid,
"cannot insert output/set dimensions",
return isl_aff_free(aff));
if (type == isl_dim_in)
@@ -2679,7 +2677,6 @@ __isl_give isl_aff *isl_aff_insert_dims(__isl_take isl_aff *aff,
if (n == 0 && !isl_local_space_is_named_or_nested(aff->ls, type))
return aff;

- ctx = isl_aff_get_ctx(aff);
if (isl_local_space_check_range(aff->ls, type, first, 0) < 0)
return isl_aff_free(aff);

--
2.25.1

skim...@kotnet.org

unread,
Sep 24, 2021, 5:33:48 PMSep 24
to isl-dev...@googlegroups.com, Michael Kruse
From: Sven Verdoolaege <sven.ver...@gmail.com>

Reported-by: Michael Kruse <Michae...@meinersbur.de>
Signed-off-by: Sven Verdoolaege <sven.ver...@gmail.com>
---
isl_sample.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/isl_sample.c b/isl_sample.c
index c6036a8448..2e26190bf2 100644
--- a/isl_sample.c
+++ b/isl_sample.c
@@ -1153,12 +1153,10 @@ error:
static __isl_give isl_vec *basic_set_sample(__isl_take isl_basic_set *bset,
int bounded)
{
- struct isl_ctx *ctx;
isl_size dim;
if (!bset)
return NULL;

- ctx = bset->ctx;
if (isl_basic_set_plain_is_empty(bset))
return empty_sample(bset);

--
2.25.1

skim...@kotnet.org

unread,
Sep 24, 2021, 5:33:49 PMSep 24
to isl-dev...@googlegroups.com, Michael Kruse
From: Sven Verdoolaege <sven.ver...@gmail.com>

Reported-by: Michael Kruse <Michae...@meinersbur.de>
Signed-off-by: Sven Verdoolaege <sven.ver...@gmail.com>
---
isl_stride.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/isl_stride.c b/isl_stride.c
index 2d1c027062..df5cacc342 100644
--- a/isl_stride.c
+++ b/isl_stride.c
@@ -143,13 +143,9 @@ struct isl_detect_stride_data {
static isl_stat set_stride(struct isl_detect_stride_data *data,
__isl_take isl_val *stride, __isl_take isl_aff *offset)
{
- int pos;
-
if (!stride || !offset)
goto error;

- pos = data->pos;
-
if (data->found) {
isl_val *stride2, *a, *b, *g;
isl_aff *offset2;
--
2.25.1

skim...@kotnet.org

unread,
Sep 24, 2021, 5:33:50 PMSep 24
to isl-dev...@googlegroups.com, Michael Kruse
From: Sven Verdoolaege <sven.ver...@gmail.com>

strtol is only used here for its effect on its endptr argument.

Reported-by: Michael Kruse <Michae...@meinersbur.de>
Signed-off-by: Sven Verdoolaege <sven.ver...@gmail.com>
---
isl_space.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/isl_space.c b/isl_space.c
index fd67a89c65..e2e788affd 100644
--- a/isl_space.c
+++ b/isl_space.c
@@ -476,9 +476,8 @@ __isl_null isl_space *isl_space_free(__isl_take isl_space *space)
static int name_ok(isl_ctx *ctx, const char *s)
{
char *p;
- long dummy;

- dummy = strtol(s, &p, 0);
+ strtol(s, &p, 0);
if (p != s)
isl_die(ctx, isl_error_invalid, "name looks like a number",
return 0);
--
2.25.1

skim...@kotnet.org

unread,
Sep 24, 2021, 5:33:51 PMSep 24
to isl-dev...@googlegroups.com
From: Sven Verdoolaege <sven.ver...@gmail.com>

This improves readability.

Signed-off-by: Sven Verdoolaege <sven.ver...@gmail.com>
---
basis_reduction_templ.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/basis_reduction_templ.c b/basis_reduction_templ.c
index 5c03eab18f..290da7dc29 100644
--- a/basis_reduction_templ.c
+++ b/basis_reduction_templ.c
@@ -155,8 +155,7 @@ struct isl_tab *isl_tab_compute_reduced_basis(struct isl_tab *tab)
GBR_lp_get_obj_val(lp, &F_new);
fixed = GBR_lp_is_fixed(lp);
GBR_set_ui(alpha, 0);
- } else
- if (use_saved) {
+ } else if (use_saved) {
row = GBR_lp_next_row(lp);
GBR_set(F_new, F_saved);
fixed = fixed_saved;
--
2.25.1

Reply all
Reply to author
Forward
0 new messages