diff options
| author | Frédéric Desbiens <[email protected]> | 2026-03-06 19:27:49 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-06 19:27:49 +0100 |
| commit | 3726d7906b4808bfec7855fc088e073199df9120 (patch) | |
| tree | 8789bfd03d1d49e1967e80d04aa4ff606fda43eb /common_modules/module_manager/utilities/module_to_c_array.c | |
| parent | 4b6e8100d932a3a67b34c6eb17f84f3bffb9e2ae (diff) | |
| parent | c3259a216026372e3833dd8996a68f77e8595fbd (diff) | |
Merge pull request #510 from eclipse-threadx/devv6.5.0.202601_rel
Merge changes ahead of the v6.5.0.202601 release
Diffstat (limited to 'common_modules/module_manager/utilities/module_to_c_array.c')
| -rw-r--r-- | common_modules/module_manager/utilities/module_to_c_array.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/common_modules/module_manager/utilities/module_to_c_array.c b/common_modules/module_manager/utilities/module_to_c_array.c index fc72092c..37d931f3 100644 --- a/common_modules/module_manager/utilities/module_to_c_array.c +++ b/common_modules/module_manager/utilities/module_to_c_array.c @@ -14,7 +14,7 @@ FILE *array_file; #define ELF_EXECUTABLE 2 -typedef struct ELF_HEADER_STRUCT +typedef struct ELF_HEADER_STRUCT { unsigned char elf_header_id_string[ELF_ID_STRING_SIZE]; unsigned short elf_header_file_type; @@ -114,12 +114,12 @@ unsigned char *buffer; for (i = 0; i < object_size; i++) { alpha = fgetc(source_file); - + if (alpha == EOF) return(1); - + buffer[i] = (unsigned char) alpha; - } + } /* Return success. */ return(0); @@ -140,7 +140,7 @@ CODE_SECTION_ENTRY code_section_temp; /* Determine if the proper number of files are provided. */ - if (argc != 3) + if (argc != 3) { /* Print an error message out and wait for user key hit. */ @@ -163,7 +163,7 @@ CODE_SECTION_ENTRY code_section_temp; printf(" File: %s ", argv[1]); return(2); } - + /* Attempt to open the dump file for writing. */ array_file = fopen(argv[2], "w"); @@ -192,7 +192,7 @@ CODE_SECTION_ENTRY code_section_temp; /* Allocate memory for the program header(s). */ program_header = malloc(sizeof(ELF_PROGRAM_HEADER)*header.elf_header_program_header_entries); - + /* Read the program header(s). */ elf_object_read(header.elf_header_program_header_offset, program_header, (sizeof(ELF_PROGRAM_HEADER)*header.elf_header_program_header_entries)); @@ -204,7 +204,7 @@ CODE_SECTION_ENTRY code_section_temp; /* Alocate memory for the section string table. */ - section_string_table = malloc(section_header[header.elf_header_section_string_index].elf_section_header_size); + section_string_table = malloc(section_header[header.elf_header_section_string_index].elf_section_header_size); /* Read the section string table. */ elf_object_read(section_header[header.elf_header_section_string_index].elf_section_header_offset, section_string_table, section_header[header.elf_header_section_string_index].elf_section_header_size); @@ -260,7 +260,7 @@ CODE_SECTION_ENTRY code_section_temp; printf("**** Error: No code sections found! **** \n"); fprintf(array_file, "unsigned char module_code[] = {0x00};\n\n"); - + /* Close files. */ fclose(source_file); fclose(array_file); @@ -337,7 +337,7 @@ CODE_SECTION_ENTRY code_section_temp; /* Write out the contents of this program area. */ size = code_section_array[i].code_section_size; - + j = 0; k = 0; while (size) @@ -372,7 +372,7 @@ CODE_SECTION_ENTRY code_section_temp; /* Move address forward. */ address++; - + /* Decrement size. */ size--; |
