Browse Source

Main : correction définitive des warning sur les time_t en les promettant en long int (64bit) pour les systèmes encore sujets au bug de 2038

master
Nikos 8 years ago
parent
commit
403048e802
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      main.c

+ 3
- 3
main.c View File

@ -324,11 +324,11 @@ void save(const char *filename, const struct player_t *player_state, const int n
fprintf(file, "=== %s (%d partie%s - %d joueurs) ===\n", buffer, nb_game, (nb_game>1)?"s":"", nb_player);
for(i=0; i < nb_game_end ; i++) {
if(duration[i] > 3600)
fprintf(file, "partie %d (%ld heure%s %ld minute%s %ld seconde%s) : ", i+1, duration[i]/3600, ((duration[i]/3600)>1?"s":""), (duration[i]%3600)/60, ((((duration[i]%3600)/60)>1)?"s":""), (duration[i]%3600)%60, (((duration[i]%3600)%60)>1?"s":""));
fprintf(file, "partie %d (%ld heure%s %ld minute%s %ld seconde%s) : ", i+1, (long int)(duration[i]/3600), ((duration[i]/3600)>1?"s":""), (long int)((duration[i]%3600)/60), ((((duration[i]%3600)/60)>1)?"s":""), (long int)((duration[i]%3600)%60), (((duration[i]%3600)%60)>1?"s":""));
else if(duration[i] > 60)
fprintf(file, "partie %d (%ld minute%s %ld seconde%s) : ", i+1, duration[i]/60, (((duration[i]/60)>1)?"s":""), duration[i]%60, ((duration[i]%60)>1?"s":""));
fprintf(file, "partie %d (%ld minute%s %ld seconde%s) : ", i+1, (long int)(duration[i]/60), (((duration[i]/60)>1)?"s":""), (long int)(duration[i]%60), ((duration[i]%60)>1?"s":""));
else
fprintf(file, "partie %d (%ld second%s) : ", i+1, duration[i], ((duration[i]%60)>1?"s":""));
fprintf(file, "partie %d (%ld second%s) : ", i+1, (long int)(duration[i]), ((duration[i]%60)>1?"s":""));
if(winner[i] >= 0 && winner[i] < nb_player)
fprintf(file, "gagnée par le joueur %s (%s)\n", couleurs[winner[i]], player_state[winner[i]].name);
else


Loading…
Cancel
Save