if ((xfc->_NET_SUPPORTED != None) && (xfc->_NET_SUPPORTING_WM_CHECK != None))
{
- Atom actual_type;
- int actual_format;
- unsigned long nitems, after;
+ Atom actual_type = 0;
+ int actual_format = 0;
+ unsigned long nitems = 0, after = 0;
unsigned char* data = NULL;
int status = XGetWindowProperty(xfc->display, RootWindowOfScreen(xfc->screen),
xfc->_NET_SUPPORTED, 0, 1024, False, XA_ATOM, &actual_type,
const size_t SrcSize = step * h;
const float maxDiff = 4.0f * ((bpp < 24) ? 2.0f : 1.0f);
UINT32 DstSize = SrcSize;
- BYTE* pSrcData = malloc(SrcSize);
- BYTE* pDstData = malloc(SrcSize);
- BYTE* tmp = malloc(SrcSize);
+ BYTE* pSrcData = calloc(1, SrcSize);
+ BYTE* pDstData = calloc(1, SrcSize);
+ BYTE* tmp = calloc(1, SrcSize);
if (!pSrcData || !pDstData || !tmp)
goto fail;
settings->AllowCacheWaitingList = TRUE;
settings->BitmapCacheV2NumCells = 5;
settings->BitmapCacheV2CellInfo =
- (BITMAP_CACHE_V2_CELL_INFO*)malloc(sizeof(BITMAP_CACHE_V2_CELL_INFO) * 6);
+ (BITMAP_CACHE_V2_CELL_INFO*)calloc(6, sizeof(BITMAP_CACHE_V2_CELL_INFO));
if (!settings->BitmapCacheV2CellInfo)
goto out_fail;
settings->RefreshRect = TRUE;
settings->SuppressOutput = TRUE;
settings->GlyphSupportLevel = GLYPH_SUPPORT_NONE;
- settings->GlyphCache = malloc(sizeof(GLYPH_CACHE_DEFINITION) * 10);
+ settings->GlyphCache = calloc(10, sizeof(GLYPH_CACHE_DEFINITION));
if (!settings->GlyphCache)
goto out_fail;
- settings->FragCache = malloc(sizeof(GLYPH_CACHE_DEFINITION));
+ settings->FragCache = calloc(1, sizeof(GLYPH_CACHE_DEFINITION));
if (!settings->FragCache)
goto out_fail;
settings->DeviceArraySize = 16;
settings->DeviceArray =
- (RDPDR_DEVICE**)calloc(1, sizeof(RDPDR_DEVICE*) * settings->DeviceArraySize);
+ (RDPDR_DEVICE**)calloc(settings->DeviceArraySize, sizeof(RDPDR_DEVICE*));
if (!settings->DeviceArray)
goto out_fail;
settings->StaticChannelArraySize = 16;
settings->StaticChannelArray =
- (ADDIN_ARGV**)calloc(1, sizeof(ADDIN_ARGV*) * settings->StaticChannelArraySize);
+ (ADDIN_ARGV**)calloc(settings->StaticChannelArraySize, sizeof(ADDIN_ARGV*));
if (!settings->StaticChannelArray)
goto out_fail;
settings->DynamicChannelArraySize = 16;
settings->DynamicChannelArray =
- (ADDIN_ARGV**)calloc(1, sizeof(ADDIN_ARGV*) * settings->DynamicChannelArraySize);
+ (ADDIN_ARGV**)calloc(settings->DynamicChannelArraySize, sizeof(ADDIN_ARGV*));
if (!settings->DynamicChannelArray)
goto out_fail;
static BOOL test_alphaComp_func(void)
{
pstatus_t status;
- BYTE ALIGN(src1[SRC1_WIDTH * SRC1_HEIGHT * 4]);
- BYTE ALIGN(src2[SRC2_WIDTH * SRC2_HEIGHT * 4]);
- BYTE ALIGN(dst1[DST_WIDTH * DST_HEIGHT * 4]);
+ BYTE ALIGN(src1[SRC1_WIDTH * SRC1_HEIGHT * 4]) = { 0 };
+ BYTE ALIGN(src2[SRC2_WIDTH * SRC2_HEIGHT * 4]) = { 0 };
+ BYTE ALIGN(dst1[DST_WIDTH * DST_HEIGHT * 4]) = { 0 };
UINT32* ptr;
UINT32 i;
winpr_RAND((BYTE*)src1, sizeof(src1));
static int test_alphaComp_speed(void)
{
- BYTE ALIGN(src1[SRC1_WIDTH * SRC1_HEIGHT]);
- BYTE ALIGN(src2[SRC2_WIDTH * SRC2_HEIGHT]);
- BYTE ALIGN(dst1[DST_WIDTH * DST_HEIGHT]);
+ BYTE ALIGN(src1[SRC1_WIDTH * SRC1_HEIGHT]) = { 0 };
+ BYTE ALIGN(src2[SRC2_WIDTH * SRC2_HEIGHT]) = { 0 };
+ BYTE ALIGN(dst1[DST_WIDTH * DST_HEIGHT]) = { 0 };
char testStr[256];
UINT32* ptr;
UINT32 i;
int TestPrimitivesAlphaComp(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
+
prim_test_setup(FALSE);
if (!test_alphaComp_func())
static BOOL test_and_32u_func(void)
{
- UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]), ALIGN(dst[FUNC_TEST_SIZE + 3]);
+ UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]) = { 0 };
+ UINT32 ALIGN(dst[FUNC_TEST_SIZE + 3]) = { 0 };
winpr_RAND((BYTE*)src, sizeof(src));
/* ------------------------------------------------------------------------- */
static BOOL test_and_32u_speed(void)
{
- UINT32 ALIGN(src[MAX_TEST_SIZE + 3]), ALIGN(dst[MAX_TEST_SIZE + 3]);
+ UINT32 ALIGN(src[MAX_TEST_SIZE + 3]) = { 0 };
+ UINT32 ALIGN(dst[MAX_TEST_SIZE + 3]) = { 0 };
winpr_RAND((BYTE*)src, sizeof(src));
static BOOL test_or_32u_func(void)
{
pstatus_t status;
- UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]), ALIGN(dst[FUNC_TEST_SIZE + 3]);
+ UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]) = { 0 };
+ UINT32 ALIGN(dst[FUNC_TEST_SIZE + 3]) = { 0 };
winpr_RAND((BYTE*)src, sizeof(src));
/* ------------------------------------------------------------------------- */
static BOOL test_or_32u_speed(void)
{
- UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]), ALIGN(dst[FUNC_TEST_SIZE + 3]);
+ UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]) = { 0 };
+ UINT32 ALIGN(dst[FUNC_TEST_SIZE + 3]) = { 0 };
char testStr[256];
testStr[0] = '\0';
winpr_RAND((BYTE*)src, sizeof(src));
int TestPrimitivesAndOr(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
+
prim_test_setup(FALSE);
if (!test_and_32u_func())
PROFILER_DEFINE(optProf)
PROFILER_CREATE(genericProf, "RGBToRGB_16s8u_P3AC4R-GENERIC")
PROFILER_CREATE(optProf, "RGBToRGB_16s8u_P3AC4R-OPTIMIZED")
- r = _aligned_malloc(rgbStride * roi.height, 16);
- g = _aligned_malloc(rgbStride * roi.height, 16);
- b = _aligned_malloc(rgbStride * roi.height, 16);
- out1 = _aligned_malloc(dstStride * roi.height, 16);
- out2 = _aligned_malloc(dstStride * roi.height, 16);
+ r = _aligned_recalloc(NULL, 1, rgbStride * roi.height, 16);
+ g = _aligned_recalloc(NULL, 1, rgbStride * roi.height, 16);
+ b = _aligned_recalloc(NULL, 1, rgbStride * roi.height, 16);
+ out1 = _aligned_recalloc(NULL, 1, dstStride * roi.height, 16);
+ out2 = _aligned_recalloc(NULL, 1, dstStride * roi.height, 16);
if (!r || !g || !b || !out1 || !out2)
goto fail;
static BOOL test_copy8u_func(void)
{
primitives_t* prims = primitives_get();
- BYTE ALIGN(data[COPY_TESTSIZE + 15]);
+ BYTE ALIGN(data[COPY_TESTSIZE + 15]) = { 0 };
int i, soff;
- BYTE ALIGN(dest[COPY_TESTSIZE + 15]);
+ BYTE ALIGN(dest[COPY_TESTSIZE + 15]) = { 0 };
winpr_RAND(data, sizeof(data));
for (soff = 0; soff < 16; ++soff)
static BOOL test_sign16s_func(void)
{
pstatus_t status;
- INT16 ALIGN(src[TEST_BUFFER_SIZE + 16]);
- INT16 ALIGN(d1[TEST_BUFFER_SIZE + 16]);
- INT16 ALIGN(d2[TEST_BUFFER_SIZE + 16]);
+ INT16 ALIGN(src[TEST_BUFFER_SIZE + 16]) = { 0 };
+ INT16 ALIGN(d1[TEST_BUFFER_SIZE + 16]) = { 0 };
+ INT16 ALIGN(d2[TEST_BUFFER_SIZE + 16]) = { 0 };
winpr_RAND((BYTE*)src, sizeof(src));
memset(d1, 0, sizeof(d1));
memset(d2, 0, sizeof(d2));
static int test_sign16s_speed(void)
{
- INT16 ALIGN(src[MAX_TEST_SIZE + 3]), ALIGN(dst[MAX_TEST_SIZE + 3]);
+ INT16 ALIGN(src[MAX_TEST_SIZE + 3]) = { 0 };
+ INT16 ALIGN(dst[MAX_TEST_SIZE + 3]) = { 0 };
winpr_RAND((BYTE*)src, sizeof(src));
if (!speed_test("sign16s", "aligned", g_Iterations, (speed_test_fkt)generic->sign_16s,
int TestPrimitivesSign(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
+
prim_test_setup(FALSE);
if (!test_sign16s_func())
PIXEL_FORMAT_RGBX32, PIXEL_FORMAT_BGRA32, PIXEL_FORMAT_BGRX32 };
PROFILER_DEFINE(genericProf)
PROFILER_DEFINE(optProf)
- in = _aligned_malloc(size, 16);
- out_c = _aligned_malloc(size, 16);
- out_sse = _aligned_malloc(size, 16);
+ in = _aligned_recalloc(NULL, 1, size, 16);
+ out_c = _aligned_recalloc(NULL, 1, size, 16);
+ out_sse = _aligned_recalloc(NULL, 1, size, 16);
if (!in || !out_c || !out_sse)
goto fail;
int TestPrimitivesYCoCg(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
prim_test_setup(FALSE);
/* Random resolution tests */
BYTE* pCipherText;
size_t cbOut, cbFinal;
WINPR_CIPHER_CTX* enc = NULL;
- BYTE randomKey[256];
+ BYTE randomKey[256] = { 0 };
WINPR_PROTECTED_MEMORY_BLOCK* pMemBlock;
if (dwFlags != CRYPTPROTECTMEMORY_SAME_PROCESS)
SecureZeroMemory(randomKey, sizeof(randomKey));
cbOut = pMemBlock->cbData + 16 - 1;
- pCipherText = (BYTE*)malloc(cbOut);
+ pCipherText = (BYTE*)calloc(1, cbOut);
if (!pCipherText)
goto out;
{
Reg* reg;
RegKey* pKey;
-
reg = RegGetInstance();
if (!reg)
{
LONG lStatus;
LPSTR pReader;
- SCARDCONTEXT hSC;
+ SCARDCONTEXT hSC = 0;
LPSTR mszReaders = NULL;
DWORD cchReaders = SCARD_AUTOALLOCATE;
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
+
lStatus = SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &hSC);
if (lStatus != SCARD_S_SUCCESS)
{
char* dot;
size_t length;
- char hostname[256];
+ char hostname[256] = { 0 };
if (!lpnSize)
{
BOOL GetComputerNameExA(COMPUTER_NAME_FORMAT NameType, LPSTR lpBuffer, LPDWORD lpnSize)
{
size_t length;
- char hostname[256];
+ char hostname[256] = { 0 };
if (!lpnSize)
{