From: cloudwalk Date: Mon, 8 Jun 2020 14:46:10 +0000 (+0000) Subject: Add a few explicit typecasts to help fix C++ compilation X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=90317205c7a5050e5a3f2fb80289b53eb7253e87;p=xonotic%2Fdarkplaces.git Add a few explicit typecasts to help fix C++ compilation git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12649 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/prvm_edict.c b/prvm_edict.c index 9e0f36f0..90cc8d8f 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -3191,7 +3191,7 @@ int PRVM_AllocString(prvm_prog_t *prog, size_t bufferlength, char **pointer) for (i = prog->firstfreeknownstring;i < prog->numknownstrings;i++) if (!prog->knownstrings[i]) break; - s = PRVM_Alloc(bufferlength); + s = (char *)PRVM_Alloc(bufferlength); PRVM_NewKnownString(prog, i, KNOWNSTRINGFLAG_GCMARK, s); if(prog->leaktest_active) prog->knownstrings_origin[i] = PRVM_AllocationOrigin(prog); diff --git a/taskqueue.c b/taskqueue.c index 1ad3bb07..ccde49c5 100644 --- a/taskqueue.c +++ b/taskqueue.c @@ -114,7 +114,7 @@ void TaskQueue_Enqueue(int numtasks, taskqueue_task_t *tasks) unsigned int newsize = (taskqueue_state.queue_size + numtasks) * 2; if (newsize < 1024) newsize = 1024; - taskqueue_state.queue_data = Mem_Realloc(zonemempool, taskqueue_state.queue_data, sizeof(*taskqueue_state.queue_data) * newsize); + taskqueue_state.queue_data = (taskqueue_task_t **)Mem_Realloc(zonemempool, taskqueue_state.queue_data, sizeof(*taskqueue_state.queue_data) * newsize); taskqueue_state.queue_size = newsize; } for (i = 0; i < numtasks; i++) @@ -293,7 +293,7 @@ void TaskQueue_Setup(taskqueue_task_t *t, taskqueue_task_t *preceding, void(*fun void TaskQueue_Task_CheckTasksDone(taskqueue_task_t *t) { size_t numtasks = t->i[0]; - taskqueue_task_t *tasks = t->p[0]; + taskqueue_task_t *tasks = (taskqueue_task_t *)t->p[0]; while (numtasks > 0) { // check the last task first as it's usually going to be the last to finish, so we do the least work by checking it first diff --git a/vid_sdl.c b/vid_sdl.c index 74b7ce1e..7a7e13cd 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -699,10 +699,10 @@ void VID_BuildJoyState(vid_joystate_t *joystate) { for (j = 0; j <= SDL_CONTROLLER_AXIS_MAX; ++j) { - joystate->axis[j] = SDL_GameControllerGetAxis(vid_sdlgamecontroller, j) * (1.0f / 32767.0f); + joystate->axis[j] = SDL_GameControllerGetAxis(vid_sdlgamecontroller, (SDL_GameControllerAxis)j) * (1.0f / 32767.0f); } for (j = 0; j < SDL_CONTROLLER_BUTTON_MAX; ++j) - joystate->button[j] = SDL_GameControllerGetButton(vid_sdlgamecontroller, j); + joystate->button[j] = SDL_GameControllerGetButton(vid_sdlgamecontroller, (SDL_GameControllerButton)j); // emulate joy buttons for trigger "axes" joystate->button[SDL_CONTROLLER_BUTTON_MAX] = VID_JoyState_GetAxis(joystate, SDL_CONTROLLER_AXIS_TRIGGERLEFT, 1, joy_sdl2_trigger_deadzone.value) > 0.0f; joystate->button[SDL_CONTROLLER_BUTTON_MAX+1] = VID_JoyState_GetAxis(joystate, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, 1, joy_sdl2_trigger_deadzone.value) > 0.0f;