ref: e05b607daa43304c2d862c9e00cadc1890cb6fe6
parent: 783adb9afe83af4f598ad19d327aa813e71276a1
parent: b468ed3c0b26cd4589bff2dd3d358cf84a1db6d7
author: Ethan Hugg <[email protected]>
date: Mon Jan 27 06:46:44 EST 2014
Merge pull request #223 from mstorsjo/typedef-cleanup Clean up typedefs within the libraries
--- a/codec/common/crt_util_safe_x.h
+++ b/codec/common/crt_util_safe_x.h
@@ -120,7 +120,7 @@
#if (defined(WIN32) && defined(_MSC_VER) && (_MSC_VER<1500)) || defined(__GNUC__)
-static __inline int wels_strncpy_s (char* dest, int dmax, const char* src, int slen) {
+static inline int wels_strncpy_s (char* dest, int dmax, const char* src, int slen) {
int orig_dmax;
char* orig_dest;
const char* overlap_bumper;
@@ -260,7 +260,7 @@
return (ESNOSPC);
}
-static __inline int wels_strcat_s (char* dest, int dmax, const char* src) {
+static inline int wels_strcat_s (char* dest, int dmax, const char* src) {
int orig_dmax;
char* orig_dest;
const char* overlap_bumper;
@@ -387,7 +387,7 @@
return (ESNOSPC);
}
-static __inline int wels_strnlen_s (const char* dest, int dmax) {
+static inline int wels_strnlen_s (const char* dest, int dmax) {
int count;
if (dest == NULL) {
--- a/codec/common/macros.h
+++ b/codec/common/macros.h
@@ -131,7 +131,7 @@
nC += (uint8_t)(nA == -1 && nB == -1); \
}
-static __inline int32_t CeilLog2 (int32_t i) {
+static inline int32_t CeilLog2 (int32_t i) {
int32_t s = 0;
i--;
while (i > 0) {
--- a/codec/processing/src/common/memory.h
+++ b/codec/processing/src/common/memory.h
@@ -47,15 +47,15 @@
WELSVP_NAMESPACE_BEGIN
-inline_t void* WelsMemset (void* pPointer, int32_t iValue, uint32_t uiSize) {
+inline void* WelsMemset (void* pPointer, int32_t iValue, uint32_t uiSize) {
return ::memset (pPointer, iValue, uiSize);
}
-inline_t void* WelsMemcpy (void* pDst, const void* kpSrc, uint32_t uiSize) {
+inline void* WelsMemcpy (void* pDst, const void* kpSrc, uint32_t uiSize) {
return ::memcpy (pDst, kpSrc, uiSize);
}
-inline_t int32_t WelsMemcmp (const void* kpBuf1, const void* kpBuf2, uint32_t uiSize) {
+inline int32_t WelsMemcmp (const void* kpBuf1, const void* kpBuf2, uint32_t uiSize) {
return ::memcmp (kpBuf1, kpBuf2, uiSize);
}
--- a/codec/processing/src/common/thread.h
+++ b/codec/processing/src/common/thread.h
@@ -71,7 +71,7 @@
#endif
-typedef long_t WELS_THREAD_ERROR_CODE;
+typedef int32_t WELS_THREAD_ERROR_CODE;
#define WELS_THREAD_ERROR_OK 0
#define WELS_THREAD_ERROR_GENERAL ((unsigned long)(-1))
--- a/codec/processing/src/common/typedef.h
+++ b/codec/processing/src/common/typedef.h
@@ -60,7 +60,7 @@
#if defined(_MSC_VER)
-typedef char int8_t ;
+typedef signed char int8_t ;
typedef unsigned char uint8_t ;
typedef short int16_t ;
typedef unsigned short uint16_t ;
@@ -68,17 +68,14 @@
typedef unsigned int uint32_t ;
typedef __int64 int64_t ;
typedef unsigned __int64 uint64_t ;
-#define inline_t _inline
+#if _MSC_VER < 1700
+#define inline __inline
+#endif
-#else // GCC
-
-#define inline_t inline
-
#endif
typedef char str_t ; // [comment]: specific use plain char only for character parameters
-typedef long long_t ;
-typedef int32_t bool_t ;
+typedef bool bool_t ;
#if defined(_WIN32) || defined(_MACH_PLATFORM) || defined(__GNUC__)
typedef float float_t ;
--- a/codec/processing/src/common/util.h
+++ b/codec/processing/src/common/util.h
@@ -67,8 +67,8 @@
#define WELS_MAX(x, y) ((x) > (y) ? (x) : (y))
#define WELS_MIN(x, y) ((x) < (y) ? (x) : (y))
-#define WELS_SIGN(a) ((long_t)(a) >> 31)
-#define WELS_ABS(a) ((WELS_SIGN(a) ^ (long_t)(a)) - WELS_SIGN(a))
+#define WELS_SIGN(a) ((int32_t)(a) >> 31)
+#define WELS_ABS(a) ((WELS_SIGN(a) ^ (int32_t)(a)) - WELS_SIGN(a))
#define WELS_CLAMP(x, minv, maxv) WELS_MIN(WELS_MAX(x, minv), maxv)
#define ALIGNBYTES (16) /* Worst case is requiring alignment to an 16 byte boundary */
@@ -84,7 +84,7 @@
#define GET_METHOD(x) ((x) & 0xff) // mask method as the lowest 8bits
#define GET_SPECIAL(x) (((x) >> 8) & 0xff) // mask special flag as 8bits
-inline_t EMethods WelsVpGetValidMethod (int32_t a) {
+inline EMethods WelsVpGetValidMethod (int32_t a) {
int32_t iMethod = GET_METHOD (a);
return WelsStaticCast (EMethods, WELS_CLAMP (iMethod, METHOD_NULL + 1, METHOD_MASK - 1));
}