(s16_to_float) Silence aggressive-loop-optimization undefined

behavior because of potential signed integer overflow
This commit is contained in:
twinaphex 2020-07-23 06:35:30 +02:00
parent 06eeea3931
commit 98516280ad
2 changed files with 16 additions and 14 deletions

View File

@ -39,25 +39,28 @@ unsigned int read_system_buttons(void)
void exitspawn_kernel(const char *fileName, SceSize args, void *argp)
{
int k1;
struct SceKernelLoadExecVSHParam game_param;
thread_active = 0;
thread_active = 0;
memset(&game_param,0,sizeof(game_param));
game_param.size = sizeof(game_param);
game_param.args = args;
game_param.argp = argp;
game_param.key = "game";
game_param.size = sizeof(game_param);
game_param.args = args;
game_param.argp = argp;
game_param.key = "game";
game_param.vshmain_args_size = 0;
game_param.vshmain_args = NULL;
game_param.configfile = 0;
game_param.unk4 = 0;
game_param.unk5 = 0x10000;
game_param.vshmain_args = NULL;
game_param.configfile = 0;
game_param.unk4 = 0;
game_param.unk5 = 0x10000;
int k1 = pspSdkSetK1(0);
//sceKernelSuspendAllUserThreads();
int ret = sceKernelLoadExecVSHMs2(fileName, &game_param);
k1 = pspSdkSetK1(0);
#if 0
sceKernelSuspendAllUserThreads();
#endif
sceKernelLoadExecVSHMs2(fileName, &game_param);
pspSdkSetK1(k1);
}

View File

@ -50,7 +50,7 @@ void convert_s16_float_asm(float *out, const int16_t *in,
void convert_s16_to_float(float *out,
const int16_t *in, size_t samples, float gain)
{
size_t i = 0;
unsigned i = 0;
#if defined(__SSE2__)
float fgain = gain / UINT32_C(0x80000000);
@ -77,7 +77,6 @@ void convert_s16_to_float(float *out,
* optimize for the good path (very likely). */
if (((uintptr_t)out & 15) + ((uintptr_t)in & 15) == 0)
{
size_t i;
const vector float gain_vec = { gain, gain , gain, gain };
const vector float zero_vec = { 0.0f, 0.0f, 0.0f, 0.0f};