Skip to content

Commit

Permalink
Code quality fixes
Browse files Browse the repository at this point in the history
Fixes for typos, forgotten return, wrong operations...

More here:
English: https://www.viva64.com/en/b/0405/
Russian: https://www.viva64.com/ru/b/0405/
  • Loading branch information
Xottab-DUTY committed Mar 31, 2019
1 parent 339548f commit 015a782
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cs/engine/layers/xrRender/VertexCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

VertexCache::VertexCache()
{
VertexCache(16);
this->VertexCache::VertexCache(16);
}


Expand Down
8 changes: 4 additions & 4 deletions cs/engine/utils/xrDXT/NVI_Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ void NVI_Image::ABGR8_To_ARGB8()
{
DWORD col;
GetPixel_ARGB8(&col, i);
DWORD a = (col >> 24) && 0x000000FF;
DWORD b = (col >> 16) && 0x000000FF;
DWORD g = (col >> 8) && 0x000000FF;
DWORD r = (col >> 0) && 0x000000FF;
DWORD a = (col >> 24) & 0x000000FF;
DWORD b = (col >> 16) & 0x000000FF;
DWORD g = (col >> 8) & 0x000000FF;
DWORD r = (col >> 0) & 0x000000FF;
col = (a << 24) | (r << 16) | (g << 8) | b;
SetPixel_ARGB8(i, col);
}
Expand Down
2 changes: 1 addition & 1 deletion cs/engine/utils/xrDXT/NVI_Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace xray_nvi

public:
NVI_Image();
~NVI_Image();
virtual ~NVI_Image();
virtual HRESULT Initialize(int width, int height, NVI_PIXEL_FORMAT format);
virtual HRESULT Initialize(int width, int height, NVI_PIXEL_FORMAT format, u8* data);
virtual HRESULT Free();
Expand Down
4 changes: 2 additions & 2 deletions cs/engine/utils/xrDXT/dds/tPixel.h
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ class RGBAMipMappedCubeMap

size_t width() const
{
return cubeFaces[0].height();
return cubeFaces[0].width();
}

void clear()
Expand Down Expand Up @@ -1334,7 +1334,7 @@ class fpMipMappedCubeMap

size_t width() const
{
return cubeFaces[0].height();
return cubeFaces[0].width();
}

void clear()
Expand Down
2 changes: 1 addition & 1 deletion cs/engine/utils/xrSE_Factory/bone.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct ECORE_API SBoneShape
}
bool Valid(){
switch (type){
case stBox: return !fis_zero(box.m_halfsize.x)&&!fis_zero(box.m_halfsize.x)&&!fis_zero(box.m_halfsize.x);
case stBox: return !fis_zero(box.m_halfsize.x)&&!fis_zero(box.m_halfsize.y)&&!fis_zero(box.m_halfsize.z);
case stSphere: return !fis_zero(sphere.R);
case stCylinder:return !fis_zero(cylinder.m_height)&&!fis_zero(cylinder.m_radius)&&!fis_zero(cylinder.m_direction.square_magnitude());
};
Expand Down
3 changes: 0 additions & 3 deletions cs/engine/xrCore/LocatorAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,6 @@ void CLocatorAPI::_initialize (u32 flags, LPCSTR target_folder, LPCSTR fs_name)
pAppdataPath->_set_root(c_newAppPathRoot);
rescan_path(pAppdataPath->m_Path, pAppdataPath->m_Flags.is(FS_Path::flRecurse));
}

int x=0;
x=x;
}

rec_files.clear ();
Expand Down
2 changes: 1 addition & 1 deletion cs/engine/xrCore/_cylinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ typedef _cylinder<float> Fcylinder;
typedef _cylinder<double> Dcylinder;

template <class T>
BOOL _valid (const _cylinder<T>& c) { return _valid(c.m_center) && _valid(c.m_direction) && _valid(c.m_height) && _valid(c.m_height); }
BOOL _valid (const _cylinder<T>& c) { return _valid(c.m_center) && _valid(c.m_direction) && _valid(c.m_height) && _valid(c.m_radius); }

#endif // _DEBUG
1 change: 1 addition & 0 deletions cs/engine/xrCore/_matrix33.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ struct _matrix33{
R.x = s1*(m[0][0] * V1.x + m[1][0] * V1.y + m[2][0] * V1.z);
R.y = s1*(m[0][1] * V1.x + m[1][1] * V1.y + m[2][1] * V1.z);
R.z = s1*(m[0][2] * V1.x + m[1][2] * V1.y + m[2][2] * V1.z);
return *this;
}
IC SelfRef MxV(Tvector& R, const Tvector& V1) const
{
Expand Down
1 change: 1 addition & 0 deletions cs/engine/xrCore/buffer_vector_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ TEMPLATE_SPECIALIZATION
inline typename buffer_vector_specialized::self_type &buffer_vector_specialized::operator= (self_type const &other)
{
assign (other.begin(), other.end());
return *this;
}

TEMPLATE_SPECIALIZATION
Expand Down

0 comments on commit 015a782

Please sign in to comment.