From 7fd32e4b0409faeeb741fb6ceb93087e2d615eb0 Mon Sep 17 00:00:00 2001 From: Sophia Weber Date: Sun, 28 Jan 2024 12:00:16 +0100 Subject: [PATCH] refactoring: function names improved --- src/inputHandling.c | 12 ++++++------ src/inputHandling.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/inputHandling.c b/src/inputHandling.c index 8479485..b147ae1 100644 --- a/src/inputHandling.c +++ b/src/inputHandling.c @@ -7,8 +7,8 @@ char data[1000]; void deleteWhitespace(char* a, int length); op readFunction(char* data, int length); -char* getnumbers(char* data, int length, calc_op* structure_ref); -void printstruct(calc_op* formula); +char* getNumbers(char* data, int length, calc_op* structure_ref); +void showStruct(calc_op* formula); void input(char* a, int length) { @@ -17,8 +17,8 @@ void input(char* a, int length) { memcpy(data,a,length); temp.formel = a; temp.funktionstyp = readFunction(data, 10); - if (getnumbers(data,length, &temp) == NULL){ - printstruct(&temp); + if (getNumbers(data, length, &temp) == NULL){ + showStruct(&temp); } else { printf("Formular %s not supported", temp.formel); } @@ -51,7 +51,7 @@ op readFunction(char* data, int length){ } //Zahlen auslesen (+) -char* getnumbers(char* data, int length, calc_op* structure_ref){ //input sind: string, länge vom String, berechnungsstruct +char* getNumbers(char* data, int length, calc_op* structure_ref){ //input sind: string, länge vom String, berechnungsstruct // char tmp[length]; char* splitPnt; int i = 0; @@ -88,7 +88,7 @@ char* getnumbers(char* data, int length, calc_op* structure_ref){ //input sind: } } -void printstruct(calc_op* formula){ +void showStruct(calc_op* formula){ printf("Berechnung: %s\n", formula->formel); switch (formula->funktionstyp) { case opAdd: diff --git a/src/inputHandling.h b/src/inputHandling.h index 92ace40..9d91f38 100644 --- a/src/inputHandling.h +++ b/src/inputHandling.h @@ -16,6 +16,6 @@ double result; }calc_op; extern void input(char* a, int length); -extern void printstruct(calc_op* formula); +extern void showStruct(calc_op* formula); #endif // INPUTHANDLING_H