Danek Duvall wrote:
> 
> James C. McPherson wrote:
> 
> > http://cr.opensolaris.org/~jmcp/6414832/webrev
> 
> Is the new way of computing POUND_SIGN in Makefile.master on top of setting
> POUND_SIGN in nightly and bldenv just belt and suspenders?  Shouldn't the
> first do the trick?  (Cute trick, BTW.)
> 
> gen_make.machines.sh:
> 
>   - line 30: I'd just set PATH=/usr/bin:/usr/sbin and not bother with
>     setting variables for all the commands, especially since you're not
>     allowing folks to override them from the outside.
> 
>   - line 39: Since you're in ksh93, you can skip running expr and use the
>     more readable math expression:
> 
>         max=$(((cpus + 1) * 2))

Please change that to (... and make sure you correctly declared the
variables with either "integer max cpus" or "float max cpus" (depending
on what you need (BTW: ksh93 supports ISO C99 math functions for
rounding, too))) ...
-- snip --
(( max=((cpus + 1) * 2) ))
-- snip --

Using var=$((expr)) means that the internal representation of "expr" is
converted to a string (and if "var" is declared as integer or float you
get a string-to-integer/float conversion, too) while the form above
keeps the internal value intact (the string-to-integer and
integer-to-string conversions eat performance and cause rounding errors
if floating-point values are used (because strings use base10 while the
interbal IEEE754-2008 representation of a |long double| uses base2)).

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.ma...@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
tools-discuss mailing list
tools-discuss@opensolaris.org

Reply via email to