From d671516e9c2818ad1a95a985e46d74f7529525d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Fri, 19 May 2023 22:56:18 +0300 Subject: [PATCH] Change chvideomode(1) to use "WIDTHxHEIGHTxBPP" consistently. Previously chvideomode(1) used "WIDTHxHEIGHTxBPP" on the command line while interactively it used "BPP x WIDTH x HEIGHT". Change everything to "WIDTHxHEIGHTxBPP". --- chvideomode/chvideomode.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/chvideomode/chvideomode.c b/chvideomode/chvideomode.c index 191c4ab9..e503ec77 100644 --- a/chvideomode/chvideomode.c +++ b/chvideomode/chvideomode.c @@ -405,10 +405,10 @@ retry_pick_mode: printf("\e[2K"); printf(" [%-*zu] ", num_modes_display_length, index); if ( modes[i].control & DISPMSG_CONTROL_VALID ) - printf("%u x %u x %u", - modes[i].fb_format, - modes[i].view_xres, - modes[i].view_yres); + printf("%ux%ux%u", + modes[i].view_xres, + modes[i].view_yres, + modes[i].fb_format); else if ( modes[i].control & DISPMSG_CONTROL_OTHER_RESOLUTIONS ) printf("(enter a custom resolution)"); else @@ -494,9 +494,9 @@ retry_pick_mode: uintmax_t req_height = yres; while ( argc - optind < 1 ) { - printf("Enter video mode [BPP x WIDTH x HEIGHT]: "); + printf("Enter video mode [WIDTHxHEIGHTxBPP]: "); fflush(stdout); - if ( scanf("%ju x %ju x %ju", &req_bpp, &req_width, &req_height) != 3 ) + if ( scanf("%jux%jux%ju", &req_width, &req_height, &req_bpp) != 3 ) { fgetc(stdin); fflush(stdin); @@ -515,10 +515,10 @@ retry_pick_mode: if ( !set_current_mode(mode) ) { mode_set_error = errno; - warn("Unable to set video mode %ju x %ju x %ju", - (uintmax_t) mode.fb_format, + warn("Unable to set video mode %jux%jux%ju", (uintmax_t) mode.view_xres, - (uintmax_t) mode.view_yres); + (uintmax_t) mode.view_yres, + (uintmax_t) mode.fb_format); goto retry_pick_mode; }