scanner: warn on value 0 in bitfields

Sometimes they're used legitimately, but in some cases they're just nonsense.
For the legitimate use cases, this adds an optional "valid-zero" attribute
for bitfield entries, which can be used to suppress the warning.
This commit is contained in:
Xaver Hugl 2025-06-25 15:39:46 +02:00
parent 90187031e6
commit 82c1730db1
3 changed files with 15 additions and 2 deletions

View file

@ -24,6 +24,7 @@
<!ATTLIST entry summary CDATA #IMPLIED>
<!ATTLIST entry since CDATA #IMPLIED>
<!ATTLIST entry deprecated-since CDATA #IMPLIED>
<!ATTLIST entry valid-zero CDATA #IMPLIED>
<!ELEMENT arg (description?)>
<!ATTLIST arg name CDATA #REQUIRED>
<!ATTLIST arg type CDATA #REQUIRED>

View file

@ -1084,7 +1084,7 @@
or drags initiated with other buttons than BTN_LEFT to specific
actions (e.g. "ask").
</description>
<entry name="none" value="0" summary="no action"/>
<entry name="none" value="0" summary="no action" valid-zero="true"/>
<entry name="copy" value="1" summary="copy action"/>
<entry name="move" value="2" summary="move action"/>
<entry name="ask" value="4" summary="ask action"/>
@ -1163,7 +1163,7 @@
use this information to adapt its behavior, e.g. choose
an appropriate cursor image.
</description>
<entry name="none" value="0" summary="no edge"/>
<entry name="none" value="0" summary="no edge" valid-zero="true"/>
<entry name="top" value="1" summary="top edge"/>
<entry name="bottom" value="2" summary="bottom edge"/>
<entry name="left" value="4" summary="left edge"/>