Commit 425fa73e authored by Ben Boeckel's avatar Ben Boeckel Committed by Brad King

Add missing malloc return value casts

Clang 3.5.0 errors out on the implicit void* -> T* cast.

Change-Id: Ie0b0dd25a32e1a5692900d9f1035a423a056c413
parent d30c9b03
......@@ -44,7 +44,7 @@ wchar_t* kwsysEncoding_DupToWide(const char* str)
size_t length = kwsysEncoding_mbstowcs(NULL, str, 0) + 1;
if(length > 0)
{
ret = malloc((length)*sizeof(wchar_t));
ret = (wchar_t*)malloc((length)*sizeof(wchar_t));
ret[0] = 0;
kwsysEncoding_mbstowcs(ret, str, length);
}
......@@ -71,7 +71,7 @@ char* kwsysEncoding_DupToNarrow(const wchar_t* str)
size_t length = kwsysEncoding_wcstombs(0, str, 0) + 1;
if(length > 0)
{
ret = malloc(length);
ret = (char*)malloc(length);
ret[0] = 0;
kwsysEncoding_wcstombs(ret, str, length);
}
......
......@@ -547,7 +547,7 @@ int kwsysProcess_SetPipeFile(kwsysProcess* cp, int prPipe, const char* file)
}
if(file)
{
*pfile = malloc(strlen(file)+1);
*pfile = (char*)malloc(strlen(file)+1);
if(!*pfile)
{
return 0;
......@@ -1468,7 +1468,7 @@ static int kwsysProcessInitialize(kwsysProcess* cp)
cp->RealWorkingDirectoryLength = 4096;
#endif
cp->RealWorkingDirectory =
malloc((size_t)(cp->RealWorkingDirectoryLength));
(char*)malloc((size_t)(cp->RealWorkingDirectoryLength));
if(!cp->RealWorkingDirectory)
{
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment