diff options
author | Volker RĂ¼melin <vr_qemu@t-online.de> | 2020-12-13 17:57:22 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2021-01-15 11:22:42 +0100 |
commit | e80be993b53f27000bb2f224e9540a7c7cf04fae (patch) | |
tree | aa55f8450a1e2355bdc47c0ad751bf277efc61e5 /ui/gtk.c | |
parent | 45240eed4f064576d589ea60ebadf3c11d7ab891 (diff) | |
download | qemu-e80be993b53f27000bb2f224e9540a7c7cf04fae.zip qemu-e80be993b53f27000bb2f224e9540a7c7cf04fae.tar.gz qemu-e80be993b53f27000bb2f224e9540a7c7cf04fae.tar.bz2 |
ui/gtk: don't try to redefine SI prefixes
Redefining SI prefixes is always wrong. 1s has per definition
1000ms. Remove the misnamed named constant and replace it with
a comment explaining the frequency to period conversion in two
simple steps. Now you can cancel out the unit mHz in the comment
with the implicit unit mHz in refresh_rate_millihz and see why
the implicit unit ms for update_interval remains.
Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de>
Message-Id: <20201213165724.13418-1-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/gtk.c')
-rw-r--r-- | ui/gtk.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -798,7 +798,8 @@ static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque) refresh_rate_millihz = gd_refresh_rate_millihz(vc->window ? vc->window : s->window); if (refresh_rate_millihz) { - vc->gfx.dcl.update_interval = MILLISEC_PER_SEC / refresh_rate_millihz; + /* T = 1 / f = 1 [s*Hz] / f = 1000*1000 [ms*mHz] / f */ + vc->gfx.dcl.update_interval = 1000 * 1000 / refresh_rate_millihz; } fbw = surface_width(vc->gfx.ds); |