Skip to content

Commit

Permalink
DEVTOOLS: Fix Compiler Warnings in create_access Tool.
Browse files Browse the repository at this point in the history
These were various shadowed variable and unsigned vs. signed
comparison warnings.
  • Loading branch information
digitall committed Oct 7, 2018
1 parent fe654d2 commit 5d40a61
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions devtools/create_access/create_access_dat.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void writeMartianCommonData(int argc, char *argv[]) {


// Total up the first 256 bytes of the executable as a simplified checksum // Total up the first 256 bytes of the executable as a simplified checksum
uint fileChecksum = 0; uint fileChecksum = 0;
for (int idx = 0; idx < 256; ++idx) for (int i = 0; i < 256; ++i)
fileChecksum += exeFile.readByte(); fileChecksum += exeFile.readByte();


if (fileChecksum == 10454) { if (fileChecksum == 10454) {
Expand All @@ -176,8 +176,8 @@ void writeMartianCommonData(int argc, char *argv[]) {
#define FONT_COUNT 119 #define FONT_COUNT 119
const int FONT_WIDTHS[2] = { 0x47E6, 0x4C9C }; const int FONT_WIDTHS[2] = { 0x47E6, 0x4C9C };
const int FONT_CHAR_OFFSETS[2] = { 0x46F8, 0x4BAE }; const int FONT_CHAR_OFFSETS[2] = { 0x46F8, 0x4BAE };
const int FONT_DATA_SIZE[2] = { 849, 907 }; const uint FONT_DATA_SIZE[2] = { 849, 907 };
int idx, dataOffset; int dataOffset;


for (int fontNum = 0; fontNum < 2; ++fontNum) { for (int fontNum = 0; fontNum < 2; ++fontNum) {
// Write out sizes // Write out sizes
Expand All @@ -191,14 +191,14 @@ void writeMartianCommonData(int argc, char *argv[]) {
// Write out character offsets // Write out character offsets
uint offsets[FONT_COUNT]; uint offsets[FONT_COUNT];
exeFile.seek(DATA_SEGMENT + FONT_CHAR_OFFSETS[fontNum]); exeFile.seek(DATA_SEGMENT + FONT_CHAR_OFFSETS[fontNum]);
for (int idx = 0; idx < FONT_COUNT; ++idx) { for (int i = 0; i < FONT_COUNT; ++i) {
offsets[idx] = exeFile.readWord(); offsets[i] = exeFile.readWord();
if (idx == 0) if (i == 0)
dataOffset = offsets[0]; dataOffset = offsets[0];
offsets[idx] -= dataOffset; offsets[i] -= dataOffset;
assert(offsets[idx] < FONT_DATA_SIZE[fontNum]); assert(offsets[i] < FONT_DATA_SIZE[fontNum]);


outputFile.writeWord(offsets[idx]); outputFile.writeWord(offsets[i]);
} }


// Write out character data // Write out character data
Expand Down

0 comments on commit 5d40a61

Please sign in to comment.