extended function to set score info structure to default values
authorHolger Schemel <info@artsoft.org>
Sat, 24 Apr 2021 23:35:47 +0000 (01:35 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 1 May 2021 13:38:31 +0000 (15:38 +0200)
src/files.c

index 92bc92d53ecde4a2f053c9f1743d3fa1269fa158..ab6a595876440efa5e72d350130cf8ced12b4b30 100644 (file)
@@ -8424,21 +8424,25 @@ void DumpTape(struct TapeInfo *tape)
 // score file functions
 // ============================================================================
 
-static void setScoreInfoToDefaults(void)
+static void setScoreInfoToDefaultsExt(struct ScoreInfo *scores)
 {
   int i;
 
   for (i = 0; i < MAX_SCORE_ENTRIES; i++)
   {
-    strcpy(scores.entry[i].tape_basename, UNDEFINED_FILENAME);
-    strcpy(scores.entry[i].name, EMPTY_PLAYER_NAME);
-    scores.entry[i].score = 0;
-    scores.entry[i].time = 0;
+    strcpy(scores->entry[i].tape_basename, UNDEFINED_FILENAME);
+    strcpy(scores->entry[i].name, EMPTY_PLAYER_NAME);
+    scores->entry[i].score = 0;
+    scores->entry[i].time = 0;
   }
 
-  scores.num_entries = 0;
-  scores.last_added = -1;
+  scores->num_entries = 0;
+  scores->last_added = -1;
+}
 
+static void setScoreInfoToDefaults(void)
+{
+  setScoreInfoToDefaultsExt(&scores);
 }
 
 static void LoadScore_OLD(int nr)