From f324385510b77a8168a2af1e7a89d4410fa08bea Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Mon, 9 Sep 2024 16:01:41 +0200 Subject: [PATCH 1/2] in `ErrorMayQuit` calls, replace `%i` by `%d` the old syntax caused crashes (with GAP 4.12) and `%format error`s (with GAP 4.13) --- src/bitstring.c | 2 +- src/meataxe64.c | 4 ++-- src/meataxe64.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bitstring.c b/src/bitstring.c index a64f548..e36df1a 100644 --- a/src/bitstring.c +++ b/src/bitstring.c @@ -164,7 +164,7 @@ static Obj FuncMTX64_RowSelectShifted(Obj self, Obj bitstring, Obj m, UInt nor = HeaderOfMatrix(m)->nor; UInt noc = HeaderOfMatrix(m)->noc; if (nor != ishift + DataOfBitStringObject(bitstring)[0]) - ErrorMayQuit("mismatched matrix length: matrix %i, bitstring + shift %i", + ErrorMayQuit("mismatched matrix length: matrix %d, bitstring + shift %d", nor, ishift + DataOfBitStringObject(bitstring)[0]); UInt nos = DataOfBitStringObject(bitstring)[1]; Obj fld = FieldOfMatrix(m); diff --git a/src/meataxe64.c b/src/meataxe64.c index 1c0dbb8..84f14fc 100644 --- a/src/meataxe64.c +++ b/src/meataxe64.c @@ -509,11 +509,11 @@ static Obj FuncMTX64_ELMS_LIST(Obj self, Obj m, Obj rows) { for (UInt i = 1; i <= nor2; i++) { Obj ix = ELM_LIST(rows, i); if (!IS_INTOBJ(ix)) - ErrorMayQuit("MTX64_ELMS_LIST: row index %i must be a small integer," + ErrorMayQuit("MTX64_ELMS_LIST: row index %d must be a small integer," " not a %s", i, (Int)TNAM_OBJ(ix)); Int ixi = INT_INTOBJ(ix); if (0 >= ixi || nor < ixi) - ErrorMayQuit("MTX64_ELMS_LIST: row index %i out of range", + ErrorMayQuit("MTX64_ELMS_LIST: row index %d out of range", i, 0); Dfmt *d1 = DPAdv(&ds, ixi-1, d); DCpy(&ds, d1, 1, d2); diff --git a/src/meataxe64.h b/src/meataxe64.h index 67d5d60..2a428db 100644 --- a/src/meataxe64.h +++ b/src/meataxe64.h @@ -172,7 +172,7 @@ static inline void CHECK_MTX64_RowCount(Obj row, Obj m) { static inline void CHECK_MTX64_RowRange(Obj startrow, Obj nrows, Obj m) { CHECK_NONNEG_SMALLINTS(startrow, nrows); if (INT_INTOBJ(startrow) + INT_INTOBJ(nrows) > HeaderOfMatrix(m)->nor) - ErrorMayQuit("Meataxe64: row range too large for matrix: %i %i", + ErrorMayQuit("Meataxe64: row range too large for matrix: %d %d", INT_INTOBJ(startrow) + INT_INTOBJ(nrows), HeaderOfMatrix(m)->nor); } @@ -185,14 +185,14 @@ static inline void CHECK_SUBFIELD(Obj bigfield, Obj smallfield) { UInt qb = DataOfFieldObject(bigfield)->fdef; UInt qs = DataOfFieldObject(smallfield)->fdef; if (qb % qs != 0) { - ErrorMayQuit("Meataxe64: incompatiable field sizes %i %i",qb,qs); + ErrorMayQuit("Meataxe64: incompatiable field sizes %d %d",qb,qs); } UInt x = qs; while (x < qb) { x *= qs; } if (x > qb) { - ErrorMayQuit("Meataxe64: incompatible field sizes %i %i",qb,qs); + ErrorMayQuit("Meataxe64: incompatible field sizes %d %d",qb,qs); } } From d785ccc17a9c6d99df4bb851678b766a7a35ef07 Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Tue, 10 Sep 2024 09:30:31 +0200 Subject: [PATCH 2/2] fix a typo --- src/meataxe64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meataxe64.h b/src/meataxe64.h index 2a428db..363dbeb 100644 --- a/src/meataxe64.h +++ b/src/meataxe64.h @@ -185,7 +185,7 @@ static inline void CHECK_SUBFIELD(Obj bigfield, Obj smallfield) { UInt qb = DataOfFieldObject(bigfield)->fdef; UInt qs = DataOfFieldObject(smallfield)->fdef; if (qb % qs != 0) { - ErrorMayQuit("Meataxe64: incompatiable field sizes %d %d",qb,qs); + ErrorMayQuit("Meataxe64: incompatible field sizes %d %d",qb,qs); } UInt x = qs; while (x < qb) {