Added SDL_copyp to avoid size mismatch when copying values (thanks @1bsyl!)

Closes https://github.com/libsdl-org/SDL/pull/5811
This commit is contained in:
Sam Lantinga committed 2022-06-17 10:22:28 -07:00
1 parent b0e827fb65
commit adc6875870
18 files changed
+49 -44

No files matched your search

+1 -1
View File
@@ -261,7 +261,7 @@ SDL_CreateCond(void)
}
#endif
SDL_memcpy(&SDL_cond_impl_active, impl, sizeof(SDL_cond_impl_active));
SDL_copyp(&SDL_cond_impl_active, impl);
}
return SDL_cond_impl_active.Create();
}
+1 -1
View File
@@ -287,7 +287,7 @@ SDL_CreateMutex(void)
}
/* Copy instead of using pointer to save one level of indirection */
SDL_memcpy(&SDL_mutex_impl_active, impl, sizeof(SDL_mutex_impl_active));
SDL_copyp(&SDL_mutex_impl_active, impl);
}
return SDL_mutex_impl_active.Create();
}
+1 -1
View File
@@ -430,7 +430,7 @@ SDL_CreateSemaphore(Uint32 initial_value)
#endif
/* Copy instead of using pointer to save one level of indirection */
SDL_memcpy(&SDL_sem_impl_active, impl, sizeof(SDL_sem_impl_active));
SDL_copyp(&SDL_sem_impl_active, impl);
}
return SDL_sem_impl_active.Create(initial_value);
}