diff options
author | dreammaster | 2019-06-27 04:02:48 +0100 |
---|---|---|
committer | Paul Gilbert | 2019-07-06 15:27:08 -0700 |
commit | dc40211ec5e54d01f7cb822940714ed6e6da36d5 (patch) | |
tree | dedda7f6ce1ab7f581941d9f002ad1926fa3e367 /engines/glk/alan3/lists.cpp | |
parent | aebf25661076eaa382b3025f0123f6ceb7cf920b (diff) | |
download | scummvm-rg350-dc40211ec5e54d01f7cb822940714ed6e6da36d5.tar.gz scummvm-rg350-dc40211ec5e54d01f7cb822940714ed6e6da36d5.tar.bz2 scummvm-rg350-dc40211ec5e54d01f7cb822940714ed6e6da36d5.zip |
GLK: ALAN3: Proper indentation & formatting
Diffstat (limited to 'engines/glk/alan3/lists.cpp')
-rw-r--r-- | engines/glk/alan3/lists.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/engines/glk/alan3/lists.cpp b/engines/glk/alan3/lists.cpp index c42e90e84d..1b50896cb6 100644 --- a/engines/glk/alan3/lists.cpp +++ b/engines/glk/alan3/lists.cpp @@ -31,34 +31,32 @@ void initArray(void *array) { } /* How to know we are at end of a table or array, first Aword == EOD */ -void implementationOfSetEndOfArray(Aword *adr) -{ +void implementationOfSetEndOfArray(Aword *adr) { *adr = EOD; } -bool implementationOfIsEndOfList(Aword *adr) -{ +bool implementationOfIsEndOfList(Aword *adr) { return *adr == EOD; } int lengthOfArrayImplementation(void *array_of_any_type, int element_size_in_bytes) { - int length; - int element_size = element_size_in_bytes/sizeof(Aword); - Aword *array = (Aword *)array_of_any_type; - if (array == NULL) - syserr("Taking length of NULL array"); - for (length = 0; !isEndOfArray(&array[length*element_size]); length++) - ; - return length; + int length; + int element_size = element_size_in_bytes / sizeof(Aword); + Aword *array = (Aword *)array_of_any_type; + if (array == NULL) + syserr("Taking length of NULL array"); + for (length = 0; !isEndOfArray(&array[length * element_size]); length++) + ; + return length; } void addElementImplementation(void *array_of_any_type, void *element, int element_size_in_bytes) { Aword *array = (Aword *)array_of_any_type; int length = lengthOfArray(array); - int element_size_in_words = element_size_in_bytes/sizeof(Aword); - memcpy(&array[length*element_size_in_words], element, element_size_in_bytes); - setEndOfArray(&array[(length+1)*element_size_in_words]); + int element_size_in_words = element_size_in_bytes / sizeof(Aword); + memcpy(&array[length * element_size_in_words], element, element_size_in_bytes); + setEndOfArray(&array[(length + 1)*element_size_in_words]); } } // End of namespace Alan3 |