Reformat code to fit in 80 columns. Jean, I cannot answer your
[neverball] / ball / level.c
index 8d82e21..50e4572 100644 (file)
 void score_init_hs(struct score *s, int timer, int coins)
 {
     int i;
+
     strcpy(s->player[0], "Hard");
     strcpy(s->player[1], "Medium");
     strcpy(s->player[2], "Easy");
     strcpy(s->player[3], "");
+
     for (i = 0; i < NSCORE + 1; i++)
     {
         s->timer[i] = timer;
@@ -124,17 +126,14 @@ int level_load(const char *filename, struct level *level)
     memset(&sol,  0, sizeof (sol));
 
     /* Try to load the sol file */
-    if (!sol_load_only_file(&sol, filename))
+    if (!sol_load_only_head(&sol, filename))
     {
-        fprintf(stderr, _("Error while loading level file '%s': "), filename);
-        if (errno)
-           perror(NULL);
-        else
-           fprintf(stderr, _("Not a valid level file\n"));
+        fprintf(stderr,
+                _("Error while loading level file '%s': %s\n"), filename,
+                errno ? strerror(errno) : _("Not a valid level file"));
         return 0;
     }
 
-    /* Set filename */
     strcpy(level->file, filename);
 
     /* Init hs with default values */
@@ -164,7 +163,6 @@ int level_load(const char *filename, struct level *level)
     HOP(level->goal_score.timer, <=);
     HOP(level->coin_score.coins, >=);
 
-    /* Free the sol structure, no more needed */
     sol_free(&sol);
 
     return 1;
@@ -214,7 +212,7 @@ const char *mode_to_str(int m)
     case MODE_NORMAL:    return _("Normal");
     case MODE_PRACTICE:  return _("Practice");
     case MODE_SINGLE:    return _("Single");
-    default:             return "???";
+    default:             return _("Unknown");
     }
 }
 
@@ -229,7 +227,7 @@ const char *state_to_str(int m)
     case GAME_SPEC:
     case GAME_GOAL:    return _("Success");
     case GAME_FALL:    return _("Fall-out");
-    default:           return "???";
+    default:           return _("Unknown");
     }
 }