From b19d063d04cddac095d9b25e3966c5cb09a7daa9 Mon Sep 17 00:00:00 2001 From: cbnolok Date: Thu, 19 Oct 2023 18:36:00 +0200 Subject: [PATCH] Fixed warnings and coverity download being picky and case sensitive. --- .github/workflows/coverity-scan.yml | 2 +- src/game/CWorldMap.cpp | 14 +++++++------- src/game/CWorldMap.h | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml index 5e3dacae1..0e2764a3b 100644 --- a/.github/workflows/coverity-scan.yml +++ b/.github/workflows/coverity-scan.yml @@ -43,7 +43,7 @@ jobs: TOKEN: ${{ secrets.COVERITY_TOKEN }} #echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- run: | - wget -nv https://scan.coverity.com/download/cxx/linux64 --post-data "token=${TOKEN}&project=SphereServer/Source-X" -O cov-analysis-linux64.tar.gz + wget -nv https://scan.coverity.com/download/cxx/linux64 --post-data "token=${TOKEN}&project=Sphereserver/Source-X" -O cov-analysis-linux64.tar.gz mkdir cov-analysis-linux64 tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 export PATH=`pwd`/cov-analysis-linux64/bin:$PATH diff --git a/src/game/CWorldMap.cpp b/src/game/CWorldMap.cpp index a5682b14d..fa9a19590 100644 --- a/src/game/CWorldMap.cpp +++ b/src/game/CWorldMap.cpp @@ -267,7 +267,7 @@ const CServerMapBlock* CWorldMap::GetMapBlock(const CPointMap& pt) // static block->m_CacheTime.HitCacheTime(); return block.get(); } - + // else load and add it to the cache. block = std::make_unique(iBx, iBy, pt.m_map); ASSERT(block); @@ -860,7 +860,7 @@ CPointMap CWorldMap::FindItemTypeNearby(const CPointMap & pt, IT_TYPE iType, int if (fLimitZ) //Checking if we are in the same floor. { - + if (pMultiItem->m_dz != z2) continue; /* @@ -1446,7 +1446,7 @@ void CWorldMap::GetHeightPoint(const CPointMap & pt, CServerMapBlockState & bloc dwBlockThis = 0; // Terrain height is screwed. Since it is related to all the terrain around it. std::optional pMapTop = GetMapMeterAdjusted(pt); //Get pMapTop Z Adjusted. - //const CUOMapMeter* pMapTop = pMapBlock->GetTerrain(UO_BLOCK_OFFSET(pt.m_x), UO_BLOCK_OFFSET(pt.m_y)); + //const CUOMapMeter* pMapTop = pMapBlock->GetTerrain(UO_BLOCK_OFFSET(pt.m_x), UO_BLOCK_OFFSET(pt.m_y)); if (!pMapTop) return; //DEBUG_ERR(("pMeter->m_wTerrainIndex 0%x dwBlockThis (0%x)\n",pMeter->m_wTerrainIndex,dwBlockThis)); @@ -1487,14 +1487,14 @@ void CWorldMap::GetHeightPoint(const CPointMap & pt, CServerMapBlockState & bloc } } -const char CWorldMap::GetFloorAvarage(char pPoint1, char pPoint2, short iAverage) +char CWorldMap::GetFloorAvarage(char pPoint1, char pPoint2, short iAverage) { //We can't use char here, because higher points like hills has 64+ heights and adding 64+65 each other exceed char limit and causes returns minus values. const short pTotal = pPoint1 + pPoint2, pHalf = pTotal / 2, pEven = pTotal % 2, pAverage = iAverage - pHalf; return static_cast(pHalf + (pEven != 0 && pAverage > 5)); } -const short CWorldMap::GetAreaAverage(char pTop, char pLeft, char pBottom, char pRight) +short CWorldMap::GetAreaAverage(char pTop, char pLeft, char pBottom, char pRight) { const short iHighest1 = maximum(pTop, pBottom); const short iLowest1 = minimum(pTop, pBottom); @@ -1504,7 +1504,7 @@ const short CWorldMap::GetAreaAverage(char pTop, char pLeft, char pBottom, char return maximum(iHighest1, iHighest2) - minimum(iLowest1, iLowest2); } -const CUOMapMeter CWorldMap::CheckMapTerrain(CUOMapMeter pDefault, short x, short y, uchar map) +CUOMapMeter CWorldMap::CheckMapTerrain(CUOMapMeter pDefault, short x, short y, uchar map) { CPointMap pt = { x, y, 0, map }; const CServerMapBlock* pMapBlock = GetMapBlock(pt); @@ -1790,7 +1790,7 @@ CWorldSearch::CWorldSearch(const CPointMap& pt, int iDist) : _fInertToggle = false; _pObj = nullptr; _idxObj = _idxObjMax = 0; - + _pSectorBase = _pSector = pt.GetSector(); _rectSector.SetRect( diff --git a/src/game/CWorldMap.h b/src/game/CWorldMap.h index 563bec94f..794668416 100644 --- a/src/game/CWorldMap.h +++ b/src/game/CWorldMap.h @@ -37,9 +37,9 @@ class CWorldMap static const CUOMapMeter* GetMapMeter(const CPointMap& pt); // Height of MAP0.MUL at given coordinates static std::optional GetMapMeterAdjusted(const CPointMap& pt); - static const CUOMapMeter CheckMapTerrain(CUOMapMeter pDefault, short x, short y, uchar map); - static const char GetFloorAvarage(char pPoint1, char pPoint2, short iAverage); - static const short GetAreaAverage(char pTop, char pLeft, char pBottom, char pRight); + static CUOMapMeter CheckMapTerrain(CUOMapMeter pDefault, short x, short y, uchar map); + static char GetFloorAvarage(char pPoint1, char pPoint2, short iAverage); + static short GetAreaAverage(char pTop, char pLeft, char pBottom, char pRight); static CItemTypeDef* GetTerrainItemTypeDef(dword dwIndex); static IT_TYPE GetTerrainItemType(dword dwIndex);