summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-09-02 16:01:00 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-09-26 09:51:34 +0300
commit84d3338b761ad6c58cc0f06291ece6ba6a3e962c (patch)
treebebd94bfdc8320fcb901e686379f4fdd5fde6626 /utils
parent8e9eecb32f0812b58670ebb8c135a0914c170569 (diff)
kmatest: split regex strings to multiple lines
Split regex strings to multiple lines to make them slightly more readable. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/kmstest.cpp12
1 files changed, 9 insertions, 3 deletions
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<DumbFramebuffer*> 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))