@@ -251,16 +251,16 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
251251 # The test name defaults to the command, but without the
252252 # arguments, for historical reasons.
253253
254- if { "$in_testname" == "" } then { set in_testname "ptype $in_exp" }
254+ if {"$in_testname" == ""} { set in_testname "ptype $in_exp" }
255255
256256 set in_command "ptype${in_ptype_arg} $in_exp"
257257 }
258258
259259 # Save class tables in a history array for reuse.
260260
261261 global cp_class_table_history
262- if { $in_class_table == "ibid" } then {
263- if { ! [info exists cp_class_table_history("$in_key,$in_tag") ] } then {
262+ if {$in_class_table == "ibid"} {
263+ if {! [info exists cp_class_table_history("$in_key,$in_tag")]} {
264264 fail "$in_testname // bad ibid"
265265 return false
266266 }
@@ -385,7 +385,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
385385
386386 # Check the actual tag.
387387
388- if { "$actual_tag" != "$in_tag" } then {
388+ if {"$actual_tag" != "$in_tag"} {
389389 cp_check_errata "$in_tag" "$actual_tag" $in_errata_table
390390 fail "$in_testname // wrong tag: $actual_tag"
391391 return false
@@ -395,18 +395,18 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
395395 # First parse them into a list.
396396
397397 set list_actual_bases { }
398- if { "$actual_base_string" != "" } then {
398+ if {"$actual_base_string" != ""} {
399399 regsub "^:${wsopt}" $actual_base_string "" actual_base_string
400400 set list_actual_bases [split $actual_base_string ","]
401401 }
402402
403403 # Check the base count.
404404
405- if { [llength $list_actual_bases] < [llength $list_bases] } then {
405+ if {[llength $list_actual_bases] < [llength $list_bases]} {
406406 fail "$in_testname // too few bases"
407407 return false
408408 }
409- if { [llength $list_actual_bases] > [llength $list_bases] } then {
409+ if {[llength $list_actual_bases] > [llength $list_bases]} {
410410 fail "$in_testname // too many bases"
411411 return false
412412 }
@@ -416,7 +416,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
416416 foreach actual_base $list_actual_bases {
417417 set actual_base [string trim $actual_base]
418418 set base [lindex $list_bases 0]
419- if { "$actual_base" != "$base" } then {
419+ if {"$actual_base" != "$base"} {
420420 cp_check_errata "$base" "$actual_base" $in_errata_table
421421 fail "$in_testname // wrong base: $actual_base"
422422 return false
@@ -449,13 +449,13 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
449449 # Get the next line.
450450
451451 set actual_line [cp_support_internal::next_line $line_queue]
452- if { "$actual_line" == "" } then { continue }
452+ if {"$actual_line" == ""} { continue }
453453
454454 # Access specifiers.
455455
456- if { [regexp "^(public|protected|private)${wsopt}:\$" "$actual_line" s0 s1] } then {
456+ if {[regexp "^(public|protected|private)${wsopt}:\$" "$actual_line" s0 s1]} {
457457 set access "$s1"
458- if { $last_was_access } then {
458+ if {$last_was_access} {
459459 fail "$in_testname // redundant access specifier"
460460 queue delete $line_queue
461461 return false
@@ -468,10 +468,10 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
468468
469469 # Optional virtual base pointer.
470470
471- if { [ llength $list_vbases ] > 0 } then {
471+ if {[ llength $list_vbases] > 0} {
472472 set vbase [lindex $list_vbases 0]
473- if { [ regexp "$vbase \\*(_vb.|_vb\\\$|__vb_)\[0-9\]*$vbase;" $actual_line ] } then {
474- if { "$access" != "private" } then {
473+ if {[ regexp "$vbase \\*(_vb.|_vb\\\$|__vb_)\[0-9\]*$vbase;" $actual_line]} {
474+ if {"$access" != "private"} {
475475 cp_check_errata "private" "$access" $in_errata_table
476476 fail "$in_testname // wrong access specifier for virtual base: $access"
477477 queue delete $line_queue
@@ -485,7 +485,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
485485
486486 # Data field.
487487
488- if { [llength $list_fields] > 0 } then {
488+ if {[llength $list_fields] > 0} {
489489 set field_access [lindex [lindex $list_fields 0] 0]
490490 set field_decl [lindex [lindex $list_fields 0] 1]
491491 if {$recursive_qid > 0} {
@@ -494,8 +494,8 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
494494 cp_ptype_class_verbose "\tfield_decl=$field_decl"
495495 cp_ptype_class_verbose "\taccess=$access"
496496 }
497- if { "$actual_line" == "$field_decl" } then {
498- if { "$access" != "$field_access" } then {
497+ if {"$actual_line" == "$field_decl"} {
498+ if {"$access" != "$field_access"} {
499499 cp_check_errata "$field_access" "$access" $in_errata_table
500500 fail "$in_testname // wrong access specifier for field: $access"
501501 queue delete $line_queue
@@ -514,11 +514,11 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
514514
515515 # Method function.
516516
517- if { [llength $list_methods] > 0 } then {
517+ if {[llength $list_methods] > 0} {
518518 set method_access [lindex [lindex $list_methods 0] 0]
519519 set method_decl [lindex [lindex $list_methods 0] 1]
520- if { "$actual_line" == "$method_decl" } then {
521- if { "$access" != "$method_access" } then {
520+ if {"$actual_line" == "$method_decl"} {
521+ if {"$access" != "$method_access"} {
522522 cp_check_errata "$method_access" "$access" $in_errata_table
523523 fail "$in_testname // wrong access specifier for method: $access"
524524 queue delete $line_queue
@@ -530,8 +530,8 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
530530
531531 # gcc 2.95.3 shows "foo()" as "foo(void)".
532532 regsub -all "\\(\\)" $method_decl "(void)" method_decl
533- if { "$actual_line" == "$method_decl" } then {
534- if { "$access" != "$method_access" } then {
533+ if {"$actual_line" == "$method_decl"} {
534+ if {"$access" != "$method_access"} {
535535 cp_check_errata "$method_access" "$access" $in_errata_table
536536 fail "$in_testname // wrong access specifier for method: $access"
537537 queue delete $line_queue
@@ -689,16 +689,16 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
689689 set synth_access [lindex $synth 1]
690690 set synth_re [lindex $synth 2]
691691
692- if { [ regexp "$synth_re" "$actual_line" ] } then {
692+ if {[ regexp "$synth_re" "$actual_line"]} {
693693
694- if { "$access" != "$synth_access" } then {
694+ if {"$access" != "$synth_access"} {
695695 cp_check_errata "$synth_access" "$access" $in_errata_table
696696 fail "$in_testname // wrong access specifier for synthetic operator: $access"
697697 queue delete $line_queue
698698 return false
699699 }
700700
701- if { $synth_count > 0 } then {
701+ if {$synth_count > 0} {
702702 cp_check_errata "$actual_line" "$actual_line" $in_errata_table
703703 fail "$in_testname // duplicate synthetic operator: $actual_line"
704704 }
@@ -715,7 +715,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
715715 break
716716 }
717717 }
718- if { $synth_match } then { continue }
718+ if {$synth_match} { continue }
719719
720720 # If checking a nested type/recursively and we see a closing curly
721721 # brace, we're done.
@@ -725,7 +725,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
725725
726726 # Unrecognized line.
727727
728- if { [llength $list_methods] > 0 } then {
728+ if {[llength $list_methods] > 0} {
729729 set method_decl [lindex [lindex $list_methods 0] 1]
730730 cp_check_errata "$method_decl" "$actual_line" $in_errata_table
731731 }
@@ -742,19 +742,19 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
742742
743743 # Check for missing elements.
744744
745- if { $vbase_match } then {
746- if { [llength $list_vbases] > 0 } then {
745+ if {$vbase_match} {
746+ if {[llength $list_vbases] > 0} {
747747 fail "$in_testname // missing virtual base pointers"
748748 return false
749749 }
750750 }
751751
752- if { [llength $list_fields] > 0 } then {
752+ if {[llength $list_fields] > 0} {
753753 fail "$in_testname // missing fields"
754754 return false
755755 }
756756
757- if { [llength $list_methods] > 0 } then {
757+ if {[llength $list_methods] > 0} {
758758 fail "$in_testname // missing methods"
759759 return false
760760 }
@@ -767,7 +767,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
767767 # Check the tail.
768768
769769 set actual_tail [string trim $actual_tail]
770- if { "$actual_tail" != "$in_tail" } then {
770+ if {"$actual_tail" != "$in_tail"} {
771771 cp_check_errata "$in_tail" "$actual_tail" $in_errata_table
772772 fail "$in_testname // wrong tail: $actual_tail"
773773 return false
0 commit comments