Kaynağa Gözat

check_disk.c: Use fabs instead of labs, as the type is double really.

See,
check_disk.c:367:29: warning: using integer absolute value function 'labs' when
      argument is of floating point type [-Wabsolute-value]
        warning_high_tide = labs( min( (double) warning_high_tide, (doub...
                            ^
check_disk.c:367:29: note: use function 'fabs' instead
        warning_high_tide = labs( min( (double) warning_high_tide, (doub...
                            ^~~~
                            fabs
check_disk.c:373:30: warning: using integer absolute value function 'labs' when
      argument is of floating point type [-Wabsolute-value]
        critical_high_tide = labs( min( (double) critical_high_tide, (do...
                             ^
check_disk.c:373:30: note: use function 'fabs' instead
        critical_high_tide = labs( min( (double) critical_high_tide, (do...
                             ^~~~
                             fabs
Mario Trangoni 7 yıl önce
ebeveyn
işleme
903217d6c7
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      plugins/check_disk.c

+ 2 - 2
plugins/check_disk.c

@@ -364,13 +364,13 @@ main (int argc, char **argv)
         warning_high_tide = path->dtotal_units - path->freespace_units->warning->end;
       }
       if (path->freespace_percent->warning != NULL) {
-        warning_high_tide = labs( min( (double) warning_high_tide, (double) (1.0 - path->freespace_percent->warning->end/100)*path->dtotal_units ));
+        warning_high_tide = fabs( min( (double) warning_high_tide, (double) (1.0 - path->freespace_percent->warning->end/100)*path->dtotal_units ));
       }
       if (path->freespace_units->critical != NULL) {
         critical_high_tide = path->dtotal_units - path->freespace_units->critical->end;
       }
       if (path->freespace_percent->critical != NULL) {
-        critical_high_tide = labs( min( (double) critical_high_tide, (double) (1.0 - path->freespace_percent->critical->end/100)*path->dtotal_units ));
+        critical_high_tide = fabs( min( (double) critical_high_tide, (double) (1.0 - path->freespace_percent->critical->end/100)*path->dtotal_units ));
       }
 
       /* Nb: *_high_tide are unset when == ULONG_MAX */