Changeset - r22820:930d96d49ef1
[Not reviewed]
master
0 2 0
Charles Pigott - 6 years ago 2018-04-21 13:54:46
charlespigott@googlemail.com
Fix: Warning about base set template instantiations with clang
2 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/base_media_base.h
Show inline comments
 
@@ -210,24 +210,29 @@ public:
 
	static const Tbase_set *GetSet(int index);
 
	static const Tbase_set *GetUsedSet();
 

	
 
	/**
 
	 * Check whether we have an set with the exact characteristics as ci.
 
	 * @param ci the characteristics to search on (shortname and md5sum)
 
	 * @param md5sum whether to check the MD5 checksum
 
	 * @return true iff we have an set matching.
 
	 */
 
	static bool HasSet(const ContentInfo *ci, bool md5sum);
 
};
 

	
 
template <class Tbase_set> /* static */ const char *BaseMedia<Tbase_set>::ini_set;
 
template <class Tbase_set> /* static */ const Tbase_set *BaseMedia<Tbase_set>::used_set;
 
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::available_sets;
 
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::duplicate_sets;
 

	
 
/**
 
 * Check whether there's a base set matching some information.
 
 * @param ci The content info to compare it to.
 
 * @param md5sum Should the MD5 checksum be tested as well?
 
 * @param s The list with sets.
 
 * @return The filename of the first file of the base set, or \c NULL if there is no match.
 
 */
 
template <class Tbase_set>
 
const char *TryGetBaseSetFile(const ContentInfo *ci, bool md5sum, const Tbase_set *s);
 

	
 
/** Types of graphics in the base graphics set */
 
enum GraphicsFileType {
src/base_media_func.h
Show inline comments
 
@@ -8,29 +8,24 @@
 
 */
 

	
 
/**
 
 * @file base_media_func.h Generic function implementations for base data (graphics, sounds).
 
 * @note You should _never_ include this file due to the SET_TYPE define.
 
 */
 

	
 
#include "base_media_base.h"
 
#include "debug.h"
 
#include "ini_type.h"
 
#include "string_func.h"
 

	
 
template <class Tbase_set> /* static */ const char *BaseMedia<Tbase_set>::ini_set;
 
template <class Tbase_set> /* static */ const Tbase_set *BaseMedia<Tbase_set>::used_set;
 
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::available_sets;
 
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::duplicate_sets;
 

	
 
/**
 
 * Try to read a single piece of metadata and return false if it doesn't exist.
 
 * @param name the name of the item to fetch.
 
 */
 
#define fetch_metadata(name) \
 
	item = metadata->GetItem(name, false); \
 
	if (item == NULL || StrEmpty(item->value)) { \
 
		DEBUG(grf, 0, "Base " SET_TYPE "set detail loading: %s field missing.", name); \
 
		DEBUG(grf, 0, "  Is %s readable for the user running OpenTTD?", full_filename); \
 
		return false; \
 
	}
 

	
0 comments (0 inline, 0 general)