From 84d3338b761ad6c58cc0f06291ece6ba6a3e962c Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 2 Sep 2016 16:01:00 +0300 Subject: kmatest: split regex strings to multiple lines Split regex strings to multiple lines to make them slightly more readable. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- utils/kmstest.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'utils') diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp index f4fd3d5..cc895e3 100644 --- a/utils/kmstest.cpp +++ b/utils/kmstest.cpp @@ -102,7 +102,9 @@ static void get_default_crtc(Card& card, OutputInfo& output) static void parse_crtc(Card& card, const string& crtc_str, OutputInfo& output) { // @12:1920x1200@60 - const regex mode_re("(?:(@?)(\\d+):)?(?:(\\d+)x(\\d+)(i)?)(?:@([\\d\\.]+))?"); + const regex mode_re("(?:(@?)(\\d+):)?" // @12: + "(?:(\\d+)x(\\d+)(i)?)" // 1920x1200i + "(?:@([\\d\\.]+))?"); // @60 smatch sm; if (!regex_match(crtc_str, sm, mode_re)) @@ -165,7 +167,9 @@ static void parse_crtc(Card& card, const string& crtc_str, OutputInfo& output) static void parse_plane(Card& card, const string& plane_str, const OutputInfo& output, PlaneInfo& pinfo) { // 3:400,400-400x400 - const regex plane_re("(?:(@?)(\\d+):)?(?:(\\d+),(\\d+)-)?(\\d+)x(\\d+)"); + const regex plane_re("(?:(@?)(\\d+):)?" // 3: + "(?:(\\d+),(\\d+)-)?" // 400,400- + "(\\d+)x(\\d+)"); // 400x400 smatch sm; if (!regex_match(plane_str, sm, plane_re)) @@ -239,7 +243,9 @@ static vector parse_fb(Card& card, const string& fb_str, unsig if (!fb_str.empty()) { // XXX the regexp is not quite correct // 400x400-NV12 - const regex fb_re("(?:(\\d+)x(\\d+))?(?:-)?(\\w\\w\\w\\w)?"); + const regex fb_re("(?:(\\d+)x(\\d+))?" // 400x400 + "(?:-)?" // - + "(\\w\\w\\w\\w)?"); // NV12 smatch sm; if (!regex_match(fb_str, sm, fb_re)) -- cgit v1.2.3