Fix matrix1 and countnegative return values

This commit is contained in:
2026-09-19 11:47:32 +02:00
parent f11b025b77
commit 7438769fed
2 changed files with 6 additions and 5 deletions
@@ -81,11 +81,12 @@ countnegative_initialize(matrix Array) {
register int OuterIndex, InnerIndex;
__pragma_loopbound(20, 20);
for (OuterIndex = 0; OuterIndex < MAXSIZE; OuterIndex++)
for (OuterIndex = 0; OuterIndex < MAXSIZE; OuterIndex++) {
__pragma_loopbound(20, 20);
for (InnerIndex = 0; InnerIndex < MAXSIZE; InnerIndex++)
Array[OuterIndex][InnerIndex] = countnegative_randomInteger();
}
}
void
countnegative_init(void) {
@@ -98,7 +99,7 @@ countnegative_return(void) {
int checksum = (countnegative_postotal + countnegative_poscnt +
countnegative_negtotal + countnegative_negcnt);
return ((checksum == (int) 0x1778de) ? 0 : -1);
return ((checksum == (int) 0x3edcf) ? 0 : -1);
}
void
@@ -126,7 +126,7 @@ matrix1_return(void) {
for (i = 0; i < X * Z; i++)
checksum += matrix1_C[i];
return (checksum == 1000 ? 0 : -1);
return (checksum == 125 ? 0 : -1);
}
/*