From 751c9707143e309e18237cfe0e6504f87bcd932e Mon Sep 17 00:00:00 2001 From: Thomas Breuer Date: Tue, 17 Sep 2024 09:41:00 +0200 Subject: [PATCH] in `ErrorMayQuit` calls, replace `%i` by `%d` (#48) 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..363dbeb 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: incompatible 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); } }