aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--common/win_main_utf8.h4
-rw-r--r--utils/makehrtf.cpp (renamed from utils/makehrtf.c)12
3 files changed, 9 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b2be332..f0161048 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1514,7 +1514,7 @@ IF(ALSOFT_UTILS)
TARGET_COMPILE_OPTIONS(openal-info PRIVATE ${C_FLAGS})
TARGET_LINK_LIBRARIES(openal-info PRIVATE ${LINKER_FLAGS} OpenAL)
- SET(MAKEHRTF_SRCS utils/makehrtf.c)
+ SET(MAKEHRTF_SRCS utils/makehrtf.cpp)
IF(NOT HAVE_GETOPT)
SET(MAKEHRTF_SRCS ${MAKEHRTF_SRCS} utils/getopt.c utils/getopt.h)
ENDIF()
diff --git a/common/win_main_utf8.h b/common/win_main_utf8.h
index faddc257..242d3b8a 100644
--- a/common/win_main_utf8.h
+++ b/common/win_main_utf8.h
@@ -30,7 +30,7 @@ static FILE *my_fopen(const char *fname, const char *mode)
return NULL;
}
- wname = calloc(sizeof(WCHAR), namelen+modelen);
+ wname = (WCHAR*)calloc(sizeof(WCHAR), namelen+modelen);
wmode = wname + namelen;
MultiByteToWideChar(CP_UTF8, 0, fname, -1, wname, namelen);
MultiByteToWideChar(CP_UTF8, 0, mode, -1, wmode, modelen);
@@ -73,7 +73,7 @@ static void GetUnicodeArgs(int *argc, char ***argv)
total += WideCharToMultiByte(CP_UTF8, 0, args[i], -1, NULL, 0, NULL, NULL);
atexit(cleanup_arglist);
- arglist = *argv = calloc(1, total);
+ arglist = *argv = (char**)calloc(1, total);
(*argv)[0] = (char*)(*argv + nargs);
for(i = 0;i < nargs-1;i++)
{
diff --git a/utils/makehrtf.c b/utils/makehrtf.cpp
index eb174c8a..f8844239 100644
--- a/utils/makehrtf.c
+++ b/utils/makehrtf.cpp
@@ -965,7 +965,7 @@ static double *CreateDoubles(size_t n)
{
double *a;
- a = calloc(n?n:1, sizeof(*a));
+ a = static_cast<double*>(calloc(n?n:1, sizeof(*a)));
if(a == NULL)
{
fprintf(stderr, "Error: Out of memory.\n");
@@ -979,7 +979,7 @@ static Complex *CreateComplexes(size_t n)
{
Complex *a;
- a = calloc(n?n:1, sizeof(*a));
+ a = static_cast<Complex*>(calloc(n?n:1, sizeof(*a)));
if(a == NULL)
{
fprintf(stderr, "Error: Out of memory.\n");
@@ -2545,13 +2545,13 @@ static int PrepareHrirData(const uint fdCount, const double distances[MAX_FD_COU
if(!fdCount || !evTotal || !azTotal)
return 0;
- hData->mFds = calloc(fdCount, sizeof(*hData->mFds));
+ hData->mFds = static_cast<HrirFdT*>(calloc(fdCount, sizeof(*hData->mFds)));
if(hData->mFds == NULL)
return 0;
- hData->mFds[0].mEvs = calloc(evTotal, sizeof(*hData->mFds[0].mEvs));
+ hData->mFds[0].mEvs = static_cast<HrirEvT*>(calloc(evTotal, sizeof(*hData->mFds[0].mEvs)));
if(hData->mFds[0].mEvs == NULL)
return 0;
- hData->mFds[0].mEvs[0].mAzs = calloc(azTotal, sizeof(*hData->mFds[0].mEvs[0].mAzs));
+ hData->mFds[0].mEvs[0].mAzs = static_cast<HrirAzT*>(calloc(azTotal, sizeof(*hData->mFds[0].mEvs[0].mAzs)));
if(hData->mFds[0].mEvs[0].mAzs == NULL)
return 0;
hData->mIrCount = azTotal;
@@ -2631,7 +2631,7 @@ static int ProcessMetrics(TokenReaderT *tr, const uint fftSize, const uint trunc
double distances[MAX_FD_COUNT];
uint fdCount = 0;
uint evCounts[MAX_FD_COUNT];
- uint *azCounts = calloc(MAX_FD_COUNT * MAX_EV_COUNT, sizeof(*azCounts));
+ uint *azCounts = static_cast<uint*>(calloc(MAX_FD_COUNT * MAX_EV_COUNT, sizeof(*azCounts)));
if(azCounts == NULL)
{