Skip to content

Commit 386cecb

Browse files
committed
vertexcodec: Fix typedef shadowing warning in amalgamated builds
We define unaligned_int in meshopt:: namespace in meshletcodec.cpp and inside decodeBytesGroupSimd in vertexcodec.cpp. These definitions do not conflict but produce Wshadow warning on clang. Since they are identical, we can move the vertexcodec definition to meshopt namespace too; this results in typedef redefinition which is valid when it's redundant (the type is the same).
1 parent bd54817 commit 386cecb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/vertexcodec.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,12 @@ inline __m128i decodeShuffleMask(unsigned char mask0, unsigned char mask1)
816816
return _mm_unpacklo_epi64(sm0, sm1r);
817817
}
818818

819+
#ifdef __GNUC__
820+
typedef int __attribute__((aligned(1))) unaligned_int;
821+
#else
822+
typedef int unaligned_int;
823+
#endif
824+
819825
SIMD_TARGET
820826
inline const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsigned char* buffer, int hbits)
821827
{
@@ -834,12 +840,6 @@ inline const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi
834840
case 1:
835841
case 6:
836842
{
837-
#ifdef __GNUC__
838-
typedef int __attribute__((aligned(1))) unaligned_int;
839-
#else
840-
typedef int unaligned_int;
841-
#endif
842-
843843
#ifdef SIMD_LATENCYOPT
844844
unsigned int data32;
845845
memcpy(&data32, data, 4);

0 commit comments

Comments
 (0)