@@ -424,15 +424,12 @@ def escape(value):
424
424
if nv .nodeName == "value" :
425
425
value = nv .getAttribute ('name' )
426
426
bool_representation = nv .getAttribute ('bool_representation' )
427
- if value :
428
- if bool_representation :
429
- if bool_representation .upper () == 'YES' :
430
- enabled = "true"
431
- else :
432
- enabled = "false"
433
- print (" {\" %s\" , \" %s\" , %s, %s}," % (name ,escape (value ),"true" ,enabled ))
427
+ if value and bool_representation :
428
+ if bool_representation .upper () == 'YES' :
429
+ enabled = "true"
434
430
else :
435
- print (" {\" %s\" , \" %s\" , %s, %s}," % (name ,escape (value ),"false" ,"false" ))
431
+ enabled = "false"
432
+ print (" {\" %s\" , \" %s\" , %s}," % (name ,escape (value ),enabled ))
436
433
437
434
def parseGroupMapGetter (node ):
438
435
map = { 'bool' :'bool' , 'string' :'const QCString &' , 'int' :'int' , 'list' :'const StringVector &' }
@@ -787,8 +784,7 @@ def main():
787
784
if n .nodeName == "group" :
788
785
parseGroupMapEnums (n )
789
786
print ("" )
790
- print ("bool enumHasBool(QCString set, QCString val);" )
791
- print ("bool enumBoolRepresentation(QCString set, QCString val);" )
787
+ print ("bool enumBoolRepresentation(QCString set, QCString val, bool *representation);" )
792
788
print ("" )
793
789
print ("class ConfigValues" )
794
790
print ("{" )
@@ -847,7 +843,6 @@ def main():
847
843
print ("#include \" configvalues.h\" " )
848
844
print ("#include \" configimpl.h\" " )
849
845
print ("#include <unordered_map>" )
850
- print ("#include <cassert>" )
851
846
print ("" )
852
847
print ("const ConfigValues::Info *ConfigValues::get(const QCString &tag) const" );
853
848
print ("{" );
@@ -898,7 +893,6 @@ def main():
898
893
print ("{" )
899
894
print (" QCString setting;" )
900
895
print (" QCString value;" )
901
- print (" bool hasBool;" )
902
896
print (" bool representation;" )
903
897
print ("};" )
904
898
print ("struct EnumBool enumBool[] = {" )
@@ -908,22 +902,16 @@ def main():
908
902
parseGroupMapEnumsBool (n )
909
903
print ("};" )
910
904
print ("" )
911
- print ("bool enumHasBool (QCString set, QCString val)" )
905
+ print ("bool enumBoolRepresentation (QCString set, QCString val, bool *representation )" )
912
906
print ("{" )
913
907
print (" for (uint i = 0; i < sizeof(enumBool) / sizeof(*enumBool); i++)" )
914
908
print (" {" )
915
- print (" if (enumBool[i].setting == set && enumBool[i].value == val) return enumBool[i].hasBool;" )
916
- print (" }" )
917
- print (" return false;" )
918
- print ("}" )
919
- print ("" )
920
- print ("bool enumBoolRepresentation(QCString set, QCString val)" )
921
- print ("{" )
922
- print (" for (uint i = 0; i < sizeof(enumBool) / sizeof(*enumBool); i++)" )
923
- print (" {" )
924
- print (" if (enumBool[i].hasBool && enumBool[i].setting == set && enumBool[i].value == val) return enumBool[i].representation;" )
909
+ print (" if (enumBool[i].setting == set && enumBool[i].value == val)" )
910
+ print (" {" )
911
+ print (" *representation = enumBool[i].representation;" )
912
+ print (" return true;" )
913
+ print (" }" )
925
914
print (" }" )
926
- print (" assert(false);" )
927
915
print (" return false;" )
928
916
print ("}" )
929
917
print ("" )
0 commit comments