From 5ed70a368ed35e8f168ae08659801e14c9b7e579 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 4 Feb 2018 16:42:59 +0100 Subject: [PATCH] [Loader] Code formatting --- loader/src/module_parser.cpp | 15 +++++---------- loader/src/module_parser.h | 3 --- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/loader/src/module_parser.cpp b/loader/src/module_parser.cpp index a4f625e..2eb999b 100644 --- a/loader/src/module_parser.cpp +++ b/loader/src/module_parser.cpp @@ -75,11 +75,8 @@ void printModuleInformation(module_information_t* module_information){ }else{ DEBUG_FUNCTION_LINE("metadata is null\n"); } - - } - bool Module_CheckFile(const char *path) { const char *extension; @@ -263,13 +260,13 @@ module_information_t* Module_LoadMetaDataFromElf(const char *path, Elf *elf) { } else { metadata->size += shdr->sh_size; /* add alignment padding to size */ - if (shdr->sh_addralign > 3) + if (shdr->sh_addralign > 3){ /* roundup to multiple of sh_addralign */ - metadata->size += - (-metadata->size & (shdr->sh_addralign - 1)); - else + metadata->size += (-metadata->size & (shdr->sh_addralign - 1)); + }else{ /* roundup to multiple of 4 */ metadata->size += (-metadata->size & 3); + } } } } @@ -308,9 +305,7 @@ static module_information_t *Module_ModuleInformationRead(const char *path, Elf entries_count = 0; - for (scn = elf_nextscn(elf, NULL); - scn != NULL; - scn = elf_nextscn(elf, scn)) { + for (scn = elf_nextscn(elf, NULL); scn != NULL; scn = elf_nextscn(elf, scn)) { Elf32_Shdr *shdr; const char *name; diff --git a/loader/src/module_parser.h b/loader/src/module_parser.h index fcd9c70..d34df4e 100644 --- a/loader/src/module_parser.h +++ b/loader/src/module_parser.h @@ -25,7 +25,6 @@ typedef struct { size_t entries_count; } module_metadata_t; - typedef struct { const char *name; void *address; @@ -43,6 +42,4 @@ bool Module_CheckFile(const char *path); void printModuleInformation(module_information_t* module_information); module_information_t* Module_LoadModuleInformation(const char *path); - - #endif