From d4213ed582273a14fd9b8718e1b2e319a9209dce Mon Sep 17 00:00:00 2001 From: dbalatoni13 <40299962+dbalatoni13@users.noreply.github.com> Date: Mon, 14 Apr 2025 18:19:01 +0200 Subject: [PATCH] Fix line duplications in byteswap.cpp --- src/port/byteswap.cpp | 142 +----------------------------------------- 1 file changed, 1 insertion(+), 141 deletions(-) diff --git a/src/port/byteswap.cpp b/src/port/byteswap.cpp index ac844e4b..64b61dbe 100644 --- a/src/port/byteswap.cpp +++ b/src/port/byteswap.cpp @@ -7,7 +7,6 @@ #include #include -extern "C" { extern "C" { #include "port/byteswap.h" } @@ -19,7 +18,6 @@ template [[nodiscard]] constexpr T bswap16(T val) noexcept u16 u; T t; } v { .t = val }; - } v { .t = val }; #if __GNUC__ v.u = __builtin_bswap16(v.u); #elif _WIN32 @@ -37,7 +35,6 @@ template [[nodiscard]] constexpr T bswap32(T val) noexcept u32 u; T t; } v { .t = val }; - } v { .t = val }; #if __GNUC__ v.u = __builtin_bswap32(v.u); #elif _WIN32 @@ -123,7 +120,6 @@ template T *offset_ptr(B &base, T *ptr, void *extra) template void bswap_flat(B &base, T *start, s32 count) { T *objBase = start; - for (s32 i = 0; i < count; ++i) { for (s32 i = 0; i < count; ++i) { bswap(base, objBase[i]); } @@ -185,13 +181,6 @@ template void bswap(B &base, HsfVector3f &vec) bswap(base, vec.z); } -template void bswap(B &base, HsfVector3f &vec) -{ - bswap(base, vec.x); - bswap(base, vec.y); - bswap(base, vec.z); -} - template void bswap(B &base, AnimData32b &obj, AnimData &dest) { bswap(base, obj.bankNum); @@ -767,19 +756,6 @@ void byteswap_hsfvec2f(HsfVector2f *src) sVisitedPtrs.clear(); } -void byteswap_hsfvec3f(HsfVector3f *src) -{ - bswap(*src, *src); - sVisitedPtrs.clear(); -} - -void byteswap_hsfvec2f(HsfVector2f *src) -{ - auto *vec = reinterpret_cast(src); - bswap(*vec, *vec); - sVisitedPtrs.clear(); -} - void byteswap_animdata(void *src, AnimData *dest) { auto *anim = reinterpret_cast(src); @@ -937,120 +913,4 @@ void byteswap_hsfface(HsfFace32b *src, HsfFace *dest) { bswap(*src, *src, *dest); sVisitedPtrs.clear(); -} - -void byteswap_hsfcluster(HsfCluster32b *src, HsfCluster *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfattribute(HsfAttribute32b *src, HsfAttribute *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfmaterial(HsfMaterial32b *src, HsfMaterial *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfscene(HsfScene *src) -{ - bswap(*src, *src); - sVisitedPtrs.clear(); -} - -void byteswap_hsfbuffer(HsfBuffer32b *src, HsfBuffer *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfmatrix(HsfMatrix *src) -{ - bswap(*src, *src); - sVisitedPtrs.clear(); -} - -void byteswap_hsfpalette(HsfPalette32b *src, HsfPalette *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfpart(HsfPart32b *src, HsfPart *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfbitmap(HsfBitmap32b *src, HsfBitmap *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfmapattr(HsfMapAttr32b *src, HsfMapAttr *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfskeleton(HsfSkeleton32b *src, HsfSkeleton *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfshape(HsfShape32b *src, HsfShape *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfcenv_single(HsfCenvSingle *src) -{ - bswap(*src, *src); - sVisitedPtrs.clear(); -} - -void byteswap_hsfcenv(HsfCenv32b *src, HsfCenv *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfobject(HsfObject32b *src, HsfObject *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - - -void byteswap_hsfbitmapkey(HsfBitmapKey32b *src, HsfBitmapKey *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - - -void byteswap_hsftrack(HsfTrack32b *src, HsfTrack *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfmotion(HsfMotion32b *src, HsfMotion *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} - -void byteswap_hsfface(HsfFace32b *src, HsfFace *dest) -{ - bswap(*src, *src, *dest); - sVisitedPtrs.clear(); -} +} \ No newline at end of file