From e718159ed89acf205213caf4cb218a52bb5312d0 Mon Sep 17 00:00:00 2001 From: sBubshait Date: Mon, 4 Nov 2024 00:29:07 +0000 Subject: [PATCH] Update syscall to use screaming uppercase casing for a constant --- src/userprog/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c index 2926bbd..ddbbd39 100644 --- a/src/userprog/syscall.c +++ b/src/userprog/syscall.c @@ -34,7 +34,7 @@ static const syscall_arguments syscall_lookup[] = { /* The number of syscall functions (i.e, number of elements) within the syscall_lookup table. */ -static const int lookup_size +static const int LOOKUP_SIZE = sizeof (syscall_lookup) / sizeof (syscall_arguments); void @@ -51,7 +51,7 @@ syscall_handler (struct intr_frame *f) int syscall_number = *(int *) f->esp; /* Ensures the number corresponds to a system call that can be handled. */ - if (syscall_number < 0 || syscall_number >= lookup_size) + if (syscall_number < 0 || syscall_number >= LOOKUP_SIZE) thread_exit (); syscall_arguments syscall = syscall_lookup[syscall_number];