Skip to content

Commit

Permalink
Decoration: Remove usage of multi-character constants
Browse files Browse the repository at this point in the history
  • Loading branch information
kwolekr committed Jul 6, 2013
1 parent 307c57d commit 55ecde6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ bool DecoSchematic::loadSchematicFile() {
std::ifstream is(filename.c_str(), std::ios_base::binary);

u32 signature = readU32(is);
if (signature != 'MTSM') {
if (signature != MTSCHEM_FILE_SIGNATURE) {
errorstream << "loadSchematicFile: invalid schematic "
"file" << std::endl;
return false;
Expand Down Expand Up @@ -719,7 +719,7 @@ bool DecoSchematic::loadSchematicFile() {
void DecoSchematic::saveSchematicFile(INodeDefManager *ndef) {
std::ofstream os(filename.c_str(), std::ios_base::binary);

writeU32(os, 'MTSM'); // signature
writeU32(os, MTSCHEM_FILE_SIGNATURE); // signature
writeU16(os, 1); // version
writeV3S16(os, size); // schematic size

Expand Down
2 changes: 2 additions & 0 deletions src/mapgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ class DecoSimple : public Decoration {
virtual std::string getName();
};

#define MTSCHEM_FILE_SIGNATURE 0x4d54534d // 'MTSM'

enum Rotation {
ROTATE_0,
ROTATE_90,
Expand Down

0 comments on commit 55ecde6

Please sign in to comment.