summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-12-16 05:47:06 +0100
committerAdam Borowski <kilobyte@angband.pl>2012-12-17 03:35:32 +0100
commite405948910a24e4c1af212eada7ca7244fa78571 (patch)
tree97da4ad915fbde21f7a0aee2eb9364600984d258 /crawl-ref/source/tags.h
parent0440931615164f061ca2f6d9a3b8d353994fb768 (diff)
downloadcrawl-ref-e405948910a24e4c1af212eada7ca7244fa78571.tar.gz
crawl-ref-e405948910a24e4c1af212eada7ca7244fa78571.zip
Remove unused marshallEnumVal subsystem.
Diffstat (limited to 'crawl-ref/source/tags.h')
-rw-r--r--crawl-ref/source/tags.h65
1 files changed, 0 insertions, 65 deletions
diff --git a/crawl-ref/source/tags.h b/crawl-ref/source/tags.h
index 3f84fbb507..dac3e29706 100644
--- a/crawl-ref/source/tags.h
+++ b/crawl-ref/source/tags.h
@@ -28,48 +28,6 @@ enum tag_type // used during save/load process to identify data blocks
TAG_SKIP
};
-struct enum_info
-{
- void (*collect)(vector<pair<int,string> >& prs);
- int replacement;
-
- struct enum_val
- {
- int value;
- const char *name;
- };
-
- const enum_val *historical;
- tag_minor_version non_historical_first;
- char historic_bytes;
-};
-
-struct enum_write_state
-{
- set<int> used;
- map<int, string> names;
- char store_type;
-
- enum_write_state() : used(), names(), store_type(0) {}
-};
-
-struct enum_read_state
-{
- map<int, int> mapping;
- map<string, int> names;
- char store_type;
-
- enum_read_state() : mapping(), names(), store_type(0) {}
-};
-
-template<typename enm> struct enum_details;
-
-// TO ADD A NEW ENUM UNDER THE UMBRELLA OF marshallEnum:
-// * Create an enum_info instance
-// * Instanciate the enum_details template
-// * Change existing serialization to use marshallEnum
-// * Bump minor version
-
/* ***********************************************************************
* writer API
* *********************************************************************** */
@@ -114,9 +72,6 @@ private:
vector<unsigned char>* _pbuf;
bool failed;
-
- map<const enum_info*, enum_write_state> used_enums;
- friend void marshallEnumVal(writer&, const enum_info*, int);
};
void marshallByte (writer &, int8_t);
@@ -133,15 +88,6 @@ void marshallMonster (writer &, const monster&);
void marshallMonsterInfo (writer &, const monster_info &);
void marshallMapCell (writer &, const map_cell &);
void marshall_level_id(writer& th, const level_id& id);
-
-void marshallEnumVal (writer &, const enum_info *, int);
-
-template<typename enm>
-static inline void marshallEnum(writer& wr, enm value)
-{
- marshallEnumVal(wr, &enum_details<enm>::desc, static_cast<int>(value));
-}
-
void marshallUnsigned(writer& th, uint64_t v);
void marshallSigned(writer& th, int64_t v);
@@ -183,9 +129,6 @@ private:
const vector<unsigned char>* _pbuf;
unsigned int _read_offset;
int _minorVersion;
-
- map<const enum_info*, enum_read_state> seen_enums;
- friend int unmarshallEnumVal(reader &, const enum_info *);
};
class short_read_exception : exception {};
@@ -205,14 +148,6 @@ void unmarshallMonsterInfo (reader &, monster_info &mi);
void unmarshallMapCell (reader &, map_cell& cell);
level_id unmarshall_level_id(reader& th);
-int unmarshallEnumVal (reader &, const enum_info *);
-
-template<typename enm>
-static inline enm unmarshallEnum(writer& wr)
-{
- return static_cast<enm>(unmarshallEnumVal(wr, &enum_details<enm>::desc));
-}
-
uint64_t unmarshallUnsigned(reader& th);
template<typename T>
static inline void unmarshallUnsigned(reader& th, T& v)