Use inline namespace dcx for common/misc
This commit is contained in:
parent
463ed96b4b
commit
5b9e50a815
|
@ -39,6 +39,8 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
#define __noreturn
|
#define __noreturn
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
inline namespace dcx {
|
||||||
|
|
||||||
int error_init(void (*func)(const char *)); //init error system, returns 0=ok
|
int error_init(void (*func)(const char *)); //init error system, returns 0=ok
|
||||||
void Warning_puts(const char *str) __attribute_nonnull();
|
void Warning_puts(const char *str) __attribute_nonnull();
|
||||||
void Warning(const char *fmt,...) __attribute_format_printf(1, 2); //print out warning message to user
|
void Warning(const char *fmt,...) __attribute_format_printf(1, 2); //print out warning message to user
|
||||||
|
@ -116,4 +118,6 @@ static inline void d_debugbreak()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,13 +18,12 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#ifndef _HASH_H
|
|
||||||
#define _HASH_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
inline namespace dcx {
|
||||||
|
|
||||||
struct hashtable
|
struct hashtable
|
||||||
{
|
{
|
||||||
struct compare_t
|
struct compare_t
|
||||||
|
@ -37,6 +36,4 @@ struct hashtable
|
||||||
int hashtable_search( hashtable *ht, const char *key );
|
int hashtable_search( hashtable *ht, const char *key );
|
||||||
void hashtable_insert( hashtable *ht, const char *key, int value );
|
void hashtable_insert( hashtable *ht, const char *key, int value );
|
||||||
|
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "physfsx.h"
|
#include "physfsx.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
inline namespace dcx {
|
||||||
|
|
||||||
#define HMP_TRACKS 32
|
#define HMP_TRACKS 32
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -101,6 +102,7 @@ void hmp_resume(hmp_file *hmp);
|
||||||
void hmp_reset();
|
void hmp_reset();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -54,6 +54,8 @@
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
inline namespace dcx {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn int PHYSFSEXT_locateCorrectCase(char *buf)
|
* \fn int PHYSFSEXT_locateCorrectCase(char *buf)
|
||||||
* \brief Find an existing filename with matching case.
|
* \brief Find an existing filename with matching case.
|
||||||
|
@ -82,5 +84,7 @@ int PHYSFSEXT_locateCorrectCase(char *buf);
|
||||||
|
|
||||||
/* end of ignorecase.h ... */
|
/* end of ignorecase.h ... */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
#include "dxxsconf.h"
|
#include "dxxsconf.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
inline namespace dcx {
|
||||||
|
|
||||||
#if defined(macintosh)
|
#if defined(macintosh)
|
||||||
#define snprintf macintosh_snprintf
|
#define snprintf macintosh_snprintf
|
||||||
extern void snprintf(char *out_string, int size, const char * format, ... );
|
extern void snprintf(char *out_string, int size, const char * format, ... );
|
||||||
|
@ -80,4 +82,6 @@ public:
|
||||||
|
|
||||||
int string_array_sort_func(char **e0, char **e1);
|
int string_array_sort_func(char **e0, char **e1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -31,6 +31,8 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "dxxerror.h"
|
#include "dxxerror.h"
|
||||||
|
|
||||||
|
inline namespace dcx {
|
||||||
|
|
||||||
#define MAX_MSG_LEN 2048
|
#define MAX_MSG_LEN 2048
|
||||||
|
|
||||||
static void (*ErrorPrintFunc)(const char *);
|
static void (*ErrorPrintFunc)(const char *);
|
||||||
|
@ -148,3 +150,5 @@ int error_init(void (*func)(const char *))
|
||||||
ErrorPrintFunc = func; // Set Error Print Functions
|
ErrorPrintFunc = func; // Set Error Print Functions
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -25,6 +25,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
|
|
||||||
|
inline namespace dcx {
|
||||||
|
|
||||||
bool hashtable::compare_t::operator()(const char *l, const char *r) const
|
bool hashtable::compare_t::operator()(const char *l, const char *r) const
|
||||||
{
|
{
|
||||||
for (;; ++l, ++r)
|
for (;; ++l, ++r)
|
||||||
|
@ -49,3 +51,5 @@ void hashtable_insert(hashtable *ht, const char *key, int value)
|
||||||
{
|
{
|
||||||
ht->m.insert(std::make_pair(key, value));
|
ht->m.insert(std::make_pair(key, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#include "compiler-range_for.h"
|
#include "compiler-range_for.h"
|
||||||
#include "partial_range.h"
|
#include "partial_range.h"
|
||||||
|
|
||||||
|
inline namespace dcx {
|
||||||
|
|
||||||
#define MIDIINT(x) (words_bigendian ? (x) : (SWAPINT(x)))
|
#define MIDIINT(x) (words_bigendian ? (x) : (SWAPINT(x)))
|
||||||
#define MIDISHORT(x) (words_bigendian ? (x) : (SWAPSHORT(x)))
|
#define MIDISHORT(x) (words_bigendian ? (x) : (SWAPSHORT(x)))
|
||||||
|
|
||||||
|
@ -712,3 +714,5 @@ void hmp2mid(const char *hmp_name, std::vector<uint8_t> &midbuf)
|
||||||
serial::process_buffer(bbmi, static_cast<int32_t>(size_after - size_before));
|
serial::process_buffer(bbmi, static_cast<int32_t>(size_after - size_before));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
* \author Ryan C. Gordon.
|
* \author Ryan C. Gordon.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
inline namespace dcx {
|
||||||
|
|
||||||
/* I'm not screwing around with stricmp vs. strcasecmp... */
|
/* I'm not screwing around with stricmp vs. strcasecmp... */
|
||||||
static int caseInsensitiveStringCompare(const char *x, const char *y)
|
static int caseInsensitiveStringCompare(const char *x, const char *y)
|
||||||
{
|
{
|
||||||
|
@ -115,6 +117,7 @@ int PHYSFSEXT_locateCorrectCase(char *buf)
|
||||||
return a() ? 0 : -1;
|
return a() ? 0 : -1;
|
||||||
} /* PHYSFSEXT_locateCorrectCase */
|
} /* PHYSFSEXT_locateCorrectCase */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef TEST_PHYSFSEXT_LOCATECORRECTCASE
|
#ifdef TEST_PHYSFSEXT_LOCATECORRECTCASE
|
||||||
#define con_printf(A,B,...) printf(B "\n", ##__VA_ARGS__)
|
#define con_printf(A,B,...) printf(B "\n", ##__VA_ARGS__)
|
||||||
|
|
|
@ -36,6 +36,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
|
|
||||||
#include "compiler-range_for.h"
|
#include "compiler-range_for.h"
|
||||||
|
|
||||||
|
inline namespace dcx {
|
||||||
|
|
||||||
#ifdef macintosh
|
#ifdef macintosh
|
||||||
void snprintf(char *out_string, int size, char * format, ... )
|
void snprintf(char *out_string, int size, char * format, ... )
|
||||||
{
|
{
|
||||||
|
@ -230,3 +232,5 @@ void string_array_t::tidy(std::size_t offset, int (*comp)( const char *, const c
|
||||||
// Can't do this before reallocating, otherwise it makes a mess of things (the strings in the buffer aren't ordered)
|
// Can't do this before reallocating, otherwise it makes a mess of things (the strings in the buffer aren't ordered)
|
||||||
ptr.erase(std::unique(b, e, [=](const char *sa, const char *sb) { return (*comp)(sa, sb) == 0; }), e);
|
ptr.erase(std::unique(b, e, [=](const char *sa, const char *sb) { return (*comp)(sa, sb) == 0; }), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue