From 22abc821b1974c38bd4ce375ddab5314c42fc0ed Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Fri, 20 Dec 2013 16:14:12 +0100 Subject: [PATCH] added flag for single-bit fields to get.pl --- xml-db/get.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xml-db/get.pl b/xml-db/get.pl index 8d99242..d202a32 100755 --- a/xml-db/get.pl +++ b/xml-db/get.pl @@ -161,12 +161,15 @@ sub FormatPretty { $cstr = "" unless $cstr; my $ret, my $cl; if (defined $cont) { - my $isflag = 1; $isflag = 0 if $obj->{noflag}; + my $isflag = 1; + $isflag = 0 if $obj->{noflag}; + my $single = ""; + $single = " single=\"1\"" if (($obj->{format} eq 'bitmask' && $obj->{size} == 1) || $obj->{format} eq 'boolean'); $cl = "class=\"".($value?"bad":"good")."\"" if ( $obj->{errorflag} && !$obj->{invertflag} && $isflag); $cl = "class=\"".($value?"good":"bad")."\"" if ( $obj->{errorflag} && $obj->{invertflag} && $isflag); $cl = "class=\"".($value?"high":"low")."\"" if (!$obj->{errorflag} && !$obj->{invertflag} && $isflag); $cl = "class=\"".($value?"low":"high")."\"" if (!$obj->{errorflag} && $obj->{invertflag} && $isflag); - $cl .= sprintf(" cstr=\"$cstr\" raw=\"0x%x\">
",$rawvalue); + $cl .= sprintf(" cstr=\"$cstr\"%s raw=\"0x%x\">
",$single,$rawvalue); my $t = ""; $ret = "<$cont "; -- 2.43.0