Skip to content

Commit 015bfac

Browse files
committed
Use explicit type instead of void*
1 parent 611b60e commit 015bfac

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/Layers/xrRender/ParticleEffect.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ __forceinline void magnitude_sse(Fvector& vec, float& res)
428428
_mm_store_ss((float*)&res, tv);
429429
}
430430

431-
void ParticleRenderStream(void* lpvParams)
431+
void ParticleRenderStream(PRS_PARAMS* pParams)
432432
{
433433
#ifdef _GPA_ENABLED
434434
TAL_SCOPED_TASK_NAMED("ParticleRenderStream()");
@@ -442,8 +442,6 @@ void ParticleRenderStream(void* lpvParams)
442442
// But it must be 0xFFFFFFFF or otherwise some particles won't play
443443
float angle = 0xFFFFFFFF;
444444

445-
PRS_PARAMS* pParams = (PRS_PARAMS*)lpvParams;
446-
447445
FVF::LIT* pv = pParams->pv;
448446
u32 p_from = pParams->p_from;
449447
u32 p_to = pParams->p_to;
@@ -606,7 +604,7 @@ void CParticleEffect::Render(float)
606604
prsParams[i].p_to = (i == (nWorkers - 1)) ? p_cnt : (prsParams[i].p_from + nStep);
607605
prsParams[i].particles = particles;
608606
prsParams[i].pPE = this;
609-
ttapi.threads[i]->addJob([=] { ParticleRenderStream((void*)&prsParams[i]); });
607+
ttapi.threads[i]->addJob([=] { ParticleRenderStream(&prsParams[i]); });
610608
}
611609

612610
ttapi.wait();

src/xrParticles/particle_actions_collection.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ struct TES_PARAMS
16571657
float magnitude;
16581658
};
16591659

1660-
void PATurbulenceExecuteStream(LPVOID lpvParams)
1660+
void PATurbulenceExecuteStream(TES_PARAMS* pParams)
16611661
{
16621662
#ifdef _GPA_ENABLED
16631663
TAL_SCOPED_TASK_NAMED("PATurbulenceExecuteStream()");
@@ -1671,8 +1671,6 @@ void PATurbulenceExecuteStream(LPVOID lpvParams)
16711671
pVector vY;
16721672
pVector vZ;
16731673

1674-
TES_PARAMS* pParams = (TES_PARAMS*)lpvParams;
1675-
16761674
u32 p_from = pParams->p_from;
16771675
u32 p_to = pParams->p_to;
16781676
ParticleEffect* effect = pParams->effect;
@@ -1781,7 +1779,7 @@ void PATurbulence::Execute(ParticleEffect* effect, const float dt, float& tm_max
17811779
tesParams[i].frequency = frequency;
17821780
tesParams[i].octaves = octaves;
17831781
tesParams[i].magnitude = magnitude;
1784-
ttapi.threads[i]->addJob([=] { PATurbulenceExecuteStream((void*)&tesParams[i]); });
1782+
ttapi.threads[i]->addJob([=] { PATurbulenceExecuteStream(&tesParams[i]); });
17851783
}
17861784

17871785
ttapi.wait();

0 commit comments

Comments
 (0)