diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2005-11-17 10:57:35 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2005-11-17 10:57:35 (GMT) |
commit | ade22ba319d8ff4395c82135981cc073804ce97a (patch) | |
tree | 551a8431a7603d8f0d73f739344653f03f7c3a35 /generic/tkScale.c | |
parent | 3857560b944b318c14b18b5105c6e25d169bb9a6 (diff) | |
download | tk-ade22ba319d8ff4395c82135981cc073804ce97a.zip tk-ade22ba319d8ff4395c82135981cc073804ce97a.tar.gz tk-ade22ba319d8ff4395c82135981cc073804ce97a.tar.bz2 |
Lots of ANSIfying of function decls.
Also a few spots where code has been cleaned up more completely.
Diffstat (limited to 'generic/tkScale.c')
-rw-r--r-- | generic/tkScale.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/tkScale.c b/generic/tkScale.c index 12973b2..2b688b5 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScale.c,v 1.20 2005/10/17 21:41:54 dkf Exp $ + * RCS: @(#) $Id: tkScale.c,v 1.21 2005/11/17 10:57:35 dkf Exp $ */ #include "tkPort.h" @@ -1125,24 +1125,24 @@ TkRoundToResolution( TkScale *scalePtr, /* Information about scale widget. */ double value) /* Value to round. */ { - double rem, new, tick; + double rem, rounded, tick; if (scalePtr->resolution <= 0) { return value; } tick = floor(value/scalePtr->resolution); - new = scalePtr->resolution * tick; - rem = value - new; + rounded = scalePtr->resolution * tick; + rem = value - rounded; if (rem < 0) { if (rem <= -scalePtr->resolution/2) { - new = (tick - 1.0) * scalePtr->resolution; + rounded = (tick - 1.0) * scalePtr->resolution; } } else { if (rem >= scalePtr->resolution/2) { - new = (tick + 1.0) * scalePtr->resolution; + rounded = (tick + 1.0) * scalePtr->resolution; } } - return new; + return rounded; } /* |