Permalink
Browse files

DEVTOOLS: Fix Compiler Warnings in create_cryo tool.

Have compared output dat files from the tool before and after this
change and they are identical.
  • Loading branch information...
digitall committed Oct 7, 2018
1 parent 5d40a61 commit cc2260d80d65b6fb06d27a79c2f254e1d6a578ad
Showing with 5 additions and 5 deletions.
  1. +5 −5 devtools/create_cryo/create_cryo_dat.cpp
@@ -31,14 +31,14 @@
template <typename T>
static void writeLE(FILE *f, T value) {
for (int i = 0; i < sizeof(value); i++, value >>= 8) {
for (unsigned int i = 0; i < sizeof(value); i++, value >>= 8) {
unsigned char b = value & 0xFF;
fwrite(&b, 1, 1, f);
}
}
struct _icon_t : icon_t {
void write(FILE *f) {
void write(FILE *f) const {
writeLE<int16>(f, sx);
writeLE<int16>(f, sy);
writeLE<int16>(f, ex);
@@ -50,13 +50,13 @@ struct _icon_t : icon_t {
};
static void emitIcons(FILE *f) {
_icon_t *icons = (_icon_t*)gameIcons;
const _icon_t *icons = (const _icon_t*)gameIcons;
for (int i = 0; i < kNumIcons; i++)
icons[i].write(f);
}
struct _room_t : room_t {
void write(FILE *f) {
void write(FILE *f) const {
writeLE<byte>(f, ff_0);
writeLE<byte>(f, exits[0]);
writeLE<byte>(f, exits[1]);
@@ -73,7 +73,7 @@ struct _room_t : room_t {
};
static void emitRooms(FILE *f) {
_room_t *rooms = (_room_t*)gameRooms;
const _room_t *rooms = (const _room_t*)gameRooms;
for (int i = 0; i < kNumRooms; i++)
rooms[i].write(f);
}

0 comments on commit cc2260d

Please sign in to comment.