summaryrefslogtreecommitdiffstats
path: root/efi_memtest
diff options
context:
space:
mode:
authorRegia König2022-03-11 16:18:19 +0100
committerRegia König2022-03-11 16:18:19 +0100
commiteb349f62cb4154143b24bb98ea3ac93a42164197 (patch)
tree5c70d7da581c785a4db1e504a22efd0888a4bc06 /efi_memtest
parentAdd a bunch of flags for debugging (Warning flags) (diff)
downloadmemtest86-eb349f62cb4154143b24bb98ea3ac93a42164197.tar.gz
memtest86-eb349f62cb4154143b24bb98ea3ac93a42164197.tar.xz
memtest86-eb349f62cb4154143b24bb98ea3ac93a42164197.zip
Fix ulong to int conversion warning
Diffstat (limited to 'efi_memtest')
-rw-r--r--efi_memtest/Makefile3
-rw-r--r--efi_memtest/memtest86+/config.c56
-rw-r--r--efi_memtest/memtest86+/efi/lib.c4
3 files changed, 37 insertions, 26 deletions
diff --git a/efi_memtest/Makefile b/efi_memtest/Makefile
index ed061bd..2b010f3 100644
--- a/efi_memtest/Makefile
+++ b/efi_memtest/Makefile
@@ -13,7 +13,8 @@ CFLAGS += -Wformat=2 -Wformat-truncation -Wformat-overflow
CFLAGS += -Wundef # for undefined macros
#CFLAGS += -Wno-array-bounds
CFLAGS += -Wconversion
-CFLAGS += -Wpadded
+CFLAGS += -Wpadded -Wno-error=padded
+CFLAGS += -Wno-error=unused-parameter
CFLAGS += -fno-builtin
diff --git a/efi_memtest/memtest86+/config.c b/efi_memtest/memtest86+/config.c
index cade5e1..2c218aa 100644
--- a/efi_memtest/memtest86+/config.c
+++ b/efi_memtest/memtest86+/config.c
@@ -36,10 +36,10 @@ char save2[2][POP2_H][POP2_W];
void get_config()
{
- int flag = 0, sflag = 0, i, j, k, n, m, prt = 0;
+ int flag = 0, sflag = 0, i, j, k, m, prt = 0;
int reprint_screen = 0;
char cp[64];
- ulong page;
+ ulong page, n;
popup();
wait_keyup();
@@ -98,8 +98,7 @@ void get_config()
cprint(POP_Y+4, POP_X+5,
"Test Number [1-11]: ");
n = getval(POP_Y+4, POP_X+24, 0) - 1;
- if (n <= 11)
- {
+ if (n <= 11) {
/* Deselect all tests */
i = 0;
while (tseq[i].cpu_sel) {
@@ -109,20 +108,22 @@ void get_config()
/* Now set the selection */
tseq[n].sel = 1;
vv->pass = -1;
- test = n;
+ test = (int) n;
find_ticks_for_pass();
sflag++;
- bail++;
- }
+ bail++;
+ }
break;
case 5:
+
/* Enter a test list */
popclear();
- cprint(POP_Y+1, POP_X+3,
- "Enter a comma separated list");
- cprint(POP_Y+2, POP_X+3,
- "of tests to execute:");
+ cprint(POP_Y+1, POP_X+3, "Enter a comma separated list");
+ cprint(POP_Y+2, POP_X+3, "of tests to execute:");
cprint(POP_Y+5, POP_X+5, "List: ");
+
+ int test_selection = 0;
+
/* Deselect all tests */
k = 0;
while (tseq[k].cpu_sel) {
@@ -139,18 +140,22 @@ void get_config()
i = j = m = 0;
while (1) {
if (mt86_isdigit(cp[i])) {
- n = cp[i]-'0';
- j = j*10 + n;
- i++;
- if (cp[i] == ',' || cp[i] == 0){
- if (j < k) {
- tseq[j].sel = 1;
- m++;
- }
- if (cp[i] == 0) break;
- j = 0;
- i++;
- }
+ test_selection = cp[i]-'0';
+ j = j*10 + test_selection;
+ i++;
+
+ if (cp[i] == ',' || cp[i] == 0){
+ if (j < k) {
+ tseq[j].sel = 1;
+ m++;
+ }
+
+ if (cp[i] == 0) break;
+
+ j = 0;
+ i++;
+
+ }
}
}
@@ -163,11 +168,12 @@ void get_config()
k++;
}
}
+
vv->pass = -1;
- test = n;
+ test = test_selection;
find_ticks_for_pass();
sflag++;
- bail++;
+ bail++;
break;
case 11:
case 57:
diff --git a/efi_memtest/memtest86+/efi/lib.c b/efi_memtest/memtest86+/efi/lib.c
index aa9ca63..2914694 100644
--- a/efi_memtest/memtest86+/efi/lib.c
+++ b/efi_memtest/memtest86+/efi/lib.c
@@ -708,6 +708,10 @@ void footer()
}
}
+/*
+ * Read the value typed at position x,y in pop up
+ * Return value can be a test number or a page number
+ */
ulong getval(int x, int y, int result_shift)
{
unsigned long val;