parent
751341d9dd
commit
5d16720d21
@ -1 +1,2 @@
|
|||||||
indent-2.2.11.tar.gz
|
indent-2.2.11.tar.gz
|
||||||
|
/indent-2.2.12.tar.xz
|
||||||
|
@ -1,102 +0,0 @@
|
|||||||
From 7ef312f8a721b99469ea85e33e973475006c6a7f Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
|
||||||
Date: Tue, 19 Feb 2013 13:17:12 +0100
|
|
||||||
Subject: [PATCH 2/2] Allow 64-bit stat
|
|
||||||
|
|
||||||
---
|
|
||||||
src/code_io.c | 38 ++++++++++++++++++++++++++++++++------
|
|
||||||
src/indent.h | 2 +-
|
|
||||||
2 files changed, 33 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/code_io.c b/src/code_io.c
|
|
||||||
index 8c8fd41..8b93188 100644
|
|
||||||
--- a/src/code_io.c
|
|
||||||
+++ b/src/code_io.c
|
|
||||||
@@ -50,6 +50,8 @@
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#include <string.h>
|
|
||||||
+#include <errno.h>
|
|
||||||
+#include <limits.h>
|
|
||||||
|
|
||||||
#ifdef VMS
|
|
||||||
#include <file.h>
|
|
||||||
@@ -246,13 +248,18 @@ extern file_buffer_ty * read_file(
|
|
||||||
{
|
|
||||||
static file_buffer_ty fileptr = {NULL};
|
|
||||||
|
|
||||||
+#if defined(__MSDOS__) || defined(VMS)
|
|
||||||
/*
|
|
||||||
* size is required to be unsigned for MSDOS,
|
|
||||||
* in order to read files larger than 32767
|
|
||||||
* bytes in a 16-bit world...
|
|
||||||
*/
|
|
||||||
|
|
||||||
- unsigned int size;
|
|
||||||
+ unsigned int size, size_to_read;
|
|
||||||
+#else
|
|
||||||
+ ssize_t size;
|
|
||||||
+ size_t size_to_read;
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
int namelen = strlen(filename);
|
|
||||||
int fd = open(filename, O_RDONLY, 0777);
|
|
||||||
@@ -289,6 +296,10 @@ extern file_buffer_ty * read_file(
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (file_stats->st_size > SSIZE_MAX)
|
|
||||||
+ {
|
|
||||||
+ fatal(_("File %s is too big to read"), filename);
|
|
||||||
+ }
|
|
||||||
fileptr.size = file_stats->st_size;
|
|
||||||
|
|
||||||
if (fileptr.data != 0)
|
|
||||||
@@ -305,11 +316,26 @@ extern file_buffer_ty * read_file(
|
|
||||||
* newline. */
|
|
||||||
}
|
|
||||||
|
|
||||||
- size = INDENT_SYS_READ (fd, fileptr.data, fileptr.size);
|
|
||||||
-
|
|
||||||
- if (size == (unsigned int) -1)
|
|
||||||
- {
|
|
||||||
- fatal (_("Error reading input file %s"), filename);
|
|
||||||
+ size_to_read = fileptr.size;
|
|
||||||
+ while (size_to_read > 0) {
|
|
||||||
+ size = INDENT_SYS_READ (fd, fileptr.data + fileptr.size - size_to_read,
|
|
||||||
+ size_to_read);
|
|
||||||
+
|
|
||||||
+ if (size ==
|
|
||||||
+#if defined(__MSDOS__) || defined(VMS)
|
|
||||||
+ (unsigned int)
|
|
||||||
+#endif
|
|
||||||
+ -1)
|
|
||||||
+ {
|
|
||||||
+#if !defined(__MSDOS__) && !defined(VMS)
|
|
||||||
+ if (errno == EINTR)
|
|
||||||
+ {
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
+ fatal (_("Error reading input file %s"), filename);
|
|
||||||
+ }
|
|
||||||
+ size_to_read -= size;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (close (fd) < 0)
|
|
||||||
diff --git a/src/indent.h b/src/indent.h
|
|
||||||
index 60ccb5a..bcb6b64 100644
|
|
||||||
--- a/src/indent.h
|
|
||||||
+++ b/src/indent.h
|
|
||||||
@@ -106,7 +106,7 @@ typedef unsigned char BOOLEAN;
|
|
||||||
typedef struct file_buffer
|
|
||||||
{
|
|
||||||
char *name;
|
|
||||||
- unsigned long size;
|
|
||||||
+ size_t size;
|
|
||||||
char *data;
|
|
||||||
} file_buffer_ty;
|
|
||||||
|
|
||||||
--
|
|
||||||
1.8.1.2
|
|
||||||
|
|
@ -1,98 +0,0 @@
|
|||||||
From ff47ab3b90333bdfaa40b86cb548e92a01787345 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
|
||||||
Date: Thu, 25 Aug 2011 11:26:24 +0200
|
|
||||||
Subject: [PATCH] Do not split decimal float suffix from constant
|
|
||||||
|
|
||||||
N1312 draft of ISO/IEC WDTR24732 defines additional floating types
|
|
||||||
with given suffixes:
|
|
||||||
|
|
||||||
_Decimal32 DF, df
|
|
||||||
_Decimal64 DD, dd
|
|
||||||
_Decimal128 DL, dl
|
|
||||||
|
|
||||||
These suffixes must stick on numeric part of the constant as classic
|
|
||||||
float or long float does.
|
|
||||||
---
|
|
||||||
regression/TEST | 3 ++-
|
|
||||||
regression/input/float-constant-suffix.c | 13 +++++++++++++
|
|
||||||
regression/standard/float-constant-suffix.c | 13 +++++++++++++
|
|
||||||
src/lexi.c | 9 +++++++++
|
|
||||||
4 files changed, 37 insertions(+), 1 deletions(-)
|
|
||||||
create mode 100644 regression/input/float-constant-suffix.c
|
|
||||||
create mode 100644 regression/standard/float-constant-suffix.c
|
|
||||||
|
|
||||||
diff --git a/regression/TEST b/regression/TEST
|
|
||||||
index c860ef2..1402ddf 100755
|
|
||||||
--- a/regression/TEST
|
|
||||||
+++ b/regression/TEST
|
|
||||||
@@ -35,7 +35,8 @@ EXAMPLES="do.c else.c for.c func-def.c lshift.c ncs.c \
|
|
||||||
|
|
||||||
BUGS="case-label.c one-line-1.c one-line-2.c one-line-3.c \
|
|
||||||
one-line-4.c struct-decl.c sizeof-in-while.c line-break-comment.c \
|
|
||||||
- macro.c enum.c elif.c nested.c wrapped-string.c minus_predecrement.c"
|
|
||||||
+ macro.c enum.c elif.c nested.c wrapped-string.c minus_predecrement.c \
|
|
||||||
+ float-constant-suffix.c"
|
|
||||||
|
|
||||||
INDENTSRC="args.c backup.h backup.c dirent_def.h globs.c indent.h \
|
|
||||||
indent.c indent_globs.h io.c lexi.c memcpy.c parse.c pr_comment.c \
|
|
||||||
diff --git a/regression/input/float-constant-suffix.c b/regression/input/float-constant-suffix.c
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..58f5310
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/regression/input/float-constant-suffix.c
|
|
||||||
@@ -0,0 +1,13 @@
|
|
||||||
+float foo = 1.0F;
|
|
||||||
+float foo = 1.0f;
|
|
||||||
+double foo = 1.0;
|
|
||||||
+double foo = 1.0;
|
|
||||||
+long double foo = 1.0L;
|
|
||||||
+long double foo = 1.0l;
|
|
||||||
+
|
|
||||||
+_Decimal32 foo = 1.0DF;
|
|
||||||
+_Decimal32 foo = 1.0df;
|
|
||||||
+_Decimal64 foo = 1.0DD;
|
|
||||||
+_Decimal64 foo = 1.0dd;
|
|
||||||
+_Decimal128 foo = 1.0DL;
|
|
||||||
+_Decimal128 foo = 1.0dl;
|
|
||||||
diff --git a/regression/standard/float-constant-suffix.c b/regression/standard/float-constant-suffix.c
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..58f5310
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/regression/standard/float-constant-suffix.c
|
|
||||||
@@ -0,0 +1,13 @@
|
|
||||||
+float foo = 1.0F;
|
|
||||||
+float foo = 1.0f;
|
|
||||||
+double foo = 1.0;
|
|
||||||
+double foo = 1.0;
|
|
||||||
+long double foo = 1.0L;
|
|
||||||
+long double foo = 1.0l;
|
|
||||||
+
|
|
||||||
+_Decimal32 foo = 1.0DF;
|
|
||||||
+_Decimal32 foo = 1.0df;
|
|
||||||
+_Decimal64 foo = 1.0DD;
|
|
||||||
+_Decimal64 foo = 1.0dd;
|
|
||||||
+_Decimal128 foo = 1.0DL;
|
|
||||||
+_Decimal128 foo = 1.0dl;
|
|
||||||
diff --git a/src/lexi.c b/src/lexi.c
|
|
||||||
index abc2bfa..eafb65e 100644
|
|
||||||
--- a/src/lexi.c
|
|
||||||
+++ b/src/lexi.c
|
|
||||||
@@ -330,6 +330,15 @@ extern codes_ty lexi(void)
|
|
||||||
{
|
|
||||||
buf_ptr++;
|
|
||||||
}
|
|
||||||
+ else if (*buf_ptr == 'D' || *buf_ptr == 'd')
|
|
||||||
+ {
|
|
||||||
+ if (buf_ptr[1] == 'F' || buf_ptr[1] == 'f' ||
|
|
||||||
+ buf_ptr[1] == 'D' || buf_ptr[1] == 'd' ||
|
|
||||||
+ buf_ptr[1] == 'L' || buf_ptr[1] == 'l')
|
|
||||||
+ {
|
|
||||||
+ buf_ptr+=2;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
else
|
|
||||||
{
|
|
||||||
while (*buf_ptr == 'U' || *buf_ptr == 'u' || *buf_ptr == 'L' || *buf_ptr == 'l')
|
|
||||||
--
|
|
||||||
1.7.6
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
|||||||
From 1394dd08b2284a0f83fac63025d19b66653d6585 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
|
||||||
Date: Tue, 19 Feb 2013 11:34:25 +0100
|
|
||||||
Subject: [PATCH 1/2] Fix compiler warnings
|
|
||||||
|
|
||||||
---
|
|
||||||
src/args.c | 6 ++++++
|
|
||||||
src/lexi.c | 10 ----------
|
|
||||||
2 files changed, 6 insertions(+), 10 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/args.c b/src/args.c
|
|
||||||
index f392cce..abd2a6a 100644
|
|
||||||
--- a/src/args.c
|
|
||||||
+++ b/src/args.c
|
|
||||||
@@ -62,6 +62,10 @@
|
|
||||||
/* Argument scanning and profile reading code. Default parameters are set
|
|
||||||
* here as well. */
|
|
||||||
|
|
||||||
+#ifndef _XOPEN_SOURCE
|
|
||||||
+#define _XOPEN_SOURCE 500 /* strdup(3) */
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
@@ -174,7 +178,9 @@ static int exp_o = 0;
|
|
||||||
static int exp_orig = 0;
|
|
||||||
static int exp_pcs = 0;
|
|
||||||
static int exp_pi = 0;
|
|
||||||
+#ifdef PRESERVE_MTIME
|
|
||||||
static int exp_pmt = 0;
|
|
||||||
+#endif
|
|
||||||
static int exp_pro = 0;
|
|
||||||
static int exp_prs = 0;
|
|
||||||
static int exp_psl = 0;
|
|
||||||
diff --git a/src/lexi.c b/src/lexi.c
|
|
||||||
index abc2bfa..ef80e38 100644
|
|
||||||
--- a/src/lexi.c
|
|
||||||
+++ b/src/lexi.c
|
|
||||||
@@ -198,11 +198,6 @@ int main (void)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Include code generated by gperf */
|
|
||||||
-#ifdef __GNUC__
|
|
||||||
-__inline
|
|
||||||
-#endif
|
|
||||||
-templ_ty *is_reserved (const char *str, unsigned int len);
|
|
||||||
-
|
|
||||||
#include "gperf.c"
|
|
||||||
|
|
||||||
/* Include code generated by gperf for C++ keyword set */
|
|
||||||
@@ -212,11 +207,6 @@ templ_ty *is_reserved (const char *str, unsigned int len);
|
|
||||||
#undef MIN_WORD_LENGTH
|
|
||||||
#undef MAX_WORD_LENGTH
|
|
||||||
|
|
||||||
-#ifdef __GNUC__
|
|
||||||
-__inline
|
|
||||||
-#endif
|
|
||||||
-templ_ty *is_reserved_cc (register const char *str, register unsigned int len);
|
|
||||||
-
|
|
||||||
#include "gperf-cc.c"
|
|
||||||
|
|
||||||
/**
|
|
||||||
--
|
|
||||||
1.8.1.2
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
|||||||
From 9e8a1699099f9aea5da11064e3aa9387ae9cffc6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
|
||||||
Date: Thu, 7 Mar 2013 11:32:02 +0100
|
|
||||||
Subject: [PATCH] Fix copying overlapping comment
|
|
||||||
|
|
||||||
Reformating block comments with -fca option triggered memcpy() on
|
|
||||||
overlapping areas.
|
|
||||||
|
|
||||||
E.g. comment:
|
|
||||||
|
|
||||||
/* Some statement. Unless it's special, arrange
|
|
||||||
* to break the line. */
|
|
||||||
|
|
||||||
from indent-2.2.11/indent.c hits it:
|
|
||||||
|
|
||||||
$ valgrind -- ./indent -o /dev/null -fca indent.c
|
|
||||||
Memcheck, a memory error detector
|
|
||||||
Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
|
|
||||||
Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
|
|
||||||
Command: ./indent -o /dev/null -fca indent.c
|
|
||||||
|
|
||||||
Source and destination overlap in memcpy(0x4c2c3c4, 0x4c2c3c9, 6)
|
|
||||||
at 0x4A0A230: memcpy@@GLIBC_2.14 (mc_replace_strmem.c:882)
|
|
||||||
by 0x404EA7: print_comment (comments.c:857)
|
|
||||||
by 0x40EB92: handle_token_comment (handletoken.c:2119)
|
|
||||||
by 0x40EF38: handle_the_token (handletoken.c:2315)
|
|
||||||
by 0x401FDB: indent_main_loop (indent.c:628)
|
|
||||||
by 0x4021CD: indent (indent.c:715)
|
|
||||||
by 0x402869: indent_single_file (indent.c:960)
|
|
||||||
by 0x4028F1: indent_all (indent.c:992)
|
|
||||||
by 0x4029E5: main (indent.c:1054)
|
|
||||||
---
|
|
||||||
src/comments.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/comments.c b/src/comments.c
|
|
||||||
index 01776e8..2ee8fc6 100644
|
|
||||||
--- a/src/comments.c
|
|
||||||
+++ b/src/comments.c
|
|
||||||
@@ -854,7 +854,7 @@ begin_line:
|
|
||||||
save_length--;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) memcpy (e_com, save_ptr, save_length);
|
|
||||||
+ (void) memmove (e_com, save_ptr, save_length);
|
|
||||||
text_on_line = e_com;
|
|
||||||
e_com += save_length;
|
|
||||||
|
|
||||||
--
|
|
||||||
1.8.1.4
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
From 138fedaef6d94f7fe1601a6eba90d6354a7fb4dd Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
|
||||||
Date: Mon, 9 Nov 2015 10:09:57 +0100
|
|
||||||
Subject: [PATCH] Fix -nbdfa and -nbdfe typo
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
<http://lists.gnu.org/archive/html/bug-indent/2015-11/msg00000.html>
|
|
||||||
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
doc/indent.texinfo | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/doc/indent.texinfo b/doc/indent.texinfo
|
|
||||||
index 08f35f6..50aaf61 100644
|
|
||||||
--- a/doc/indent.texinfo
|
|
||||||
+++ b/doc/indent.texinfo
|
|
||||||
@@ -1048,7 +1048,7 @@ appear at one indention level deeper than the function declaration. This
|
|
||||||
is particularly helpful for functions with long argument lists.
|
|
||||||
The option @option{-bfde} causes a newline to be forced before the closing
|
|
||||||
bracket of the function declaration. For both options the 'n' setting is the default:
|
|
||||||
--nbdfa and -nbdfe.
|
|
||||||
+-nbfda and -nbfde.
|
|
||||||
|
|
||||||
|
|
||||||
For
|
|
||||||
--
|
|
||||||
2.4.3
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
|||||||
From 7df0983c326f406dddbcc7c98dce72d5174d2a3c Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
|
||||||
Date: Wed, 18 Mar 2015 18:30:01 +0100
|
|
||||||
Subject: [PATCH] Modernize texi2html arguments
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
texi2html-5.0 complains on -number argument:
|
|
||||||
|
|
||||||
Option number is ambiguous (number-footnotes, number-sections)
|
|
||||||
|
|
||||||
This patch updates texi2html arguments to comply with texi2html-5.0.
|
|
||||||
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
|
|
||||||
diff --git a/doc/Makefile.am b/doc/Makefile.am
|
|
||||||
index d1fb09a..5eb9dc0 100644
|
|
||||||
--- a/doc/Makefile.am
|
|
||||||
+++ b/doc/Makefile.am
|
|
||||||
@@ -34,14 +34,14 @@ html-monolithic: @PACKAGE@.html
|
|
||||||
html-split: @PACKAGE@_toc.html
|
|
||||||
|
|
||||||
@PACKAGE@.html: version.texi $(@PACKAGE@_TEXINFOS)
|
|
||||||
- $(TEXI2HTML) -expandinfo -number -monolithic `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi`
|
|
||||||
+ $(TEXI2HTML) -expand info -number-sections -monolithic `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi`
|
|
||||||
|
|
||||||
@PACKAGE@_toc.html: version.texi $(@PACKAGE@_TEXINFOS)
|
|
||||||
case "$(TEXI2HTML)" in \
|
|
||||||
*"/missing texi2html") \
|
|
||||||
- $(TEXI2HTML) -expand info -number -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` || exit 0 ;; \
|
|
||||||
+ $(TEXI2HTML) -expand info -number-sections -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` || exit 0 ;; \
|
|
||||||
*) $(RM) @PACKAGE@_*.html ; \
|
|
||||||
- $(TEXI2HTML) -expand info -number -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` ;; \
|
|
||||||
+ $(TEXI2HTML) -expand info -number-sections -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` ;; \
|
|
||||||
esac
|
|
||||||
|
|
||||||
install-html-monolithic: @PACKAGE@.html
|
|
||||||
--
|
|
||||||
2.1.0
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
From c0001598a2b5b4cc8739beeb183f0d3f9c6a1d84 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
|
||||||
Date: Thu, 2 Feb 2012 17:12:44 +0100
|
|
||||||
Subject: [PATCH] Return non-zero exit code on tests failure
|
|
||||||
|
|
||||||
---
|
|
||||||
regression/TEST | 1 +
|
|
||||||
1 files changed, 1 insertions(+), 0 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/regression/TEST b/regression/TEST
|
|
||||||
index c860ef2..620e77f 100755
|
|
||||||
--- a/regression/TEST
|
|
||||||
+++ b/regression/TEST
|
|
||||||
@@ -441,6 +441,7 @@ then
|
|
||||||
cat $ERR
|
|
||||||
echo '**** Errors occured: ./output not removed'
|
|
||||||
echo
|
|
||||||
+ exit 1
|
|
||||||
else
|
|
||||||
cd ..
|
|
||||||
ls -l output
|
|
||||||
--
|
|
||||||
1.7.7.6
|
|
||||||
|
|
@ -1,166 +0,0 @@
|
|||||||
From 582ad604b72f1ce3c8d00ac0e964f28a8d615604 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
|
||||||
Date: Wed, 18 Mar 2015 16:29:49 +0100
|
|
||||||
Subject: [PATCH] Support hexadecimal floats
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
regression/TEST | 2 +-
|
|
||||||
regression/input/hexadecimal_float.c | 17 +++++++++
|
|
||||||
regression/standard/hexadecimal_float.c | 17 +++++++++
|
|
||||||
src/lexi.c | 63 ++++++++++++++++-----------------
|
|
||||||
4 files changed, 66 insertions(+), 33 deletions(-)
|
|
||||||
create mode 100644 regression/input/hexadecimal_float.c
|
|
||||||
create mode 100644 regression/standard/hexadecimal_float.c
|
|
||||||
|
|
||||||
diff --git a/regression/TEST b/regression/TEST
|
|
||||||
index 480ef7c..7db4c36 100755
|
|
||||||
--- a/regression/TEST
|
|
||||||
+++ b/regression/TEST
|
|
||||||
@@ -36,7 +36,7 @@ EXAMPLES="do.c else.c for.c func-def.c lshift.c ncs.c \
|
|
||||||
BUGS="case-label.c one-line-1.c one-line-2.c one-line-3.c \
|
|
||||||
one-line-4.c struct-decl.c sizeof-in-while.c line-break-comment.c \
|
|
||||||
macro.c enum.c elif.c nested.c wrapped-string.c minus_predecrement.c \
|
|
||||||
- float-constant-suffix.c"
|
|
||||||
+ float-constant-suffix.c hexadecimal_float.c"
|
|
||||||
|
|
||||||
INDENTSRC="args.c backup.h backup.c dirent_def.h globs.c indent.h \
|
|
||||||
indent.c indent_globs.h io.c lexi.c memcpy.c parse.c pr_comment.c \
|
|
||||||
diff --git a/regression/input/hexadecimal_float.c b/regression/input/hexadecimal_float.c
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..34c52cd
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/regression/input/hexadecimal_float.c
|
|
||||||
@@ -0,0 +1,17 @@
|
|
||||||
+/* Hexadecimal */
|
|
||||||
+double xpi = 0x1.921fb54442d18p+1;
|
|
||||||
+double xa = 0xe.fp-1;
|
|
||||||
+double xb = 0xe.fP-1;
|
|
||||||
+double xc = 0xf.P+1;
|
|
||||||
+double xd = 0x.fP+1;
|
|
||||||
+/* hexadecimal floats must have exponent part */
|
|
||||||
+
|
|
||||||
+/* Decimal */
|
|
||||||
+double dpi = 3.141592653589793e+0;
|
|
||||||
+double da = 1.2e-1;
|
|
||||||
+double db = 1.2E-1;
|
|
||||||
+double dc = 1.E+1;
|
|
||||||
+double dd = .1E+1;
|
|
||||||
+double de = 1.2;
|
|
||||||
+double df = 1.;
|
|
||||||
+double dg = .1;
|
|
||||||
diff --git a/regression/standard/hexadecimal_float.c b/regression/standard/hexadecimal_float.c
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..34c52cd
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/regression/standard/hexadecimal_float.c
|
|
||||||
@@ -0,0 +1,17 @@
|
|
||||||
+/* Hexadecimal */
|
|
||||||
+double xpi = 0x1.921fb54442d18p+1;
|
|
||||||
+double xa = 0xe.fp-1;
|
|
||||||
+double xb = 0xe.fP-1;
|
|
||||||
+double xc = 0xf.P+1;
|
|
||||||
+double xd = 0x.fP+1;
|
|
||||||
+/* hexadecimal floats must have exponent part */
|
|
||||||
+
|
|
||||||
+/* Decimal */
|
|
||||||
+double dpi = 3.141592653589793e+0;
|
|
||||||
+double da = 1.2e-1;
|
|
||||||
+double db = 1.2E-1;
|
|
||||||
+double dc = 1.E+1;
|
|
||||||
+double dd = .1E+1;
|
|
||||||
+double de = 1.2;
|
|
||||||
+double df = 1.;
|
|
||||||
+double dg = .1;
|
|
||||||
diff --git a/src/lexi.c b/src/lexi.c
|
|
||||||
index 0a98059..21e2c24 100644
|
|
||||||
--- a/src/lexi.c
|
|
||||||
+++ b/src/lexi.c
|
|
||||||
@@ -267,50 +267,49 @@ extern codes_ty lexi(void)
|
|
||||||
if (isdigit (*buf_ptr) ||
|
|
||||||
((buf_ptr[0] == '.') && isdigit (buf_ptr[1])))
|
|
||||||
{
|
|
||||||
- int seendot = 0, seenexp = 0;
|
|
||||||
+ int seendot = 0, seenexp = 0, ishexa = 0;
|
|
||||||
|
|
||||||
if ((*buf_ptr == '0') && ((buf_ptr[1] == 'x') || (buf_ptr[1] == 'X')))
|
|
||||||
{
|
|
||||||
- buf_ptr += 2;
|
|
||||||
- while (isxdigit (*buf_ptr))
|
|
||||||
- {
|
|
||||||
- buf_ptr++;
|
|
||||||
- }
|
|
||||||
+ ishexa = 1;
|
|
||||||
+ buf_ptr += 1;
|
|
||||||
}
|
|
||||||
- else
|
|
||||||
+ while (1)
|
|
||||||
{
|
|
||||||
- while (1)
|
|
||||||
+ if (*buf_ptr == '.')
|
|
||||||
{
|
|
||||||
- if (*buf_ptr == '.')
|
|
||||||
+ if (seendot)
|
|
||||||
{
|
|
||||||
- if (seendot)
|
|
||||||
- {
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- seendot++;
|
|
||||||
- }
|
|
||||||
+ break;
|
|
||||||
}
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ seendot++;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- buf_ptr++;
|
|
||||||
-
|
|
||||||
- if (!isdigit (*buf_ptr) && *buf_ptr != '.')
|
|
||||||
+ buf_ptr++;
|
|
||||||
+
|
|
||||||
+ if (!(ishexa && !seenexp ?
|
|
||||||
+ isxdigit (*buf_ptr) : isdigit (*buf_ptr)
|
|
||||||
+ ) && *buf_ptr != '.')
|
|
||||||
+ {
|
|
||||||
+ if ((ishexa ?
|
|
||||||
+ (*buf_ptr != 'P' && *buf_ptr != 'p') :
|
|
||||||
+ (*buf_ptr != 'E' && *buf_ptr != 'e')
|
|
||||||
+ ) || seenexp)
|
|
||||||
{
|
|
||||||
- if ((*buf_ptr != 'E' && *buf_ptr != 'e') || seenexp)
|
|
||||||
- {
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ seenexp++;
|
|
||||||
+ seendot++;
|
|
||||||
+ buf_ptr++;
|
|
||||||
+
|
|
||||||
+ if (*buf_ptr == '+' || *buf_ptr == '-')
|
|
||||||
{
|
|
||||||
- seenexp++;
|
|
||||||
- seendot++;
|
|
||||||
buf_ptr++;
|
|
||||||
-
|
|
||||||
- if (*buf_ptr == '+' || *buf_ptr == '-')
|
|
||||||
- {
|
|
||||||
- buf_ptr++;
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.1.0
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
From 5ddb9821391e7417bddd4388f78e810ea15a39d1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
|
||||||
Date: Thu, 2 Apr 2015 16:14:12 +0200
|
|
||||||
Subject: [PATCH] doc: Correct a typo about enabling control comment
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
<http://lists.gnu.org/archive/html/bug-indent/2015-04/msg00000.html>
|
|
||||||
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
doc/indent.texinfo | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/doc/indent.texinfo b/doc/indent.texinfo
|
|
||||||
index 08f35f6..15627e0 100644
|
|
||||||
--- a/doc/indent.texinfo
|
|
||||||
+++ b/doc/indent.texinfo
|
|
||||||
@@ -1463,7 +1463,7 @@ formatting for a section of a program, place the disabling control
|
|
||||||
comment @code{/* *INDENT-OFF* */} on a line by itself just before that
|
|
||||||
section. Program text scanned after this control comment is output
|
|
||||||
precisely as input with no modifications until the corresponding
|
|
||||||
-enabling comment is scanned on a line by itself. The disabling control
|
|
||||||
+enabling comment is scanned on a line by itself. The enabling control
|
|
||||||
comment is @code{/* *INDENT-ON* */}, and any text following the comment
|
|
||||||
on the line is also output unformatted. Formatting begins again with
|
|
||||||
the input line following the enabling control comment.
|
|
||||||
--
|
|
||||||
2.1.0
|
|
||||||
|
|
@ -0,0 +1,105 @@
|
|||||||
|
From d3982dea9e7dd01bae68983df38a40d374b168bb Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||||
|
Date: Thu, 13 Sep 2018 15:34:03 +0200
|
||||||
|
Subject: [PATCH] Add m4/ax_cc_for_build.m4 for CC_FOR_BUILD
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
CC_FOR_BUILD variable is used in man/Makefile.am.
|
||||||
|
m4/ax_cc_for_build.m4 macro file is missing from autoconf-2.69, thus
|
||||||
|
it is not possible to build indent after regenerating a build script
|
||||||
|
with autoreconf. We need to distribute the macro file in indent.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
m4/ax_cc_for_build.m4 | 77 +++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 77 insertions(+)
|
||||||
|
create mode 100644 m4/ax_cc_for_build.m4
|
||||||
|
|
||||||
|
diff --git a/m4/ax_cc_for_build.m4 b/m4/ax_cc_for_build.m4
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..c62ffad
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/m4/ax_cc_for_build.m4
|
||||||
|
@@ -0,0 +1,77 @@
|
||||||
|
+# ===========================================================================
|
||||||
|
+# https://www.gnu.org/software/autoconf-archive/ax_cc_for_build.html
|
||||||
|
+# ===========================================================================
|
||||||
|
+#
|
||||||
|
+# SYNOPSIS
|
||||||
|
+#
|
||||||
|
+# AX_CC_FOR_BUILD
|
||||||
|
+#
|
||||||
|
+# DESCRIPTION
|
||||||
|
+#
|
||||||
|
+# Find a build-time compiler. Sets CC_FOR_BUILD and EXEEXT_FOR_BUILD.
|
||||||
|
+#
|
||||||
|
+# LICENSE
|
||||||
|
+#
|
||||||
|
+# Copyright (c) 2010 Reuben Thomas <rrt@sc3d.org>
|
||||||
|
+# Copyright (c) 1999 Richard Henderson <rth@redhat.com>
|
||||||
|
+#
|
||||||
|
+# This program is free software: you can redistribute it and/or modify it
|
||||||
|
+# under the terms of the GNU General Public License as published by the
|
||||||
|
+# Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
+# option) any later version.
|
||||||
|
+#
|
||||||
|
+# This program is distributed in the hope that it will be useful, but
|
||||||
|
+# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||||
|
+# Public License for more details.
|
||||||
|
+#
|
||||||
|
+# You should have received a copy of the GNU General Public License along
|
||||||
|
+# with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
+#
|
||||||
|
+# As a special exception, the respective Autoconf Macro's copyright owner
|
||||||
|
+# gives unlimited permission to copy, distribute and modify the configure
|
||||||
|
+# scripts that are the output of Autoconf when processing the Macro. You
|
||||||
|
+# need not follow the terms of the GNU General Public License when using
|
||||||
|
+# or distributing such scripts, even though portions of the text of the
|
||||||
|
+# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||||
|
+# all other use of the material that constitutes the Autoconf Macro.
|
||||||
|
+#
|
||||||
|
+# This special exception to the GPL applies to versions of the Autoconf
|
||||||
|
+# Macro released by the Autoconf Archive. When you make and distribute a
|
||||||
|
+# modified version of the Autoconf Macro, you may extend this special
|
||||||
|
+# exception to the GPL to apply to your modified version as well.
|
||||||
|
+
|
||||||
|
+#serial 3
|
||||||
|
+
|
||||||
|
+dnl Get a default for CC_FOR_BUILD to put into Makefile.
|
||||||
|
+AC_DEFUN([AX_CC_FOR_BUILD],
|
||||||
|
+[# Put a plausible default for CC_FOR_BUILD in Makefile.
|
||||||
|
+if test -z "$CC_FOR_BUILD"; then
|
||||||
|
+ if test "x$cross_compiling" = "xno"; then
|
||||||
|
+ CC_FOR_BUILD='$(CC)'
|
||||||
|
+ else
|
||||||
|
+ CC_FOR_BUILD=gcc
|
||||||
|
+ fi
|
||||||
|
+fi
|
||||||
|
+AC_SUBST(CC_FOR_BUILD)
|
||||||
|
+# Also set EXEEXT_FOR_BUILD.
|
||||||
|
+if test "x$cross_compiling" = "xno"; then
|
||||||
|
+ EXEEXT_FOR_BUILD='$(EXEEXT)'
|
||||||
|
+else
|
||||||
|
+ AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
|
||||||
|
+ [rm -f conftest*
|
||||||
|
+ echo 'int main () { return 0; }' > conftest.c
|
||||||
|
+ bfd_cv_build_exeext=
|
||||||
|
+ ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
|
||||||
|
+ for file in conftest.*; do
|
||||||
|
+ case $file in
|
||||||
|
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
|
||||||
|
+ *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
|
||||||
|
+ esac
|
||||||
|
+ done
|
||||||
|
+ rm -f conftest*
|
||||||
|
+ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
|
||||||
|
+ EXEEXT_FOR_BUILD=""
|
||||||
|
+ test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
|
||||||
|
+fi
|
||||||
|
+AC_SUBST(EXEEXT_FOR_BUILD)])dnl
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
@ -1,12 +0,0 @@
|
|||||||
diff -burp indent-2.2.9/src/indent.c indent-2.2.9-lcall/src/indent.c
|
|
||||||
--- indent-2.2.9/src/indent.c 2006-02-01 14:20:25.000000000 +0100
|
|
||||||
+++ indent-2.2.9-lcall/src/indent.c 2006-02-01 14:08:52.000000000 +0100
|
|
||||||
@@ -3070,7 +3070,7 @@ int main (
|
|
||||||
exit_values_ty exit_status;
|
|
||||||
|
|
||||||
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) && defined (HAVE_LCCTYPES)
|
|
||||||
- setlocale(LC_MESSAGES, "");
|
|
||||||
+ setlocale(LC_ALL, "");
|
|
||||||
#endif
|
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
|
||||||
textdomain(PACKAGE);
|
|
Loading…
Reference in new issue