Skip to content

Commit

Permalink
os2: replace a few "not enough memory" SetError()s with SDL_OutOfMemo…
Browse files Browse the repository at this point in the history
…ry()
  • Loading branch information
sezero committed Oct 18, 2020
1 parent 43c472d commit d69027b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/SDL_config_os2.h
Expand Up @@ -122,7 +122,7 @@
#define SDL_VIDEO_DRIVER_OS2FS 1

/* Enable OpenGL support */
/* Nothing yet for OS/2. */
/* #undef SDL_VIDEO_OPENGL */ /* Nothing yet */

/* Enable assembly routines where available */
#define SDL_ASSEMBLY_ROUTINES 1
Expand Down
6 changes: 2 additions & 4 deletions src/audio/dart/SDL_dart.c
Expand Up @@ -185,7 +185,7 @@ int DART_OpenAudio(_THIS, SDL_AudioSpec *spec)
{ // Not enough memory!
// Close DART, and exit with error code!
mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
SDL_SetError("Not enough memory for audio buffer descriptors");
SDL_OutOfMemory();
return(-1);
}
// Now that we have the place for buffer list, we can ask DART for the
Expand Down Expand Up @@ -266,10 +266,9 @@ int DART_OpenAudio(_THIS, SDL_AudioSpec *spec)
}



void DART_ThreadInit(_THIS)
{
return;
/* nothing. */
}

/* This function waits until it is possible to write a full sound buffer */
Expand All @@ -289,7 +288,6 @@ void DART_WaitAudio(_THIS)
}
// If there is no empty buffer, wait for one to be empty!
DosWaitEventSem(_this->hidden->hevAudioBufferPlayed, 1000); // Wait max 1 sec!!! Important!
return;
}

void DART_PlayAudio(_THIS)
Expand Down
2 changes: 1 addition & 1 deletion src/thread/os2/SDL_systhread.c
Expand Up @@ -62,7 +62,7 @@ int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThre
pThreadStartParms pThreadParms = SDL_malloc(sizeof(tThreadStartParms));
if (!pThreadParms)
{
SDL_SetError("Not enough memory to create thread");
SDL_OutOfMemory();
return(-1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/video/os2fslib/SDL_os2fslib.c
Expand Up @@ -2850,7 +2850,7 @@ static int os2fslib_VideoInit(_THIS, SDL_PixelFormat *vformat)
#ifdef DEBUG_BUILD
printf("[os2fslib_VideoInit] : Yikes, not enough memory for new video buffer!\n"); fflush(stdout);
#endif
SDL_SetError("Not enough memory for new video buffer!\n");
SDL_OutOfMemory();
return -1;
}

Expand Down

0 comments on commit d69027b

Please sign in to comment.