Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/trunk]: xsrc/external/mit/libdrm/dist/amdgpu lint fixes:



details:   https://anonhg.NetBSD.org/xsrc/rev/49f18213959b
branches:  trunk
changeset: 10832:49f18213959b
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Dec 14 14:43:42 2021 +0000

description:
lint fixes:
1. avoid typedef re-definitions (perhaps introduce c11 mode for lint)
2. add __lint__ wherever __GNUC__ is defined.

diffstat:

 external/mit/MesaLib.old/dist/src/amd/addrlib/inc/addrinterface.h |   3 ++
 external/mit/MesaLib.old/dist/src/amd/addrlib/inc/addrtypes.h     |  14 +++++-----
 external/mit/MesaLib.old/dist/src/amd/common/ac_gpu_info.h        |   3 ++
 external/mit/MesaLib.old/dist/src/amd/common/ac_surface.h         |   3 ++
 external/mit/MesaLib.old/dist/src/util/u_atomic.h                 |   2 +-
 external/mit/libdrm/dist/amdgpu/amdgpu.h                          |   3 ++
 6 files changed, 20 insertions(+), 8 deletions(-)

diffs (132 lines):

diff -r d14cbfaccc4a -r 49f18213959b external/mit/MesaLib.old/dist/src/amd/addrlib/inc/addrinterface.h
--- a/external/mit/MesaLib.old/dist/src/amd/addrlib/inc/addrinterface.h Fri Dec 10 21:57:13 2021 +0000
+++ b/external/mit/MesaLib.old/dist/src/amd/addrlib/inc/addrinterface.h Tue Dec 14 14:43:42 2021 +0000
@@ -45,7 +45,10 @@
 #define ADDRLIB_VERSION ((ADDRLIB_VERSION_MAJOR << 16) | ADDRLIB_VERSION_MINOR)
 
 /// Virtually all interface functions need ADDR_HANDLE as first parameter
+#ifndef ADDR_HANDLE_TYPEDEF
+#define ADDR_HANDLE_TYPEDEF
 typedef VOID*   ADDR_HANDLE;
+#endif
 
 /// Client handle used in callbacks
 typedef VOID*   ADDR_CLIENT_HANDLE;
diff -r d14cbfaccc4a -r 49f18213959b external/mit/MesaLib.old/dist/src/amd/addrlib/inc/addrtypes.h
--- a/external/mit/MesaLib.old/dist/src/amd/addrlib/inc/addrtypes.h     Fri Dec 10 21:57:13 2021 +0000
+++ b/external/mit/MesaLib.old/dist/src/amd/addrlib/inc/addrtypes.h     Tue Dec 14 14:43:42 2021 +0000
@@ -67,7 +67,7 @@
 ****************************************************************************************************
 */
 #ifndef ADDR_CDECL
-    #if defined(__GNUC__)
+    #if defined(__GNUC__) || defined(__lint__)
         #define ADDR_CDECL __attribute__((cdecl))
     #else
         #define ADDR_CDECL __cdecl
@@ -75,7 +75,7 @@
 #endif
 
 #ifndef ADDR_STDCALL
-    #if defined(__GNUC__)
+    #if defined(__GNUC__) || defined(__lint__)
         #if defined(__amd64__) || defined(__x86_64__)
             #define ADDR_STDCALL
         #else
@@ -89,13 +89,13 @@
 #ifndef ADDR_FASTCALL
     #if defined(BRAHMA_ARM)
         #define ADDR_FASTCALL
-    #elif defined(__GNUC__)
+    #elif defined(__GNUC__) || defined(__lint__)
         #if defined(__i386__)
             #define ADDR_FASTCALL __attribute__((regparm(0)))
         #else
             #define ADDR_FASTCALL
         #endif
-    #else
+    #elif
         #define ADDR_FASTCALL __fastcall
     #endif
 #endif
@@ -112,7 +112,7 @@
     #define GC_FASTCALL  ADDR_FASTCALL
 #endif
 
