Module Name: xsrc
Committed By: christos
Date: Thu Sep 22 17:11:58 UTC 2016
Modified Files:
xsrc/external/mit/xf86-video-mga/dist/src: mga_dacG.c
Log Message:
use fabs
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c
diff -u xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c:1.3 xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c:1.4
--- xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c:1.3 Fri Aug 19 20:27:21 2016
+++ xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c Thu Sep 22 13:11:58 2016
@@ -798,13 +798,15 @@ MGAGCalcClock ( ScrnInfoPtr pScrn, long
/* see values of ( n ) which we can't use */
for ( n = feed_div_min; n <= feed_div_max; n++ )
{
+ double av;
calc_f = ref_freq * (n + 1) / (m + 1) ;
/*
* Pick the closest frequency.
*/
- if ( abs(calc_f - f_vco) < m_err ) {
- m_err = abs(calc_f - f_vco);
+ av = fabs(calc_f - f_vco);
+ if ( av < m_err ) {
+ m_err = av;
*best_m = m;
*best_n = n;
}