Fixed GCC 5 warnings.

This commit is contained in:
Branimir Karadžić 2015-12-28 17:16:36 -08:00
parent 930fbe9e1a
commit 7c102d6d6d
5 changed files with 8 additions and 15 deletions

View file

@ -44,7 +44,7 @@
#define NV_NOINLINE __attribute__((noinline))
// Define __FUNC__ properly.
#if __STDC_VERSION__ < 199901L
#if defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
# define __FUNC__ __PRETTY_FUNCTION__ // __FUNCTION__
# else

View file

@ -50,7 +50,7 @@
#define NV_NOINLINE __attribute__((noinline))
// Define __FUNC__ properly.
#if __STDC_VERSION__ < 199901L
#if defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
# define __FUNC__ __PRETTY_FUNCTION__ // __FUNCTION__
# else

View file

@ -33,7 +33,7 @@
#define NV_NOINLINE __attribute__((noinline))
// Define __FUNC__ properly.
#if __STDC_VERSION__ < 199901L
#if defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
# define __FUNC__ __PRETTY_FUNCTION__ // __FUNCTION__
# else

View file

@ -9,19 +9,19 @@
namespace nv {
// C++ helpers.
template <typename T> NV_FORCEINLINE T * malloc(size_t count) {
template <typename T> inline T * malloc(size_t count) {
return (T *)::malloc(sizeof(T) * count);
}
template <typename T> NV_FORCEINLINE T * realloc(T * ptr, size_t count) {
template <typename T> inline T * realloc(T * ptr, size_t count) {
return (T *)::realloc(ptr, sizeof(T) * count);
}
template <typename T> NV_FORCEINLINE void free(const T * ptr) {
template <typename T> inline void free(const T * ptr) {
::free((void *)ptr);
}
template <typename T> NV_FORCEINLINE void zero(T & data) {
template <typename T> inline void zero(T & data) {
memset(&data, 0, sizeof(T));
}

View file

@ -185,6 +185,7 @@
# pragma GCC diagnostic ignored "-Wunused-but-set-variable"
# pragma GCC diagnostic ignored "-Wunused-variable"
# pragma GCC diagnostic ignored "-Wunused-parameter"
# pragma GCC diagnostic ignored "-Warray-bounds"
#elif defined POSH_COMPILER_MSVC
# define NV_CC_MSVC 1
# define NV_CC_STRING "msvc"
@ -222,14 +223,6 @@
#define NV_ENDIAN_STRING POSH_ENDIAN_STRING
// Define the right printf prefix for size_t arguments:
#if POSH_64BIT_POINTER
# define NV_SIZET_PRINTF_PREFIX POSH_I64_PRINTF_PREFIX
#else
# define NV_SIZET_PRINTF_PREFIX
#endif
// Type definitions:
typedef posh_u8_t uint8;
typedef posh_i8_t int8;