-#if defined(__GNUC__)
+#if defined(__GNUC__) || defined(__lint__)
     #define ADDR_INLINE static inline   // inline needs to be static to link
 #else
     // win32, win64, other platforms
@@ -656,7 +656,7 @@
 //
 //  64-bit integer types depend on the compiler
 //
-#if defined( __GNUC__ ) || defined( __WATCOMC__ )
+#if defined( __GNUC__ ) || defined( __WATCOMC__ ) || defined(__lint__)
 #define INT_64   long long
 #define UINT_64  unsigned long long
 
@@ -689,7 +689,7 @@
 
 //  ADDR64X is used to print addresses in hex form on both Windows and Linux
 //
-#if defined( __GNUC__ ) || defined( __WATCOMC__ )
+#if defined( __GNUC__ ) || defined( __WATCOMC__ ) || defined(__lint__)
 #define ADDR64X "llx"
 #define ADDR64D "lld"
 
diff -r d14cbfaccc4a -r 49f18213959b external/mit/MesaLib.old/dist/src/amd/common/ac_gpu_info.h
--- a/external/mit/MesaLib.old/dist/src/amd/common/ac_gpu_info.h        Fri Dec 10 21:57:13 2021 +0000
+++ b/external/mit/MesaLib.old/dist/src/amd/common/ac_gpu_info.h        Tue Dec 14 14:43:42 2021 +0000
@@ -36,7 +36,10 @@
 #endif
 
 /* Prior to C11 the following may trigger a typedef redeclaration warning */
+#ifndef AMDGPU_DEVICE_TYPEDEF
+#define AMDGPU_DEVICE_TYPEDEF
 typedef struct amdgpu_device *amdgpu_device_handle;
+#endif
 struct amdgpu_gpu_info;
 
 struct radeon_info {
diff -r d14cbfaccc4a -r 49f18213959b external/mit/MesaLib.old/dist/src/amd/common/ac_surface.h
--- a/external/mit/MesaLib.old/dist/src/amd/common/ac_surface.h Fri Dec 10 21:57:13 2021 +0000
+++ b/external/mit/MesaLib.old/dist/src/amd/common/ac_surface.h Tue Dec 14 14:43:42 2021 +0000
@@ -36,7 +36,10 @@
 #endif
 
 /* Forward declarations. */
+#ifndef ADDR_HANDLE_TYPEDEF
+#define ADDR_HANDLE_TYPEDEF
 typedef void* ADDR_HANDLE;
+#endif
 
 struct amdgpu_gpu_info;
 struct radeon_info;
diff -r d14cbfaccc4a -r 49f18213959b external/mit/MesaLib.old/dist/src/util/u_atomic.h
--- a/external/mit/MesaLib.old/dist/src/util/u_atomic.h Fri Dec 10 21:57:13 2021 +0000
+++ b/external/mit/MesaLib.old/dist/src/util/u_atomic.h Tue Dec 14 14:43:42 2021 +0000
@@ -24,7 +24,7 @@
 #define PIPE_ATOMIC_OS_SOLARIS
 #elif defined(_MSC_VER)
 #define PIPE_ATOMIC_MSVC_INTRINSIC
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) || defined(__lint__)
 #define PIPE_ATOMIC_GCC_INTRINSIC
 #else
 #error "Unsupported platform"
diff -r d14cbfaccc4a -r 49f18213959b external/mit/libdrm/dist/amdgpu/amdgpu.h
--- a/external/mit/libdrm/dist/amdgpu/amdgpu.h  Fri Dec 10 21:57:13 2021 +0000
+++ b/external/mit/libdrm/dist/amdgpu/amdgpu.h  Tue Dec 14 14:43:42 2021 +0000
@@ -114,7 +114,10 @@
  * "initialize" function and should be pass as the first
  * parameter to any API call
  */
+#ifndef AMDGPU_DEVICE_TYPEDEF
+#define AMDGPU_DEVICE_TYPEDEF
 typedef struct amdgpu_device *amdgpu_device_handle;
+#endif
 
 /**
  * Define GPU Context type as pointer to opaque structure



Home | Main Index | Thread Index | Old Index