Decoration: Remove usage of multi-character constants
authorkwolekr <kwolekr@minetest.net>
Sat, 6 Jul 2013 19:03:34 +0000 (15:03 -0400)
committerkwolekr <kwolekr@minetest.net>
Sat, 6 Jul 2013 19:03:54 +0000 (15:03 -0400)
src/mapgen.cpp
src/mapgen.h

index 94d1a6310a51177cd1fa73e0527a4bd8bfcf1d88..fe1cfb3a45be59504ea5bd8a9fd4bb54a38ff5e2 100644 (file)
@@ -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;
@@ -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
        
index 7229e89967660e7183f7c95bb81ccbeaf653e08b..2287445ee542290706bc5dc8d1dba8c728f8a1f2 100644 (file)
@@ -260,6 +260,8 @@ public:
        virtual std::string getName();
 };
 
+#define MTSCHEM_FILE_SIGNATURE 0x4d54534d // 'MTSM'
+
 enum Rotation {
        ROTATE_0,
        ROTATE_90,