From 4ff0403e7d92abc74f381640fba05d590f408fb5 Mon Sep 17 00:00:00 2001 From: Eric Bagus Date: Thu, 8 Feb 2024 21:54:31 +0100 Subject: [PATCH] refactoring: function names changed --- src/inputHandler.c | 7 ++++--- src/inputHandler.h | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/inputHandler.c b/src/inputHandler.c index 39af339..47e5df1 100644 --- a/src/inputHandler.c +++ b/src/inputHandler.c @@ -1,7 +1,8 @@ #include "inputHandler.h" #include -int getOperationId(char symbol) { +// return operation id for a specific symbol +int getOperationIdBySymbol(char symbol) { int id = 0; switch (symbol) { case '+': @@ -23,7 +24,7 @@ int getOperationId(char symbol) { } // returns operation symbol for a specific operation id -char getOperationSymbol(int id) { +char getOperationSymbolById(int id) { char symbol = ' '; switch (id) { case 1: @@ -45,7 +46,7 @@ char getOperationSymbol(int id) { } // Checking if operation id is available -int isOperationValid(int id) { +int isOperationIdValid(int id) { if(id < 0 || id > 7) return 0; return 1; } \ No newline at end of file diff --git a/src/inputHandler.h b/src/inputHandler.h index 107f49e..6e4e4d5 100644 --- a/src/inputHandler.h +++ b/src/inputHandler.h @@ -1,10 +1,10 @@ #ifndef THEADMIRALS_INPUTHANDLER_H #define THEADMIRALS_INPUTHANDLER_H -int getOperationId(char); +int getOperationIdBySymbol(char); -char getOperationSymbol(int); +char getOperationSymbolById(int); -int isOperationValid(int); +int isOperationIdValid(int); #endif //THEADMIRALS_INPUTHANDLER_H