From e6c41b84b88596d130de98919480afdb0dce3fcf Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Wed, 6 Nov 2024 17:57:09 +0800 Subject: Code clean up. --- door_lock/cmd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'door_lock/cmd.c') diff --git a/door_lock/cmd.c b/door_lock/cmd.c index b757e33..fb9ae9c 100644 --- a/door_lock/cmd.c +++ b/door_lock/cmd.c @@ -1,4 +1,3 @@ -#include #include #include "cmd.h" @@ -11,7 +10,7 @@ static char cmd[XORLEN]; -static inline void xor(const char *s, char *d, uint8_t n) +static inline void xor(const char *s, char *d, int n) { int i; @@ -19,7 +18,7 @@ static inline void xor(const char *s, char *d, uint8_t n) d[i] = s[i] ^ KEY[i]; } -int is_valid_cmd(const char *s, enum command c) +int cmd_cmp(const char *s, enum command c) { int rc; char buf[XORLEN + 1]; @@ -42,7 +41,7 @@ int is_valid_cmd(const char *s, enum command c) return rc; } -char * get_cmd_hash(enum command c) +char * cmd_hash(enum command c) { switch (c) { case DOOR_LOCK: -- cgit v1.2.3