Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0178aa9

Browse filesBrowse files
committed
py, unix: Allow to compile with -Wdouble-promotion.
Ref issue adafruit#699.
1 parent b58da94 commit 0178aa9
Copy full SHA for 0178aa9

2 files changed

+8-2Lines changed: 8 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎py/objstr.c‎

Copy file name to clipboardExpand all lines: py/objstr.c
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,13 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa
12061206

12071207
case '%':
12081208
flags |= PF_FLAG_ADD_PERCENT;
1209-
pfenv_print_float(&pfenv_vstr, mp_obj_get_float(arg) * 100.0F, 'f', flags, fill, width, precision);
1209+
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
1210+
#define F100 100.0F
1211+
#else
1212+
#define F100 100.0
1213+
#endif
1214+
pfenv_print_float(&pfenv_vstr, mp_obj_get_float(arg) * F100, 'f', flags, fill, width, precision);
1215+
#undef F100
12101216
break;
12111217
#endif
12121218

Collapse file

‎unix/modtime.c‎

Copy file name to clipboardExpand all lines: unix/modtime.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void msec_sleep_tv(struct timeval *tv) {
5252
#endif
5353

5454
#if defined(MP_CLOCKS_PER_SEC)
55-
#define CLOCK_DIV (MP_CLOCKS_PER_SEC / 1000.0)
55+
#define CLOCK_DIV (MP_CLOCKS_PER_SEC / 1000.0F)
5656
#else
5757
#error Unsupported clock() implementation
5858
#endif

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.