Skip to content

Commit fb64ae3

Browse files
committed
Fix some anomalies found with PVS-Studio (#140)
1 parent d9e24a5 commit fb64ae3

File tree

19 files changed

+24
-24
lines changed

19 files changed

+24
-24
lines changed

src/Layers/xrRenderPC_R1/FStaticRender_RenderTarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CRenderTarget::CRenderTarget()
2626
param_color_map_influence = 0.0f;
2727
param_color_map_interpolate = 0.0f;
2828

29-
im_noise_time = 1 / 100;
29+
im_noise_time = 1 / 100.0f;
3030
im_noise_shift_w = 0;
3131
im_noise_shift_h = 0;
3232

src/Layers/xrRenderPC_R2/r2_rendertarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ CRenderTarget::CRenderTarget()
195195
param_noise_fps = 25.f;
196196
param_noise_scale = 1.f;
197197

198-
im_noise_time = 1 / 100;
198+
im_noise_time = 1 / 100.0f;
199199
im_noise_shift_w = 0;
200200
im_noise_shift_h = 0;
201201

src/Layers/xrRenderPC_R3/r3_rendertarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ CRenderTarget::CRenderTarget()
291291
param_noise_fps = 25.f;
292292
param_noise_scale = 1.f;
293293

294-
im_noise_time = 1 / 100;
294+
im_noise_time = 1 / 100.0f;
295295
im_noise_shift_w = 0;
296296
im_noise_shift_h = 0;
297297

src/Layers/xrRenderPC_R4/r4_rendertarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ CRenderTarget::CRenderTarget()
293293
param_noise_fps = 25.f;
294294
param_noise_scale = 1.f;
295295

296-
im_noise_time = 1 / 100;
296+
im_noise_time = 1 / 100.0f;
297297
im_noise_shift_w = 0;
298298
im_noise_shift_h = 0;
299299

src/utils/LWO/lwio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ int sgetI1(unsigned char** bp)
335335
if (i > 127)
336336
i -= 256;
337337
flen += 1;
338-
*bp++;
338+
(*bp)++;
339339
return i;
340340
}
341341

@@ -373,7 +373,7 @@ unsigned char sgetU1(unsigned char** bp)
373373
return 0;
374374
c = **bp;
375375
flen += 1;
376-
*bp++;
376+
(*bp)++;
377377
return c;
378378
}
379379

src/utils/LWO/lwob.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static int add_clip(char* s, lwClip** clist, int* nclips)
7979
clip->source.still.name = s;
8080
}
8181

82-
*nclips++;
82+
(*nclips)++;
8383
clip->index = *nclips;
8484

8585
lwListAdd(clist, clip);

src/utils/xrDXT/NVI_Image.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ void NVI_Image::ABGR8_To_ARGB8()
151151
{
152152
DWORD col;
153153
GetPixel_ARGB8(&col, i);
154-
DWORD a = (col >> 24) && 0x000000FF;
155-
DWORD b = (col >> 16) && 0x000000FF;
156-
DWORD g = (col >> 8) && 0x000000FF;
157-
DWORD r = (col >> 0) && 0x000000FF;
154+
DWORD a = (col >> 24) & 0x000000FF;
155+
DWORD b = (col >> 16) & 0x000000FF;
156+
DWORD g = (col >> 8) & 0x000000FF;
157+
DWORD r = (col >> 0) & 0x000000FF;
158158
col = (a << 24) | (r << 16) | (g << 8) | b;
159159
SetPixel_ARGB8(i, col);
160160
}

src/utils/xrDXT/dds/tPixel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ class RGBAMipMappedCubeMap
952952
const RGBAMipMappedImage& operator[](size_t i) const { return cubeFaces[i]; }
953953
size_t numMIPMaps() const { return cubeFaces[0].numMIPMaps(); }
954954
size_t height() const { return cubeFaces[0].height(); }
955-
size_t width() const { return cubeFaces[0].height(); }
955+
size_t width() const { return cubeFaces[0].width(); }
956956
void clear()
957957
{
958958
for (size_t f = 0; f < 6; f++)
@@ -1140,7 +1140,7 @@ class fpMipMappedCubeMap
11401140
const fpMipMappedImage& operator[](size_t i) const { return cubeFaces[i]; }
11411141
size_t numMIPMaps() const { return cubeFaces[0].numMIPMaps(); }
11421142
size_t height() const { return cubeFaces[0].height(); }
1143-
size_t width() const { return cubeFaces[0].height(); }
1143+
size_t width() const { return cubeFaces[0].width(); }
11441144
void clear()
11451145
{
11461146
for (size_t f = 0; f < 6; f++)

src/utils/xrQSlim/src/MxQMetric.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ MxMatrix& MxQuadric::homogeneous(MxMatrix& H) const
8181
unsigned int i, j;
8282

8383
for (i = 0; i < A.dim(); i++)
84-
for (j = 0; j < A.dim(); i++)
84+
for (j = 0; j < A.dim(); j++)
8585
H(i, j) = A(i, j);
8686

8787
for (i = 0; i < b.dim(); i++)

src/xrCore/_matrix33.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ struct _matrix33
377377
R.x = s1 * (m[0][0] * V1.x + m[1][0] * V1.y + m[2][0] * V1.z);
378378
R.y = s1 * (m[0][1] * V1.x + m[1][1] * V1.y + m[2][1] * V1.z);
379379
R.z = s1 * (m[0][2] * V1.x + m[1][2] * V1.y + m[2][2] * V1.z);
380+
return *this;
380381
}
381382
IC SelfRef MxV(Tvector& R, const Tvector& V1) const
382383
{

0 commit comments

Comments
 (0)