This commit is contained in:
parent
9967f9a71a
commit
19bf7f2690
85
indent-2.2.10-cdw.diff
Normal file
85
indent-2.2.10-cdw.diff
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
--- indent-2.2.10/src/indent.c
|
||||||
|
+++ indent-2.2.10/src/indent.c
|
||||||
|
@@ -1033,13 +1033,10 @@
|
||||||
|
|
||||||
|
if (!*sp_sw)
|
||||||
|
{ /* if not if for (;;) */
|
||||||
|
- do
|
||||||
|
- {
|
||||||
|
if (parse (semicolon) != total_success)
|
||||||
|
{
|
||||||
|
*file_exit_value = indent_error;
|
||||||
|
}
|
||||||
|
- } while(0);
|
||||||
|
|
||||||
|
*force_nl = true; /* force newline after a end of stmt */
|
||||||
|
}
|
||||||
|
@@ -2818,6 +2815,18 @@
|
||||||
|
return file_exit_value; /* RETURN */
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (type_code == sp_paren
|
||||||
|
+ && parser_state_tos->p_stack[parser_state_tos->tos] == dohead
|
||||||
|
+ && parser_state_tos->last_token == rbrace)
|
||||||
|
+ {
|
||||||
|
+ /* This is closing `while' of `do {stuff;} while'
|
||||||
|
+ statement (not `do stuff; while' command). In -cdw, we
|
||||||
|
+ want to suppress newline. */
|
||||||
|
+ if (settings.cuddle_do_while)
|
||||||
|
+ force_nl = false;
|
||||||
|
+ parser_state_tos->in_closing_br_while = true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if ((type_code != comment) &&
|
||||||
|
(type_code != cplus_comment) &&
|
||||||
|
(type_code != newline) &&
|
||||||
|
--- indent-2.2.10/src/indent.h
|
||||||
|
+++ indent-2.2.10/src/indent.h
|
||||||
|
@@ -420,6 +420,9 @@
|
||||||
|
BOOLEAN in_decl; /*!< set to true when we are in a declaration
|
||||||
|
* statement. The processing of braces is then
|
||||||
|
* slightly different */
|
||||||
|
+ BOOLEAN in_closing_br_while; /*!< set to true when we are parsing
|
||||||
|
+ * closing while of do {} while
|
||||||
|
+ * statement*/
|
||||||
|
int in_stmt; /*!< set to 1 while in a stmt */
|
||||||
|
int in_parameter_declaration;
|
||||||
|
int ind_level; /*!< the current indentation level in spaces */
|
||||||
|
--- indent-2.2.10/src/parse.c
|
||||||
|
+++ indent-2.2.10/src/parse.c
|
||||||
|
@@ -69,6 +69,7 @@
|
||||||
|
parser_state_tos->cstk = (int *) xmalloc (INITIAL_STACK_SIZE * sizeof (int));
|
||||||
|
parser_state_tos->paren_indents_size = 8;
|
||||||
|
parser_state_tos->paren_indents = (short *) xmalloc (parser_state_tos->paren_indents_size * sizeof (short));
|
||||||
|
+ parser_state_tos->in_closing_br_while = false;
|
||||||
|
|
||||||
|
/* Although these are supposed to grow if we reach the end,
|
||||||
|
* I can find no place in the code which does this. */
|
||||||
|
@@ -428,6 +429,14 @@
|
||||||
|
|
||||||
|
parser_state_tos->ind_level = parser_state_tos->i_l_follow;
|
||||||
|
parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow;
|
||||||
|
+
|
||||||
|
+ if (parser_state_tos->in_closing_br_while
|
||||||
|
+ && settings.cuddle_do_while
|
||||||
|
+ && !settings.btype_2)
|
||||||
|
+ {
|
||||||
|
+ parser_state_tos->ind_level += settings.brace_indent;
|
||||||
|
+ }
|
||||||
|
+ parser_state_tos->in_closing_br_while = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ /* it is a while loop */
|
||||||
|
@@ -457,6 +466,12 @@
|
||||||
|
parser_state_tos->p_stack[parser_state_tos->tos] = elsehead;
|
||||||
|
/* remember if with else */
|
||||||
|
parser_state_tos->search_brace = true;
|
||||||
|
+
|
||||||
|
+ if (settings.cuddle_else
|
||||||
|
+ && !settings.btype_2)
|
||||||
|
+ {
|
||||||
|
+ parser_state_tos->ind_level += settings.brace_indent;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
11
indent-2.2.10-lcall.diff
Normal file
11
indent-2.2.10-lcall.diff
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- src/indent.c
|
||||||
|
+++ src/indent.c
|
||||||
|
@@ -3290,7 +3290,7 @@
|
||||||
|
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);
|
51
indent-2.2.10-man.diff
Normal file
51
indent-2.2.10-man.diff
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
--- doc/indent.texinfo
|
||||||
|
+++ doc/indent.texinfo
|
||||||
|
@@ -776,7 +776,7 @@
|
||||||
|
|
||||||
|
@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
|
||||||
|
@@ -1805,6 +1805,11 @@
|
||||||
|
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.@*
|
||||||
|
@@ -1977,6 +1982,11 @@
|
||||||
|
Specify the indentation for preprocessor conditional statements.
|
||||||
|
@xref{Indentation}.
|
||||||
|
|
||||||
|
+@item -ppi@var{n}
|
||||||
|
+@itemx --preprocessor-indentation@var{n}
|
||||||
|
+Request indentation of preprocessor conditional statements.@*
|
||||||
|
+@xref{Indentation}.
|
||||||
|
+
|
||||||
|
@item -prs
|
||||||
|
@itemx --space-after-parentheses
|
||||||
|
Put a space after every '(' and before every ')'.@*
|
||||||
|
@@ -2138,6 +2148,7 @@
|
||||||
|
\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\ }
|
||||||
|
@@ -2229,6 +2240,7 @@
|
||||||
|
--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
|
11
indent-2.2.10-nothing_is_void.diff
Normal file
11
indent-2.2.10-nothing_is_void.diff
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- indent-2.2.9/man/texinfo2man.c
|
||||||
|
+++ indent-2.2.9/man/texinfo2man.c
|
||||||
|
@@ -162,7 +162,7 @@
|
||||||
|
|
||||||
|
static char value_updated[64], value_edition[64], value_version[64];
|
||||||
|
|
||||||
|
-process_texi (FILE * in)
|
||||||
|
+void process_texi (FILE * in)
|
||||||
|
{
|
||||||
|
char buf[1024];
|
||||||
|
int in_block = 0;
|
25
indent-2.2.10-warnings.diff
Normal file
25
indent-2.2.10-warnings.diff
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
--- src/output.c
|
||||||
|
+++ src/output.c
|
||||||
|
@@ -71,7 +71,7 @@
|
||||||
|
|
||||||
|
RCSTAG_CC ("$Id$");
|
||||||
|
|
||||||
|
-static FILE * output = NULL;
|
||||||
|
+ FILE * output = NULL;
|
||||||
|
static BOOLEAN inhibited = 0;
|
||||||
|
static buf_break_st_ty * buf_break_list = NULL;
|
||||||
|
|
||||||
|
@@ -749,11 +749,11 @@
|
||||||
|
|
||||||
|
if (s[0] == '/' && (s[1] == '*' || s[1] == '/'))
|
||||||
|
{
|
||||||
|
- fprintf (output, "%.*s", e_lab - s, s);
|
||||||
|
+ fprintf (output, "%.*s", (int) (e_lab - s), s);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
- fprintf (output, "/* %.*s */", e_lab - s, s);
|
||||||
|
+ fprintf (output, "/* %.*s */", (int) (e_lab - s), s);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* no need to update cur_col: the very next thing will
|
3
indent-2.2.10.tar.bz2
Normal file
3
indent-2.2.10.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:37e60cae161071fb68739fffbe3e518d8a17dab4b0209d84e6ad1e5f4007394b
|
||||||
|
size 531877
|
@ -1,33 +0,0 @@
|
|||||||
--- indent-2.2.9/man/texinfo2man.c
|
|
||||||
+++ indent-2.2.9/man/texinfo2man.c
|
|
||||||
@@ -162,7 +162,7 @@
|
|
||||||
|
|
||||||
static char value_updated[64], value_edition[64], value_version[64];
|
|
||||||
|
|
||||||
-process_texi (FILE * in)
|
|
||||||
+void process_texi (FILE * in)
|
|
||||||
{
|
|
||||||
char buf[1024];
|
|
||||||
int in_block = 0;
|
|
||||||
--- indent-2.2.9/src/output.c
|
|
||||||
+++ indent-2.2.9/src/output.c
|
|
||||||
@@ -1206,7 +1206,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-extern inhibit_indenting(
|
|
||||||
+extern void inhibit_indenting(
|
|
||||||
BOOLEAN flag)
|
|
||||||
{
|
|
||||||
inhibited = flag;
|
|
||||||
--- indent-2.2.9/src/output.h
|
|
||||||
+++ indent-2.2.9/src/output.h
|
|
||||||
@@ -47,7 +47,7 @@
|
|
||||||
struct stat * file_stats,
|
|
||||||
const char * filename);
|
|
||||||
|
|
||||||
-extern inhibit_indenting(
|
|
||||||
+extern void inhibit_indenting(
|
|
||||||
BOOLEAN flag);
|
|
||||||
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
--- src/indent.c 2002-10-28 21:00:56.000000000 +0100
|
|
||||||
+++ src/indent.c 2004-03-04 19:55:14.000000000 +0100
|
|
||||||
@@ -875,6 +875,7 @@
|
|
||||||
* imply we are in a stmt */
|
|
||||||
for (t_ptr = s_code; *t_ptr; ++t_ptr)
|
|
||||||
{
|
|
||||||
+ check_lab_size();
|
|
||||||
*e_lab++ = *t_ptr; /* turn everything so far into a label */
|
|
||||||
}
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
|||||||
--- src/output.c
|
|
||||||
+++ src/output.c
|
|
||||||
@@ -15,6 +15,8 @@
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <utime.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
+#include <stdlib.h>
|
|
||||||
+#include <time.h>
|
|
||||||
|
|
||||||
#include "indent.h"
|
|
||||||
#include "sys.h"
|
|
||||||
@@ -23,7 +25,7 @@
|
|
||||||
|
|
||||||
RCSTAG_CC ("$Id: output.c,v 1.5 2002/12/12 17:36:49 david Exp $");
|
|
||||||
|
|
||||||
-static FILE * output = NULL;
|
|
||||||
+FILE * output = NULL;
|
|
||||||
static BOOLEAN inhibited = 0;
|
|
||||||
static buf_break_st_ty * buf_break_list = NULL;
|
|
||||||
|
|
||||||
@@ -737,11 +739,11 @@
|
|
||||||
|
|
||||||
if (s[0] == '/' && (s[1] == '*' || s[1] == '/'))
|
|
||||||
{
|
|
||||||
- fprintf (output, "%.*s", e_lab - s, s);
|
|
||||||
+ fprintf (output, "%.*s", (int) (e_lab - s), s);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
- fprintf (output, "/* %.*s */", e_lab - s, s);
|
|
||||||
+ fprintf (output, "/* %.*s */", (int) (e_lab - s), s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* no need to update cur_col: the very next thing will
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:b9c35b553ed67f186765645344788739cbaf01f3f69a0a9273fe5f9f5e6f5257
|
|
||||||
size 497615
|
|
@ -1,3 +1,14 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Aug 5 12:09:45 CEST 2008 - prusnak@suse.cz
|
||||||
|
|
||||||
|
- updated to 2.2.10
|
||||||
|
* added --indent-label and --linux-style options to control
|
||||||
|
indentation of goto labels and supply a canned set of settings
|
||||||
|
that closely matches the preferred style for the linux kernel
|
||||||
|
* GPLv3 is used now
|
||||||
|
- removed obsoleted patches:
|
||||||
|
* overflow.patch (included in update)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Feb 24 18:10:35 CET 2008 - crrodriguez@suse.de
|
Sun Feb 24 18:10:35 CET 2008 - crrodriguez@suse.de
|
||||||
|
|
||||||
|
56
indent.spec
56
indent.spec
@ -1,10 +1,17 @@
|
|||||||
#
|
#
|
||||||
# spec file for package indent (Version 2.2.9)
|
# spec file for package indent (Version 2.2.10)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# This file and all modifications and additions to the pristine
|
|
||||||
# package are under the same license as the package itself.
|
|
||||||
#
|
#
|
||||||
|
# All modifications and additions to the file contributed by third parties
|
||||||
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
|
# upon. The license for this file, and modifications and additions to the
|
||||||
|
# file, is the same license as for the pristine package itself (unless the
|
||||||
|
# license for the pristine package is not an Open Source License, in which
|
||||||
|
# case the license is the MIT License). An "Open Source License" is a
|
||||||
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -12,15 +19,17 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: indent
|
Name: indent
|
||||||
License: GPL v2 or later
|
License: GPL v3 or later
|
||||||
Group: Development/Languages/C and C++
|
Group: Development/Languages/C and C++
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
Version: 2.2.9
|
Version: 2.2.10
|
||||||
Release: 288
|
Release: 1
|
||||||
Source: %{name}-%{version}.tar.bz2
|
Source: %{name}-%{version}.tar.bz2
|
||||||
Patch: %{name}-%{version}-overflow.patch
|
Patch0: %{name}-%{version}-nothing_is_void.diff
|
||||||
Patch1: %{name}-%{version}-nothing_is_void.diff
|
Patch1: %{name}-%{version}-warnings.diff
|
||||||
Patch2: %{name}-%{version}-warnings.diff
|
Patch2: %{name}-%{version}-lcall.diff
|
||||||
|
Patch3: %{name}-%{version}-cdw.diff
|
||||||
|
Patch4: %{name}-%{version}-man.diff
|
||||||
Url: ftp://ftp.gnu.org/pub/gnu/indent/
|
Url: ftp://ftp.gnu.org/pub/gnu/indent/
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Summary: Indent Formats C Source Code
|
Summary: Indent Formats C Source Code
|
||||||
@ -36,24 +45,29 @@ incomplete and malformed syntax.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch
|
%patch0 -p1
|
||||||
%patch1 -p1
|
%patch1
|
||||||
%patch2
|
%patch2
|
||||||
|
%patch3 -p1
|
||||||
|
%patch4
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"
|
|
||||||
%configure --with-pic
|
%configure --with-pic
|
||||||
|
# Parallel make doesn't work
|
||||||
make
|
make
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make DESTDIR=$RPM_BUILD_ROOT/ install
|
make DESTDIR=$RPM_BUILD_ROOT install
|
||||||
# indent.html is installed with %doc below
|
# indent.html is installed with %doc below
|
||||||
rm $RPM_BUILD_ROOT/usr/doc/indent/indent.html
|
rm -f $RPM_BUILD_ROOT/usr/doc/indent/indent.html $RPM_BUILD_ROOT%{_bindir}/texinfo2man $RPM_BUILD_ROOT/%{_infodir}/dir
|
||||||
rm $RPM_BUILD_ROOT/usr/bin/texinfo2man
|
mv $RPM_BUILD_ROOT%{_datadir}/locale/zh_TW.Big5 $RPM_BUILD_ROOT%{_datadir}/locale/zh_TW
|
||||||
mv $RPM_BUILD_ROOT/usr/share/locale/zh_TW.Big5 \
|
|
||||||
$RPM_BUILD_ROOT/usr/share/locale/zh_TW
|
|
||||||
%find_lang %{name}
|
%find_lang %{name}
|
||||||
|
|
||||||
|
%check
|
||||||
|
echo =============== TEST BEGIN ===============
|
||||||
|
make -C regression
|
||||||
|
echo =============== TEST END ===============
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
@ -71,6 +85,14 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_mandir}/man1/indent.1.gz
|
%{_mandir}/man1/indent.1.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 05 2008 prusnak@suse.cz
|
||||||
|
- updated to 2.2.10
|
||||||
|
* added --indent-label and --linux-style options to control
|
||||||
|
indentation of goto labels and supply a canned set of settings
|
||||||
|
that closely matches the preferred style for the linux kernel
|
||||||
|
* GPLv3 is used now
|
||||||
|
- removed obsoleted patches:
|
||||||
|
* overflow.patch (included in update)
|
||||||
* Sun Feb 24 2008 crrodriguez@suse.de
|
* Sun Feb 24 2008 crrodriguez@suse.de
|
||||||
- use find_lang macro
|
- use find_lang macro
|
||||||
* Wed Jan 25 2006 mls@suse.de
|
* Wed Jan 25 2006 mls@suse.de
|
||||||
|
Loading…
Reference in New Issue
Block a user