wok-next view indent/stuff/patches/indent-2.2.11-decimal_format.patch @ rev 20443

The rest of my "home work" for update many packages (up to Xorg, GTK and Openbox) for Next and mainly for Next64. Since this point this repository is open for commits. Many errors are expected due to harfbuzz-freetype dependency loop...
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Feb 24 16:17:33 2018 +0200 (2018-02-24)
parents
children
line source
1 From ff47ab3b90333bdfaa40b86cb548e92a01787345 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
3 Date: Thu, 25 Aug 2011 11:26:24 +0200
4 Subject: [PATCH] Do not split decimal float suffix from constant
6 N1312 draft of ISO/IEC WDTR24732 defines additional floating types
7 with given suffixes:
9 _Decimal32 DF, df
10 _Decimal64 DD, dd
11 _Decimal128 DL, dl
13 These suffixes must stick on numeric part of the constant as classic
14 float or long float does.
15 ---
16 regression/TEST | 3 ++-
17 regression/input/float-constant-suffix.c | 13 +++++++++++++
18 regression/standard/float-constant-suffix.c | 13 +++++++++++++
19 src/lexi.c | 9 +++++++++
20 4 files changed, 37 insertions(+), 1 deletions(-)
21 create mode 100644 regression/input/float-constant-suffix.c
22 create mode 100644 regression/standard/float-constant-suffix.c
24 diff --git a/regression/TEST b/regression/TEST
25 index c860ef2..1402ddf 100755
26 --- a/regression/TEST
27 +++ b/regression/TEST
28 @@ -35,7 +35,8 @@ EXAMPLES="do.c else.c for.c func-def.c lshift.c ncs.c \
30 BUGS="case-label.c one-line-1.c one-line-2.c one-line-3.c \
31 one-line-4.c struct-decl.c sizeof-in-while.c line-break-comment.c \
32 - macro.c enum.c elif.c nested.c wrapped-string.c minus_predecrement.c"
33 + macro.c enum.c elif.c nested.c wrapped-string.c minus_predecrement.c \
34 + float-constant-suffix.c"
36 INDENTSRC="args.c backup.h backup.c dirent_def.h globs.c indent.h \
37 indent.c indent_globs.h io.c lexi.c memcpy.c parse.c pr_comment.c \
38 diff --git a/regression/input/float-constant-suffix.c b/regression/input/float-constant-suffix.c
39 new file mode 100644
40 index 0000000..58f5310
41 --- /dev/null
42 +++ b/regression/input/float-constant-suffix.c
43 @@ -0,0 +1,13 @@
44 +float foo = 1.0F;
45 +float foo = 1.0f;
46 +double foo = 1.0;
47 +double foo = 1.0;
48 +long double foo = 1.0L;
49 +long double foo = 1.0l;
50 +
51 +_Decimal32 foo = 1.0DF;
52 +_Decimal32 foo = 1.0df;
53 +_Decimal64 foo = 1.0DD;
54 +_Decimal64 foo = 1.0dd;
55 +_Decimal128 foo = 1.0DL;
56 +_Decimal128 foo = 1.0dl;
57 diff --git a/regression/standard/float-constant-suffix.c b/regression/standard/float-constant-suffix.c
58 new file mode 100644
59 index 0000000..58f5310
60 --- /dev/null
61 +++ b/regression/standard/float-constant-suffix.c
62 @@ -0,0 +1,13 @@
63 +float foo = 1.0F;
64 +float foo = 1.0f;
65 +double foo = 1.0;
66 +double foo = 1.0;
67 +long double foo = 1.0L;
68 +long double foo = 1.0l;
69 +
70 +_Decimal32 foo = 1.0DF;
71 +_Decimal32 foo = 1.0df;
72 +_Decimal64 foo = 1.0DD;
73 +_Decimal64 foo = 1.0dd;
74 +_Decimal128 foo = 1.0DL;
75 +_Decimal128 foo = 1.0dl;
76 diff --git a/src/lexi.c b/src/lexi.c
77 index abc2bfa..eafb65e 100644
78 --- a/src/lexi.c
79 +++ b/src/lexi.c
80 @@ -330,6 +330,15 @@ extern codes_ty lexi(void)
81 {
82 buf_ptr++;
83 }
84 + else if (*buf_ptr == 'D' || *buf_ptr == 'd')
85 + {
86 + if (buf_ptr[1] == 'F' || buf_ptr[1] == 'f' ||
87 + buf_ptr[1] == 'D' || buf_ptr[1] == 'd' ||
88 + buf_ptr[1] == 'L' || buf_ptr[1] == 'l')
89 + {
90 + buf_ptr+=2;
91 + }
92 + }
93 else
94 {
95 while (*buf_ptr == 'U' || *buf_ptr == 'u' || *buf_ptr == 'L' || *buf_ptr == 'l')
96 --
97 1.7.6