Replace SDL_strdup() by strdup()

The functions SDL_malloc(), SDL_free() and SDL_strdup() were used only
because strdup() was not available everywhere.

Now that it is available, use the native version of these functions.
This commit is contained in:
Romain Vimont
2021-01-24 15:14:53 +01:00
parent c0dde0fade
commit 30e619d37f
16 changed files with 74 additions and 54 deletions

View File

@@ -11,7 +11,7 @@
static void
file_handler_request_destroy(struct file_handler_request *req) {
SDL_free(req->file);
free(req->file);
}
bool
@@ -30,7 +30,7 @@ file_handler_init(struct file_handler *file_handler, const char *serial,
}
if (serial) {
file_handler->serial = SDL_strdup(serial);
file_handler->serial = strdup(serial);
if (!file_handler->serial) {
LOGW("Could not strdup serial");
SDL_DestroyCond(file_handler->event_cond);
@@ -56,7 +56,7 @@ void
file_handler_destroy(struct file_handler *file_handler) {
SDL_DestroyCond(file_handler->event_cond);
SDL_DestroyMutex(file_handler->mutex);
SDL_free(file_handler->serial);
free(file_handler->serial);
struct file_handler_request req;
while (cbuf_take(&file_handler->queue, &req)) {