Skip to content

Commit

Permalink
printLastError & warnPrintf take a TCHAR *, not a char *
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-cellier-aka-nice committed Dec 27, 2018
1 parent 9e82899 commit 4e947da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion platforms/win32/plugins/SoundPlugin/sqWin32Sound.c
Expand Up @@ -408,7 +408,7 @@ snd_StartRecording(sqInt samplesPerSec, sqInt stereo, sqInt semaIndex) {
recSemaphore = semaIndex;
hRecThread = CreateThread(NULL, 0, recCallback, NULL, 0, &threadID);
if(hRecThread == 0) {
printLastError("snd_StartRec: CreateThread failed");
printLastError(TEXT("snd_StartRec: CreateThread failed"));
snd_StopRecording();
return 0;
}
Expand Down
14 changes: 7 additions & 7 deletions platforms/win32/vm/sqWin32Alloc.c
Expand Up @@ -99,19 +99,19 @@ void *sqAllocateMemory(usqInt minHeapSize, usqInt desiredHeapSize)
int sqGrowMemoryBy(int oldLimit, int delta) {
/* round delta UP to page size */
if(fShowAllocations) {
warnPrintf("Growing memory by %d...", delta);
warnPrintf(TEXT("Growing memory by %d..."), delta);
}
delta = (delta + pageSize) & pageMask;
if(!VirtualAlloc(pageLimit, delta, MEM_COMMIT, PAGE_READWRITE)) {
if(fShowAllocations) {
warnPrintf("failed\n");
warnPrintf(TEXT("failed\n"));
}
/* failed to grow */
return oldLimit;
}
/* otherwise, expand pageLimit and return new top limit */
if(fShowAllocations) {
warnPrintf("okay\n");
warnPrintf(TEXT("okay\n"));
}
pageLimit += delta;
usedMemory += delta;
Expand All @@ -124,26 +124,26 @@ int sqGrowMemoryBy(int oldLimit, int delta) {
int sqShrinkMemoryBy(int oldLimit, int delta) {
/* round delta DOWN to page size */
if(fShowAllocations) {
warnPrintf("Shrinking by %d...",delta);
warnPrintf(TEXT("Shrinking by %d..."),delta);
}
#ifdef DO_NOT_SHRINK
{
/* Experimental - do not unmap memory and avoid OGL crashes */
if(fShowAllocations) warnPrintf(" - ignored\n");
if(fShowAllocations) warnPrintf(TEXT(" - ignored\n"));
return oldLimit;
}
#endif
delta &= pageMask;
if(!VirtualFree(pageLimit-delta, delta, MEM_DECOMMIT)) {
if(fShowAllocations) {
warnPrintf("failed\n");
warnPrintf(TEXT("failed\n"));
}
/* failed to shrink */
return oldLimit;
}
/* otherwise, shrink pageLimit and return new top limit */
if(fShowAllocations) {
warnPrintf("okay\n");
warnPrintf(TEXT("okay\n"));
}
pageLimit -= delta;
usedMemory -= delta;
Expand Down
4 changes: 2 additions & 2 deletions platforms/win32/vm/sqWin32PluginSupport.c
Expand Up @@ -342,7 +342,7 @@ void pluginGetURLRequest(int id, void* urlIndex, int urlSize,
DWORD dwWritten;

if(!hBrowserPipe) {
warnPrintf("Cannot submit URL request -- there is no connection to a browser\n");
warnPrintf(TEXT("Cannot submit URL request -- there is no connection to a browser\n"));
return;
}

Expand Down Expand Up @@ -376,7 +376,7 @@ void pluginPostURLRequest(int id, void* urlIndex, int urlSize,
DWORD dwWritten;

if(!hBrowserPipe) {
warnPrintf("Cannot submit URL post request -- there is no connection to a browser\n");
warnPrintf(TEXT("Cannot submit URL post request -- there is no connection to a browser\n"));
return;
}

Expand Down

0 comments on commit 4e947da

Please sign in to comment.