Changeset - r24520:90c9681053b0
[Not reviewed]
master
0 2 0
cirdan - 12 years ago 2012-12-08 18:21:55
cirdansw@gmail.com
Cleanup: Remove unused ChunkType flag CH_AUTO_LENGTH

CH_AUTO_LENGTH is no longer used anywhere, so remove all code
that depends on it.
2 files changed with 0 insertions and 33 deletions:
0 comments (0 inline, 0 general)
src/saveload/saveload.cpp
Show inline comments
 
@@ -1754,32 +1754,6 @@ static void SlLoadCheckChunk(const Chunk
 
}
 

	
 
/**
 
 * Stub Chunk handlers to only calculate length and do nothing else.
 
 * The intended chunk handler that should be called.
 
 */
 
static ChunkSaveLoadProc *_stub_save_proc;
 

	
 
/**
 
 * Stub Chunk handlers to only calculate length and do nothing else.
 
 * Actually call the intended chunk handler.
 
 * @param arg ignored parameter.
 
 */
 
static inline void SlStubSaveProc2(void *arg)
 
{
 
	_stub_save_proc();
 
}
 

	
 
/**
 
 * Stub Chunk handlers to only calculate length and do nothing else.
 
 * Call SlAutoLenth with our stub save proc that will eventually
 
 * call the intended chunk handler.
 
 */
 
static void SlStubSaveProc()
 
{
 
	SlAutolength(SlStubSaveProc2, nullptr);
 
}
 

	
 
/**
 
 * Save a chunk of data (eg. vehicles, stations, etc.). Each chunk is
 
 * prefixed by an ID identifying it, followed by data, and terminator where appropriate
 
 * @param ch The chunkhandler that will be used for the operation
 
@@ -1794,12 +1768,6 @@ static void SlSaveChunk(const ChunkHandl
 
	SlWriteUint32(ch->id);
 
	DEBUG(sl, 2, "Saving chunk %c%c%c%c", ch->id >> 24, ch->id >> 16, ch->id >> 8, ch->id);
 

	
 
	if (ch->flags & CH_AUTO_LENGTH) {
 
		/* Need to calculate the length. Solve that by calling SlAutoLength in the save_proc. */
 
		_stub_save_proc = proc;
 
		proc = SlStubSaveProc;
 
	}
 

	
 
	_sl.block_mode = ch->flags & CH_TYPE_MASK;
 
	switch (ch->flags & CH_TYPE_MASK) {
 
		case CH_RIFF:
src/saveload/saveload.h
Show inline comments
 
@@ -409,7 +409,6 @@ enum ChunkType {
 
	CH_SPARSE_ARRAY =  2,
 
	CH_TYPE_MASK    =  3,
 
	CH_LAST         =  8, ///< Last chunk in this array.
 
	CH_AUTO_LENGTH  = 16,
 
};
 

	
 
/**
0 comments (0 inline, 0 general)