merged API functions
authorHolger Schemel <info@artsoft.org>
Fri, 24 Sep 2021 23:45:30 +0000 (01:45 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 24 Sep 2021 23:45:30 +0000 (01:45 +0200)
src/files.c
src/screens.c

index 668a697f288cc12b92473f749b035d6c217fb5e4..5459194ff9469db1cd3d7737258ca3b42ee2a420 100644 (file)
@@ -9171,7 +9171,7 @@ static void ApiGetScoreExt(struct HttpRequest *request,
   server_scores.updated = TRUE;
 }
 
-static void ApiGetScore(void *data_raw)
+static int ApiGetScoreThread(void *data_raw)
 {
   struct HttpRequest *request = checked_calloc(sizeof(struct HttpRequest));
   struct HttpResponse *response = checked_calloc(sizeof(struct HttpResponse));
@@ -9179,15 +9179,10 @@ static void ApiGetScore(void *data_raw)
   ApiGetScoreExt(request, response,
                 data_raw);
 
+  FreeThreadData_ApiGetScore(data_raw);
+
   checked_free(request);
   checked_free(response);
-}
-
-static int ApiGetScoreThread(void *data_raw)
-{
-  ApiGetScore(data_raw);
-
-  FreeThreadData_ApiGetScore(data_raw);
 
   return 0;
 }
@@ -9485,7 +9480,7 @@ static void ApiAddScoreExt(struct HttpRequest *request,
   server_scores.uploaded = TRUE;
 }
 
-static void ApiAddScore(void *data_raw)
+static int ApiAddScoreThread(void *data_raw)
 {
   struct HttpRequest *request = checked_calloc(sizeof(struct HttpRequest));
   struct HttpResponse *response = checked_calloc(sizeof(struct HttpResponse));
@@ -9493,15 +9488,10 @@ static void ApiAddScore(void *data_raw)
   ApiAddScoreExt(request, response,
                 data_raw);
 
+  FreeThreadData_ApiAddScore(data_raw);
+
   checked_free(request);
   checked_free(response);
-}
-
-static int ApiAddScoreThread(void *data_raw)
-{
-  ApiAddScore(data_raw);
-
-  FreeThreadData_ApiAddScore(data_raw);
 
   return 0;
 }
index 3f64b882b8f33f328c07a385b372a86f33502438..bb7a2b5b3399f9598d48763873fa065488723fc4 100644 (file)
@@ -4120,22 +4120,17 @@ static void ApiRenamePlayerExt(struct HttpRequest *request,
   }
 }
 
-static void ApiRenamePlayer(void *data_raw)
+static int ApiRenamePlayerThread(void *data_raw)
 {
   struct HttpRequest *request = checked_calloc(sizeof(struct HttpRequest));
   struct HttpResponse *response = checked_calloc(sizeof(struct HttpResponse));
 
   ApiRenamePlayerExt(request, response, data_raw);
 
+  FreeThreadData_ApiRenamePlayer(data_raw);
+
   checked_free(request);
   checked_free(response);
-}
-
-static int ApiRenamePlayerThread(void *data_raw)
-{
-  ApiRenamePlayer(data_raw);
-
-  FreeThreadData_ApiRenamePlayer(data_raw);
 
   return 0;
 }