Change expressions from infix to prefix notation
patch 16034f2b6f19369d43dc6b1c91c184734f75185a
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Wed Jan 11 01:00:25 CET 2017
* Change expressions from infix to prefix notation
hunk ./idlebiff 29
+namespace path ::tcl::mathop
+proc and { args } { set a 1; foreach b $args { set a [ expr $a && $b ]; if !$a { return 0 } }; return $a }
+proc or { args } { set a 0; foreach b $args { set a [ expr $a || $b ]; if $a { return 1 } }; return $a }
hunk ./idlebiff 102
- set size_not_same [ expr $png_up_w!=$png_down_w || $png_down_w!=$png_chk_w || $png_up_h!=$png_down_h || $png_down_h!=$png_chk_h ]
+ set size_not_same [ or [ != $png_up_w $png_down_w ] [ != $png_down_w $png_chk_w ] [ != $png_up_h $png_down_h ] [ != $png_down_h $png_chk_h ] ]
hunk ./idlebiff 107
- append geom [ expr $png_up_w + 10 ] x [ expr $png_up_h + 10 ]
- if { $conf(pos_x) && $conf(pos_y) } { append geom + $conf(pos_x) + $conf(pos_y) }
+ append geom [ + $png_up_w 10 ] x [ + $png_up_h 10 ]
+ if [ and $conf(pos_x) $conf(pos_y) ] { append geom + $conf(pos_x) + $conf(pos_y) }
hunk ./idlebiff 170
- if { $argn == 1 } { set config $arg } else { set config "$::env(HOME)/.idlebiffrc" }
+ if [ == $argn 1 ] { set config $arg } else { set config "$::env(HOME)/.idlebiffrc" }
hunk ./idlebiff 172
- while { [ gets $cf lin ] >= 0 } \
+ while { [ >= [ gets $cf lin ] 0 ] } \
hunk ./idlebiff 174
- if { [ string index [ string trim $lin ] 0 ] == "#" } continue
+ if [ == [ string index [ string trim $lin ] 0 ] # ] continue
hunk ./idlebiff 176
- set key [ string range $lin 0 [ expr $sep - 1 ] ]
- set val [ string range $lin [ expr $sep + 1 ] end ]
+ set key [ string range $lin 0 [ - $sep 1 ] ]
+ set val [ string range $lin [ + $sep 1 ] end ]
hunk ./idlebiff 188
- if { [ info exists conf(criteria) ] && $conf(criteria)!="" } { set criteria $conf(criteria) } \
+ if [ info exists conf(criteria) ] { if [ ne $conf(criteria) "" ] { set criteria $conf(criteria) } } \
hunk ./idlebiff 278
- if { $tag == 10000 } { set tag 1 }
+ if [ == $tag 10000 ] { set tag 1 }
hunk ./idlebiff 368
- if { $args eq "logindisabled" } { set cap(logindisabled_chk) 1 } \
+ if [ eq $args logindisabled ] { set cap(logindisabled_chk) 1 } \
hunk ./idlebiff 477
- if { $prim eq "+" } { set idle 1 } \
- elseif $idle { if { $prim eq "*" } { idle_cycle $con 1 } } \
+ if [ eq $prim + ] { set idle 1 } \
+ elseif $idle { if [ eq $prim * ] { idle_cycle $con 1 } } \
hunk ./idlebiff 498
- if { $search_resp && [ ok_tagged $linea A ] } \
+ if [ and $search_resp [ ok_tagged $linea A ] ] \
hunk ./idlebiff 504
- if { $new_messages > 0 } \
+ if [ > $new_messages 0 ] \
hunk ./idlebiff 525
- if { $r < 1 && [ eof $con ] } \
+ if [ and [ < $r 1 ] [ eof $con ] ] \
hunk ./idlebiff 551
- if { $conf(tls_ca_subject) ne "" && $type eq "verify" && $ca(subject) eq $ca(issuer) } \
+ if [ info exists conf(tls_ca_subject) ] \
hunk ./idlebiff 553
- array set csu [ parse_cert_subject $ca(subject) ]
- if !$ccsp \
+ if [ and [ ne $conf(tls_ca_subject) "" ] [ eq $type "verify" ] [ eq $ca(subject) $ca(issuer) ] ] \
hunk ./idlebiff 555
- array set ccsu [ parse_cert_subject $conf(tls_ca_subject) ]
- set ccsp 1
+ array set csu [ parse_cert_subject $ca(subject) ]
+ if !$ccsp \
+ {
+ array set ccsu [ parse_cert_subject $conf(tls_ca_subject) ]
+ set ccsp 1
+ }
+ foreach i [ array names ccsu ] \
+ {
+ if ![ info exists csu($i) ] { error cert }
+ if [ ne $csu($i) $ccsu($i) ] { error cert }
+ }
hunk ./idlebiff 567
- foreach i [ array names ccsu ] \
- { if { ![ info exists csu($i) ] || $csu($i)!=$ccsu($i) } { error cert } }
hunk ./idlebiff 578
- if { "$tlsv" >= "1.6.4" } { set tls1x {-tls1.1 1 -tls1.2 1} } \
+ if [ >= $tlsv 1.6.4 ] { set tls1x {-tls1.1 1 -tls1.2 1} } \