aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorTomi Valkeinen2016-09-02 08:01:00 -0500
committerTomi Valkeinen2016-09-26 01:51:34 -0500
commit84d3338b761ad6c58cc0f06291ece6ba6a3e962c (patch)
treebebd94bfdc8320fcb901e686379f4fdd5fde6626 /utils
parent8e9eecb32f0812b58670ebb8c135a0914c170569 (diff)
downloadexternal-kmsxx-84d3338b761ad6c58cc0f06291ece6ba6a3e962c.tar.gz
external-kmsxx-84d3338b761ad6c58cc0f06291ece6ba6a3e962c.tar.xz
external-kmsxx-84d3338b761ad6c58cc0f06291ece6ba6a3e962c.zip
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)
102static void parse_crtc(Card& card, const string& crtc_str, OutputInfo& output) 102static void parse_crtc(Card& card, const string& crtc_str, OutputInfo& output)
103{ 103{
104 // @12:1920x1200@60 104 // @12:1920x1200@60
105 const regex mode_re("(?:(@?)(\\d+):)?(?:(\\d+)x(\\d+)(i)?)(?:@([\\d\\.]+))?"); 105 const regex mode_re("(?:(@?)(\\d+):)?" // @12:
106 "(?:(\\d+)x(\\d+)(i)?)" // 1920x1200i
107 "(?:@([\\d\\.]+))?"); // @60
106 108
107 smatch sm; 109 smatch sm;
108 if (!regex_match(crtc_str, sm, mode_re)) 110 if (!regex_match(crtc_str, sm, mode_re))
@@ -165,7 +167,9 @@ static void parse_crtc(Card& card, const string& crtc_str, OutputInfo& output)
165static void parse_plane(Card& card, const string& plane_str, const OutputInfo& output, PlaneInfo& pinfo) 167static void parse_plane(Card& card, const string& plane_str, const OutputInfo& output, PlaneInfo& pinfo)
166{ 168{
167 // 3:400,400-400x400 169 // 3:400,400-400x400
168 const regex plane_re("(?:(@?)(\\d+):)?(?:(\\d+),(\\d+)-)?(\\d+)x(\\d+)"); 170 const regex plane_re("(?:(@?)(\\d+):)?" // 3:
171 "(?:(\\d+),(\\d+)-)?" // 400,400-
172 "(\\d+)x(\\d+)"); // 400x400
169 173
170 smatch sm; 174 smatch sm;
171 if (!regex_match(plane_str, sm, plane_re)) 175 if (!regex_match(plane_str, sm, plane_re))
@@ -239,7 +243,9 @@ static vector<DumbFramebuffer*> parse_fb(Card& card, const string& fb_str, unsig
239 if (!fb_str.empty()) { 243 if (!fb_str.empty()) {
240 // XXX the regexp is not quite correct 244 // XXX the regexp is not quite correct
241 // 400x400-NV12 245 // 400x400-NV12
242 const regex fb_re("(?:(\\d+)x(\\d+))?(?:-)?(\\w\\w\\w\\w)?"); 246 const regex fb_re("(?:(\\d+)x(\\d+))?" // 400x400
247 "(?:-)?" // -
248 "(\\w\\w\\w\\w)?"); // NV12
243 249
244 smatch sm; 250 smatch sm;
245 if (!regex_match(fb_str, sm, fb_re)) 251 if (!regex_match(fb_str, sm, fb_re))