Commit 57712f32 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Fix isdigit usage.

2002-02-19  Morten Welinder  <terra@diku.dk>

	* src/format.c (format_compile): Fix isdigit usage.

	* src/value.c (value_diff): Return a gnum_float, not a double.
parent e7265602
2002-02-19 Morten Welinder <terra@diku.dk>
* src/format.c (format_compile): Fix isdigit usage.
* src/value.c (value_diff): Return a gnum_float, not a double.
2002-02-19 Jody Goldberg <jody@gnome.org>
* src/global-gnome-font.c (global_gnome_font_init) : get font list
......
2002-02-19 Morten Welinder <terra@diku.dk>
* src/format.c (format_compile): Fix isdigit usage.
* src/value.c (value_diff): Return a gnum_float, not a double.
2002-02-19 Jody Goldberg <jody@gnome.org>
* src/global-gnome-font.c (global_gnome_font_init) : get font list
......
2002-02-19 Morten Welinder <terra@diku.dk>
* src/format.c (format_compile): Fix isdigit usage.
* src/value.c (value_diff): Return a gnum_float, not a double.
2002-02-19 Jody Goldberg <jody@gnome.org>
* src/global-gnome-font.c (global_gnome_font_init) : get font list
......
......@@ -512,7 +512,7 @@ format_compile (StyleFormat *format)
}
case '/':
if (fmt[1] == '?' || isdigit (fmt[1])) {
if (fmt[1] == '?' || isdigit ((unsigned char)fmt[1])) {
entry->has_fraction = TRUE;
fmt++;
}
......
......@@ -798,9 +798,9 @@ compare_float_float (Value const *va, Value const *vb)
*
* IGNORES format.
*
* Returns a positive difference between 2 values
* Returns a non-negative difference between 2 values
*/
double
gnum_float
value_diff (Value const *a, Value const *b)
{
ValueType ta, tb;
......@@ -862,13 +862,13 @@ value_diff (Value const *a, Value const *b)
case VALUE_INTEGER: {
int const ia = value_get_as_int (a);
int const ib = value_get_as_int (b);
return abs (ia-ib);
return abs (ia - ib);
}
case VALUE_FLOAT: {
double const da = value_get_as_float (a);
double const db = value_get_as_float (b);
return fabs (da-db);
const gnum_float da = value_get_as_float (a);
const gnum_float db = value_get_as_float (b);
return fabs (da - db);
}
default:
return TYPE_MISMATCH;
......
......@@ -114,7 +114,7 @@ void value_release (Value *v);
void value_set_fmt (Value *v, StyleFormat const *fmt);
void value_dump (Value const *v);
Value *value_duplicate (Value const *v);
double value_diff (Value const *a, Value const *b);
gnum_float value_diff (Value const *a, Value const *b);
ValueCompare value_compare (Value const *a, Value const *b,
gboolean case_sensitive);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment