Skip to content

Commit 1a8f4b2

Browse files
jeplerdpgeorge
authored andcommitted
py/mpprint: Remove unused "PF_FLAG_NO_TRAILZ" flag.
Looking at the git history, there's no indication that the `PF_FLAG_NO_TRAILZ` flag was ever implemented or that "%!" was used as an `mp_printf` format string in practice. So remove the flag and re-number the other flags. Leave `PF_FLAG_SEP_POS` at 9 (the highest position that probably works with 16-bit integers like the pic16bit port). Signed-off-by: Jeff Epler <[email protected]>
1 parent 73b1cbc commit 1a8f4b2

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

py/mpprint.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,6 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {
413413
flags |= PF_FLAG_SHOW_SIGN;
414414
} else if (*fmt == ' ') {
415415
flags |= PF_FLAG_SPACE_SIGN;
416-
} else if (*fmt == '!') {
417-
flags |= PF_FLAG_NO_TRAILZ;
418416
} else if (*fmt == '0') {
419417
flags |= PF_FLAG_PAD_AFTER_SIGN;
420418
fill = '0';

py/mpprint.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@
3131
#define PF_FLAG_LEFT_ADJUST (0x001)
3232
#define PF_FLAG_SHOW_SIGN (0x002)
3333
#define PF_FLAG_SPACE_SIGN (0x004)
34-
#define PF_FLAG_NO_TRAILZ (0x008)
35-
#define PF_FLAG_SHOW_PREFIX (0x010)
36-
#define PF_FLAG_PAD_AFTER_SIGN (0x020)
37-
#define PF_FLAG_CENTER_ADJUST (0x040)
38-
#define PF_FLAG_ADD_PERCENT (0x080)
39-
#define PF_FLAG_SHOW_OCTAL_LETTER (0x100)
34+
#define PF_FLAG_SHOW_PREFIX (0x008)
35+
#define PF_FLAG_PAD_AFTER_SIGN (0x010)
36+
#define PF_FLAG_CENTER_ADJUST (0x020)
37+
#define PF_FLAG_ADD_PERCENT (0x040)
38+
#define PF_FLAG_SHOW_OCTAL_LETTER (0x080)
4039
#define PF_FLAG_SEP_POS (9) // must be above all the above PF_FLAGs
4140

4241
#if MICROPY_PY_IO && MICROPY_PY_SYS_STDFILES

0 commit comments

Comments
 (0)