more strict type conversion in cpp

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-02-28 15:09:32 +03:00
parent 7999d10b9c
commit a2534ee4f8
2 changed files with 6 additions and 5 deletions

View File

@ -301,17 +301,17 @@ SSDT_TABLE *generate_pss_ssdt(UINTN Number)
j = i << 8; j = i << 8;
p_states[p_states_count].Frequency = (UINT32)(100 * i); p_states[p_states_count].Frequency = (UINT32)(100 * i);
} else { } else {
p_states[p_states_count].Frequency = (UINT32)(DivU64x32(MultU64x32(gCPUStructure.FSBFrequency, i), Mega)); p_states[p_states_count].Frequency = (UINT32)(DivU64x32(MultU64x32(gCPUStructure.FSBFrequency, (UINT32)i), Mega));
} }
p_states[p_states_count].Control.Control = (UINT16)j; p_states[p_states_count].Control.Control = (UINT16)j;
p_states[p_states_count].CID = j; p_states[p_states_count].CID = (UINT32)j;
if (!p_states_count && gSettings.DoubleFirstState) { if (!p_states_count && gSettings.DoubleFirstState) {
//double first state //double first state
p_states_count++; p_states_count++;
p_states[p_states_count].Control.Control = (UINT16)j; p_states[p_states_count].Control.Control = (UINT16)j;
p_states[p_states_count].CID = j; p_states[p_states_count].CID = (UINT32)j;
p_states[p_states_count].Frequency = (UINT32)(DivU64x32(MultU64x32(gCPUStructure.FSBFrequency, i), Mega)) - 1; p_states[p_states_count].Frequency = (UINT32)(DivU64x32(MultU64x32(gCPUStructure.FSBFrequency, (UINT32)i), Mega)) - 1;
} }
p_states_count++; p_states_count++;
} }

View File

@ -1054,7 +1054,8 @@ unsigned compress(XArray<unsigned char>& out, const XArray<unsigned char>& in,
#endif /* LODEPNG_COMPILE_ZLIB */ #endif /* LODEPNG_COMPILE_ZLIB */
} /* namespace lodepng */ } /* namespace lodepng */
#endif /*LODEPNG_COMPILE_CPP*/ #endif /*LODEPNG_COMPILE_CPP*/
unsigned eglodepng_encode(unsigned char** out, size_t* outsize, const unsigned char* image, size_t w, size_t h);
unsigned eglodepng_decode(unsigned char** out, size_t* w, size_t* h, const unsigned char* in, size_t insize);
/* /*
TODO: TODO:
[.] test if there are no memory leaks or security exploits - done a lot but needs to be checked often [.] test if there are no memory leaks or security exploits - done a lot but needs to be checked often