From 40bc9d1095228ab1377625be3479491263d696d7 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 24 Sep 2019 12:52:14 +0300 Subject: videomode to_string improvements Add to_string_short() and to_string_long() to videomode (using the fmt library) for easy printing of videomodes. Signed-off-by: Tomi Valkeinen --- utils/kmsprint.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'utils/kmsprint.cpp') diff --git a/utils/kmsprint.cpp b/utils/kmsprint.cpp index 116fead..01913fb 100644 --- a/utils/kmsprint.cpp +++ b/utils/kmsprint.cpp @@ -34,16 +34,7 @@ static string format_mode(const Videomode& m, unsigned idx) m.flags, m.type); } else { - string h = sformat("%u/%u/%u/%u", m.hdisplay, m.hfp(), m.hsw(), m.hbp()); - string v = sformat("%u/%u/%u/%u", m.vdisplay, m.vfp(), m.vsw(), m.vbp()); - - str += sformat("%-12s %7.3f %-16s %-16s %2u (%.2f) %#10x %#6x", - m.name.c_str(), - m.clock / 1000.0, - h.c_str(), v.c_str(), - m.vrefresh, m.calculated_vrefresh(), - m.flags, - m.type); + str += m.to_string_long_padded(); } return str; -- cgit v1.2.3