summaryrefslogtreecommitdiff
path: root/src/qcommon/vm_sparc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qcommon/vm_sparc.c')
-rw-r--r--src/qcommon/vm_sparc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qcommon/vm_sparc.c b/src/qcommon/vm_sparc.c
index 69bbdc5f..370ee200 100644
--- a/src/qcommon/vm_sparc.c
+++ b/src/qcommon/vm_sparc.c
@@ -259,7 +259,7 @@ static const struct sparc_opcode sparc_opcodes[] = {
{ "fbg", BFCC(0,6), { ARG_DISP22 }, },
{ "fble", BFCC(0,13), { ARG_DISP22 }, },
};
-#define SPARC_NUM_OPCODES (sizeof(sparc_opcodes) / sizeof(sparc_opcodes[0]))
+#define SPARC_NUM_OPCODES (ARRAY_LEN(sparc_opcodes))
#define RS1(X) (((X) & 0x1f) << 14)
#define RS2(X) (((X) & 0x1f) << 0)
@@ -320,7 +320,7 @@ static unsigned int sparc_assemble(enum sparc_iname iname, const int argc, const
#define IN(inst, args...) \
({ const int argv[] = { args }; \
- const int argc = sizeof(argv) / sizeof(argv[0]); \
+ const int argc = ARRAY_LEN(argv); \
sparc_assemble(inst, argc, argv); \
})
@@ -1427,7 +1427,7 @@ static void sparc_compute_code(vm_t *vm, struct func_info * const fp)
data_and_code = mmap(NULL, code_length, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANONYMOUS, -1, 0);
- if (!data_and_code)
+ if (data_and_code == MAP_FAILED)
DIE("Not enough memory");
code_now = code_begin = (unsigned int *)