]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Add a few explicit typecasts to help fix C++ compilation
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 8 Jun 2020 14:46:10 +0000 (14:46 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 8 Jun 2020 14:46:10 +0000 (14:46 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12649 d7cf8633-e32d-0410-b094-e92efae38249

prvm_edict.c
taskqueue.c
vid_sdl.c

index 9e0f36f0560761981dd67171279dca656172fd3e..90cc8d8f79e38badfc76e9769c8c430ed04179ea 100644 (file)
@@ -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);
index 1ad3bb079967814646c161a76c7d7ba68d12c286..ccde49c5b37978ce40a3d932c3e6dccf62faac94 100644 (file)
@@ -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
index 74b7ce1e64a82658d850b19513c4f512ea510f1e..7a7e13cdce4cc68c48b5e1226c1bf8e774a298a7 100644 (file)
--- 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;