Changeset 1433ecda in mainline for uspace/lib/c/generic/io
- Timestamp:
- 2018-04-04T15:42:37Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- Location:
- uspace/lib/c/generic/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/printf_core.c
r47b2d7e3 r1433ecda 593 593 /** Prints a special double (ie NaN, infinity) padded to width characters. */ 594 594 static int print_special(ieee_double_t val, int width, uint32_t flags, 595 595 printf_spec_t *ps) 596 596 { 597 597 assert(val.is_special); … … 702 702 */ 703 703 static int print_double_str_fixed(double_str_t *val_str, int precision, int width, 704 704 uint32_t flags, printf_spec_t *ps) 705 705 { 706 706 int len = val_str->len; … … 840 840 */ 841 841 static int print_double_fixed(double g, int precision, int width, uint32_t flags, 842 842 printf_spec_t *ps) 843 843 { 844 844 if (flags & __PRINTF_FLAG_LEFTALIGNED) { … … 869 869 */ 870 870 val_str.len = double_to_fixed_str(val, -1, precision + 1, buf, buf_size, 871 871 &val_str.dec_exp); 872 872 873 873 /* … … 919 919 920 920 exp_str[0] = '0' + exp_val / 100; 921 exp_str[1] = '0' + (exp_val % 100) / 10 921 exp_str[1] = '0' + (exp_val % 100) / 10; 922 922 exp_str[2] = '0' + (exp_val % 10); 923 923 … … 938 938 */ 939 939 static int print_double_str_scient(double_str_t *val_str, int precision, 940 940 int width, uint32_t flags, printf_spec_t *ps) 941 941 { 942 942 int len = val_str->len; … … 1062 1062 */ 1063 1063 static int print_double_scientific(double g, int precision, int width, 1064 1064 uint32_t flags, printf_spec_t *ps) 1065 1065 { 1066 1066 if (flags & __PRINTF_FLAG_LEFTALIGNED) { … … 1088 1088 */ 1089 1089 val_str.len = double_to_fixed_str(val, precision + 2, -1, buf, buf_size, 1090 1090 &val_str.dec_exp); 1091 1091 1092 1092 /* … … 1129 1129 */ 1130 1130 static int print_double_generic(double g, int precision, int width, 1131 1131 uint32_t flags, printf_spec_t *ps) 1132 1132 { 1133 1133 ieee_double_t val = extract_ieee_double(g); … … 1156 1156 precision = precision - (dec_exp + 1); 1157 1157 return print_double_fixed(g, precision, width, 1158 1158 flags | __PRINTF_FLAG_NOFRACZEROS, ps); 1159 1159 } else { 1160 1160 --precision; 1161 1161 return print_double_scientific(g, precision, width, 1162 1162 flags | __PRINTF_FLAG_NOFRACZEROS, ps); 1163 1163 } 1164 1164 } else { … … 1214 1214 */ 1215 1215 static int print_double(double g, char spec, int precision, int width, 1216 1216 uint32_t flags, printf_spec_t *ps) 1217 1217 { 1218 1218 switch (spec) { … … 1543 1543 case 'e': 1544 1544 retval = print_double(va_arg(ap, double), uc, precision, 1545 1545 width, flags, ps); 1546 1546 1547 1547 if (retval < 0) { -
uspace/lib/c/generic/io/visualizer.c
r47b2d7e3 r1433ecda 174 174 errno_t visualizer_update_damaged_region(async_sess_t *sess, 175 175 sysarg_t x, sysarg_t y, sysarg_t width, sysarg_t height, 176 176 sysarg_t x_offset, sysarg_t y_offset) 177 177 { 178 178 assert(x_offset <= UINT16_MAX); -
uspace/lib/c/generic/io/vsnprintf.c
r47b2d7e3 r1433ecda 170 170 }; 171 171 printf_spec_t ps = { 172 (int (*) (const char *, size_t, void *)) vsnprintf_str_write,173 (int (*) (const wchar_t *, size_t, void *)) vsnprintf_wstr_write,172 (int (*) (const char *, size_t, void *)) vsnprintf_str_write, 173 (int (*) (const wchar_t *, size_t, void *)) vsnprintf_wstr_write, 174 174 &data 175 175 };
Note:
See TracChangeset
for help on using the changeset viewer.