Skip to content

Commit

Permalink
Merge pull request #238 from rjpontefract/rp/speed_sorting
Browse files Browse the repository at this point in the history
Fix the sorting of speeds loaded from the configuration file
  • Loading branch information
SteveFosdick authored Oct 16, 2024
2 parents 7d4ad6c + 508600f commit 3925976
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/b-em.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#include "compat_wrappers.h"

Expand Down
3 changes: 2 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ static double main_calc_timer(int speed)

static int main_speed_cmp(const void *va, const void *vb)
{
return ((const emu_speed_t *)va)->multiplier - ((const emu_speed_t *)vb)->multiplier;
double res = ((const emu_speed_t *)va)->multiplier - ((const emu_speed_t *)vb)->multiplier;
return (int)round(res);
}

static void main_load_speeds(void)
Expand Down

0 comments on commit 3925976

Please sign in to comment.