diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 4d26210..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# indent - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index f7e0448..0000000 --- a/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# indent - -#### 介绍 -{**以下是码云平台说明,您可以替换此简介** -码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/indent-2.2.11-Allow-64-bit-stat.patch b/indent-2.2.11-Allow-64-bit-stat.patch new file mode 100644 index 0000000..077222b --- /dev/null +++ b/indent-2.2.11-Allow-64-bit-stat.patch @@ -0,0 +1,102 @@ +From 7ef312f8a721b99469ea85e33e973475006c6a7f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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 + #endif + #include ++#include ++#include + + #ifdef VMS + #include +@@ -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 + diff --git a/indent-2.2.11-Do-not-split-decimal-float-suffix-from-constant.patch b/indent-2.2.11-Do-not-split-decimal-float-suffix-from-constant.patch new file mode 100644 index 0000000..ea34d0e --- /dev/null +++ b/indent-2.2.11-Do-not-split-decimal-float-suffix-from-constant.patch @@ -0,0 +1,98 @@ +From ff47ab3b90333bdfaa40b86cb548e92a01787345 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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 + diff --git a/indent-2.2.11-Fix-compiler-warnings.patch b/indent-2.2.11-Fix-compiler-warnings.patch new file mode 100644 index 0000000..30dab2d --- /dev/null +++ b/indent-2.2.11-Fix-compiler-warnings.patch @@ -0,0 +1,66 @@ +From 1394dd08b2284a0f83fac63025d19b66653d6585 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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 + #include + #include +@@ -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 + diff --git a/indent-2.2.11-Fix-copying-overlapping-comment.patch b/indent-2.2.11-Fix-copying-overlapping-comment.patch new file mode 100644 index 0000000..56f02c8 --- /dev/null +++ b/indent-2.2.11-Fix-copying-overlapping-comment.patch @@ -0,0 +1,51 @@ +From 9e8a1699099f9aea5da11064e3aa9387ae9cffc6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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 + diff --git a/indent-2.2.11-Fix-nbdfa-and-nbdfe-typo.patch b/indent-2.2.11-Fix-nbdfa-and-nbdfe-typo.patch new file mode 100644 index 0000000..dca9795 --- /dev/null +++ b/indent-2.2.11-Fix-nbdfa-and-nbdfe-typo.patch @@ -0,0 +1,31 @@ +From 138fedaef6d94f7fe1601a6eba90d6354a7fb4dd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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 + + + +Signed-off-by: Petr Písař +--- + 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 + diff --git a/indent-2.2.11-Modernize-texi2html-arguments.patch b/indent-2.2.11-Modernize-texi2html-arguments.patch new file mode 100644 index 0000000..b199929 --- /dev/null +++ b/indent-2.2.11-Modernize-texi2html-arguments.patch @@ -0,0 +1,41 @@ +From 7df0983c326f406dddbcc7c98dce72d5174d2a3c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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ř + +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 + diff --git a/indent-2.2.11-Return-non-zero-exit-code-on-tests-failure.patch b/indent-2.2.11-Return-non-zero-exit-code-on-tests-failure.patch new file mode 100644 index 0000000..e3a7437 --- /dev/null +++ b/indent-2.2.11-Return-non-zero-exit-code-on-tests-failure.patch @@ -0,0 +1,24 @@ +From c0001598a2b5b4cc8739beeb183f0d3f9c6a1d84 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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 + diff --git a/indent-2.2.11-Support-hexadecimal-floats.patch b/indent-2.2.11-Support-hexadecimal-floats.patch new file mode 100644 index 0000000..c74b4e6 --- /dev/null +++ b/indent-2.2.11-Support-hexadecimal-floats.patch @@ -0,0 +1,166 @@ +From 582ad604b72f1ce3c8d00ac0e964f28a8d615604 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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ř +--- + 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 + diff --git a/indent-2.2.11-doc-Correct-a-typo-about-enabling-control-comment.patch b/indent-2.2.11-doc-Correct-a-typo-about-enabling-control-comment.patch new file mode 100644 index 0000000..c10956a --- /dev/null +++ b/indent-2.2.11-doc-Correct-a-typo-about-enabling-control-comment.patch @@ -0,0 +1,31 @@ +From 5ddb9821391e7417bddd4388f78e810ea15a39d1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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 + + + +Signed-off-by: Petr Písař +--- + 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 + diff --git a/indent-2.2.11.tar.gz b/indent-2.2.11.tar.gz new file mode 100644 index 0000000..2912e00 Binary files /dev/null and b/indent-2.2.11.tar.gz differ diff --git a/indent-2.2.9-lcall.patch b/indent-2.2.9-lcall.patch new file mode 100644 index 0000000..3fb5aca --- /dev/null +++ b/indent-2.2.9-lcall.patch @@ -0,0 +1,12 @@ +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); diff --git a/indent-2.2.9-man.patch b/indent-2.2.9-man.patch new file mode 100644 index 0000000..3d825f5 --- /dev/null +++ b/indent-2.2.9-man.patch @@ -0,0 +1,41 @@ +Only in indent-2.2.9/doc: all_opts +diff -Bburpd indent-2.2.9-orig/doc/indent.texinfo indent-2.2.9/doc/indent.texinfo +--- indent-2.2.9-orig/doc/indent.texinfo 2006-07-16 07:25:25.000000000 -0400 ++++ indent-2.2.9/doc/indent.texinfo 2006-07-16 07:57:33.000000000 -0400 +@@ -754,7 +754,7 @@ if (x > 0) + + @kindex -ce + @kindex --cuddle-else +-@kindex -dce ++@kindex -nce + @kindex --dont-cuddle-else + If you are using the @option{-br} option, you probably want to also use + the @option{-ce} option. This causes the @code{else} in an if-then-else +@@ -1666,6 +1666,11 @@ Line up continued lines at parentheses.@ + Leave space between @samp{#} and preprocessor directive.@* + @xref{Indentation}. + ++@item -nlps ++@itemx --remove-preprocessor-space ++Remove space between @samp{#} and preprocessor directive.@* ++@xref{Indentation}. ++ + @item -nbad + @itemx --no-blank-lines-after-declarations + Do not force blank lines after declarations.@* +@@ -1979,6 +1989,7 @@ the corresponding short option. + \line{ --preprocessor-indentation \leaderfill -ppi@var{n}\ } + \line{ --preserve-mtime \leaderfill -pmt\ } + \line{ --procnames-start-lines \leaderfill -psl\ } ++\line{ --remove-preprocessor-space \leaderfill -nlps\ } + \line{ --space-after-cast \leaderfill -cs\ \ } + \line{ --space-after-for \leaderfill -saf\ } + \line{ --space-after-if \leaderfill -sai\ } +@@ -2063,6 +2075,7 @@ the corresponding short option. + --preserve-mtime -pmt + --preprocessor-indentation -ppi@var{n} + --procnames-start-lines -psl ++--remove-preprocessor-space -nlps + --space-after-cast -cs + --space-after-for -saf + --space-after-if -sai diff --git a/indent.spec b/indent.spec new file mode 100644 index 0000000..a0ef9c4 --- /dev/null +++ b/indent.spec @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +Name: indent +Summary: A tool to make code easier to read +Version: 2.2.11 +Release: 27 +License: GPLv3+ +URL: http://www.gnu.org/software/%{name}/ + +Source: http://indent.isidore-it.eu/%{name}-%{version}.tar.gz + +Patch5: indent-2.2.9-lcall.patch +Patch7: indent-2.2.9-man.patch +Patch8: indent-2.2.11-Do-not-split-decimal-float-suffix-from-constant.patch +Patch9: indent-2.2.11-Return-non-zero-exit-code-on-tests-failure.patch +Patch10: indent-2.2.11-Fix-compiler-warnings.patch +Patch11: indent-2.2.11-Allow-64-bit-stat.patch +Patch12: indent-2.2.11-Fix-copying-overlapping-comment.patch +Patch13: indent-2.2.11-Support-hexadecimal-floats.patch +Patch14: indent-2.2.11-Modernize-texi2html-arguments.patch +Patch15: indent-2.2.11-doc-Correct-a-typo-about-enabling-control-comment.patch +Patch16: indent-2.2.11-Fix-nbdfa-and-nbdfe-typo.patch + +BuildRequires: gettext-devel automake gcc autoconf +BuildRequires: make coreutils gperf texinfo texi2html + +%description +The indent program can be used to make code easier to read. It +can also convert from one style of writing C to another. indent +understands a substantial amount about the syntax of C, but it +also attempts to cope with incomplete and misformed syntax. + +%package_help + +%prep +%autosetup -p1 +rm src/gperf.c src/gperf-cc.c +autoreconf -i -f + +%build +%configure CFLAGS='%optflags -D_FILE_OFFSET_BITS=64' +%make_build + +%install +%make_install + +%find_lang %name + +%check +make -C regression + +%files -f %{name}.lang +%license COPYING +%{_bindir}/%{name} +%exclude %{_bindir}/texinfo2man +%exclude %{_prefix}/doc/%{name}/%{name}.html +%exclude %{_prefix}/lib/debug/usr/bin/texinfo2man-%{version}-%{release}.aarch64.debug + +%files help +%doc AUTHORS NEWS README ChangeLog* +%{_mandir}/man1/%{name}.* +%{_infodir}/%{name}.info* +%exclude %{_infodir}/dir + +%changelog +* Tue Dec 3 2019 caomeng - 2.2.11-27 +- Package init