diff options
author | Carl Worth <cworth@cworth.org> | 2007-04-10 12:13:27 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2007-04-10 12:13:27 -0700 |
commit | 97a69bc82e023d139d997ef69c7eba50d2708686 (patch) | |
tree | 1d6d481b512c562efe434dfd2f284a9ab743b804 /src/cairo-output-stream.c | |
parent | 5c95800cded4e906baf8ddd10bfb4abc59151b13 (diff) |
Fix mis-indented _cairo_dtostr
Diffstat (limited to 'src/cairo-output-stream.c')
-rw-r--r-- | src/cairo-output-stream.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/cairo-output-stream.c b/src/cairo-output-stream.c index cdf7d1da..3da7c746 100644 --- a/src/cairo-output-stream.c +++ b/src/cairo-output-stream.c @@ -219,48 +219,48 @@ _cairo_output_stream_write_hex_string (cairo_output_stream_t *stream, int _cairo_dtostr (char *buffer, size_t size, double d) { - struct lconv *locale_data; - const char *decimal_point; - int decimal_point_len; - char *p; - int decimal_len; + struct lconv *locale_data; + const char *decimal_point; + int decimal_point_len; + char *p; + int decimal_len; - /* Omit the minus sign from negative zero. */ - if (d == 0.0) - d = 0.0; + /* Omit the minus sign from negative zero. */ + if (d == 0.0) + d = 0.0; - snprintf (buffer, size, "%f", d); + snprintf (buffer, size, "%f", d); - locale_data = localeconv (); - decimal_point = locale_data->decimal_point; - decimal_point_len = strlen (decimal_point); + locale_data = localeconv (); + decimal_point = locale_data->decimal_point; + decimal_point_len = strlen (decimal_point); - assert (decimal_point_len != 0); - p = buffer; + assert (decimal_point_len != 0); + p = buffer; - if (*p == '+' || *p == '-') - p++; + if (*p == '+' || *p == '-') + p++; - while (isdigit (*p)) - p++; + while (isdigit (*p)) + p++; - if (strncmp (p, decimal_point, decimal_point_len) == 0) { - *p = '.'; - decimal_len = strlen (p + decimal_point_len); - memmove (p + 1, p + decimal_point_len, decimal_len); - p[1 + decimal_len] = 0; + if (strncmp (p, decimal_point, decimal_point_len) == 0) { + *p = '.'; + decimal_len = strlen (p + decimal_point_len); + memmove (p + 1, p + decimal_point_len, decimal_len); + p[1 + decimal_len] = 0; - /* Remove trailing zeros and decimal point if possible. */ - for (p = p + decimal_len; *p == '0'; p--) - *p = 0; + /* Remove trailing zeros and decimal point if possible. */ + for (p = p + decimal_len; *p == '0'; p--) + *p = 0; - if (*p == '.') { - *p = 0; - p--; - } - } + if (*p == '.') { + *p = 0; + p--; + } + } - return p + 1 - buffer; + return p + 1 - buffer; } enum { |