mirror of https://github.com/mgba-emu/mgba.git
All: Remove duplicate functions
This commit is contained in:
parent
f72a582382
commit
227cbea37a
|
@ -30,23 +30,7 @@ int mLogGenerateCategory(const char*);
|
||||||
const char* mLogCategoryName(int);
|
const char* mLogCategoryName(int);
|
||||||
|
|
||||||
ATTRIBUTE_FORMAT(printf, 3, 4)
|
ATTRIBUTE_FORMAT(printf, 3, 4)
|
||||||
#ifndef __NO_INLINE__
|
|
||||||
static inline void mLog(int category, enum mLogLevel level, const char* format, ...) {
|
|
||||||
struct mLogger* context = mLogGetContext();
|
|
||||||
va_list args;
|
|
||||||
va_start(args, format);
|
|
||||||
if (context) {
|
|
||||||
context->log(context, category, level, format, args);
|
|
||||||
} else {
|
|
||||||
printf("%s: ", mLogCategoryName(category));
|
|
||||||
vprintf(format, args);
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void mLog(int category, enum mLogLevel level, const char* format, ...);
|
void mLog(int category, enum mLogLevel level, const char* format, ...);
|
||||||
#endif
|
|
||||||
|
|
||||||
#define mLOG(CATEGORY, LEVEL, ...) mLog(_mLOG_CAT_ ## CATEGORY (), mLOG_ ## LEVEL, __VA_ARGS__)
|
#define mLOG(CATEGORY, LEVEL, ...) mLog(_mLOG_CAT_ ## CATEGORY (), mLOG_ ## LEVEL, __VA_ARGS__)
|
||||||
|
|
||||||
|
|
|
@ -29,18 +29,8 @@ void TableClear(struct Table*);
|
||||||
void TableEnumerate(const struct Table*, void (handler(uint32_t key, void* value, void* user)), void* user);
|
void TableEnumerate(const struct Table*, void (handler(uint32_t key, void* value, void* user)), void* user);
|
||||||
size_t TableSize(const struct Table*);
|
size_t TableSize(const struct Table*);
|
||||||
|
|
||||||
#ifndef __NO_INLINE__
|
|
||||||
static inline void HashTableInit(struct Table* table, size_t initialSize, void (deinitializer(void*))) {
|
|
||||||
TableInit(table, initialSize, deinitializer);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void HashTableDeinit(struct Table* table) {
|
|
||||||
TableDeinit(table);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void HashTableInit(struct Table* table, size_t initialSize, void (deinitializer(void*)));
|
void HashTableInit(struct Table* table, size_t initialSize, void (deinitializer(void*)));
|
||||||
void HashTableDeinit(struct Table* table);
|
void HashTableDeinit(struct Table* table);
|
||||||
#endif
|
|
||||||
|
|
||||||
void* HashTableLookup(const struct Table*, const char* key);
|
void* HashTableLookup(const struct Table*, const char* key);
|
||||||
void HashTableInsert(struct Table*, const char* key, void* value);
|
void HashTableInsert(struct Table*, const char* key, void* value);
|
||||||
|
|
Loading…
Reference in New Issue