Mercurial > hg > dmlib
comparison tools/objlink.c @ 2553:5c714feeb3a7
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 27 Feb 2022 16:36:20 +0200 |
parents | c6ee41fd98dd |
children | aabfa00eafd9 |
comparison
equal
deleted
inserted
replaced
2552:fdea5e3d727f | 2553:5c714feeb3a7 |
---|---|
28 | 28 |
29 typedef struct | 29 typedef struct |
30 { | 30 { |
31 char *name; // Description of memory model | 31 char *name; // Description of memory model |
32 char *desc; | 32 char *desc; |
33 int size; // Total addressable memory size | 33 int size; // Total addressable memory size |
34 int nmemBlocks; // Defined memory areas | 34 int nmemBlocks; // Defined memory areas |
35 DMMemBlock memBlocks[SET_MAX_MEMBLOCKS]; | 35 DMMemBlock memBlocks[SET_MAX_MEMBLOCKS]; |
36 } DMMemModel; | 36 } DMMemModel; |
37 | 37 |
38 | 38 |
39 typedef struct | 39 typedef struct |
55 | 55 |
56 // How to determine block placement / address | 56 // How to determine block placement / address |
57 enum | 57 enum |
58 { | 58 { |
59 PLACE_STATIC = 1, // Already known | 59 PLACE_STATIC = 1, // Already known |
60 PLACE_ARGUMENT, // Commandline argument | 60 PLACE_ARGUMENT, // Commandline argument |
61 PLACE_FILE, // From file | 61 PLACE_FILE, // From file |
62 }; | 62 }; |
63 | 63 |
64 enum | 64 enum |
65 { | 65 { |
66 FMT_GENERIC = 1, | 66 FMT_GENERIC = 1, |
188 void argShowHelp() | 188 void argShowHelp() |
189 { | 189 { |
190 dmPrintBanner(stdout, dmProgName, "[options]"); | 190 dmPrintBanner(stdout, dmProgName, "[options]"); |
191 dmArgsPrintHelp(stdout, optList, optListN, 0, 80 - 2); | 191 dmArgsPrintHelp(stdout, optList, optListN, 0, 80 - 2); |
192 | 192 |
193 printf( | 193 fprintf(stdout, |
194 "\n" | 194 "\n" |
195 "Each numeric argument can be prefixed with $ or 0x for hexadecimal values.\n" | 195 "Each numeric argument can be prefixed with $ or 0x for hexadecimal values.\n" |
196 "NOTICE! -p filename:<addr> will ignore load address and use <addr> instead!\n" | 196 "NOTICE! -p filename:<addr> will ignore load address and use <addr> instead!\n" |
197 "\n" | 197 "\n" |
198 "Available memory models:\n"); | 198 "Available memory models:\n"); |
199 | 199 |
200 for (int i = 0; i < nmemoryModels; i++) | 200 for (int i = 0; i < nmemoryModels; i++) |
201 { | 201 { |
202 const DMMemModel *m = &memoryModels[i]; | 202 const DMMemModel *m = &memoryModels[i]; |
203 printf(" %d = %-40s [%s] (%d kB)\n", | 203 fprintf(stdout, |
204 " %d = %-40s [%s] (%d kB)\n", | |
204 i, m->name, m->desc, m->size / 1024); | 205 i, m->name, m->desc, m->size / 1024); |
205 } | 206 } |
206 } | 207 } |
207 | 208 |
208 | 209 |
734 | 735 |
735 /* Print out an ASCII presentation of memory map | 736 /* Print out an ASCII presentation of memory map |
736 */ | 737 */ |
737 void memPrintLine(FILE *f) | 738 void memPrintLine(FILE *f) |
738 { | 739 { |
739 fprintf(f, " +------------------------------------------+\n"); | 740 fprintf(f, |
741 " +------------------------------------------+\n"); | |
740 } | 742 } |
741 | 743 |
742 void memPrintEmpty(FILE *f, int n) | 744 void memPrintEmpty(FILE *f, int n) |
743 { | 745 { |
744 for (int i = 0; i < n; i++) | 746 for (int i = 0; i < n; i++) |
745 fprintf(f, " | |\n"); | 747 fprintf(f, |
748 " | |\n"); | |
746 } | 749 } |
747 | 750 |
748 void dmDescribeMemory(FILE *f) | 751 void dmDescribeMemory(FILE *f) |
749 { | 752 { |
750 DMMemBlock *prev = NULL; | 753 DMMemBlock *prev = NULL; |