From 63bffd83f04b258b547daca67f22423bbdfcd347 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 25 May 2022 00:05:20 +0200 Subject: grepc: Fix glitch with incorrectly indented code Avoid this glich from glibc: ./sysdeps/unix/sysv/linux/x86/sys/ucontext.h:133: typedef struct { gregset_t __ctx(gregs); /* Note that fpregs is a pointer. */ fpregset_t __ctx(fpregs); __extension__ unsigned long long __reserved1 [8]; } mcontext_t; /* Userlevel context. */ typedef struct ucontext_t { unsigned long int __ctx(uc_flags); struct ucontext_t *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; __extension__ unsigned long long int __ssp[4]; } ucontext_t; Signed-off-by: Alejandro Colomar --- bin/grepc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/grepc b/bin/grepc index c60e587..0781f5e 100755 --- a/bin/grepc +++ b/bin/grepc @@ -282,7 +282,7 @@ grepc_type_typedef_struct_union_enum() grepc_helper \ '^[ \t]*typedef\s+(struct|union|enum)\b[^;]*$' \ "^[ \t]*}\s*$1(\[[\w\(,\)]\])*;" \ - '(?s)^[ \t]*typedef\s+(struct|union|enum)\b(?:(?!\W'"$1"'\W)([\w \t[\]]|::))*\n*([ \t]*){(?:(?!^\3}).)*?^\3}\s*'"$1"'(\[[\w\(,\)]\])*;' \ + '(?s)^[ \t]*typedef\s+(struct|union|enum)\b(?:(?!\W'"$1"'\W)([\w \t[\]]|::))*\n*([ \t]*){(?:(?!^\3?}).)*?^\3}\s*'"$1"'(\[[\w\(,\)]\])*;' \ <"$files"; } @@ -341,7 +341,7 @@ grepc_use_func_def() grepc_helper \ "\b$1\b" \ '.' \ - '(?s)^[\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**\w+\s*\(([\w\s\(,\)[\]*]|::)+?(\.\.\.)?\)[ \t]*\n*([ \t]*){(?:(?!^\4}).)*'"$1"'.*?^\4}' \ + '(?s)^[\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**\w+\s*\(([\w\s\(,\)[\]*]|::)+?(\.\.\.)?\)[ \t]*\n*([ \t]*){(?:(?!^\4?}).)*'"$1"'.*?^\4}' \ <"$files"; } @@ -384,7 +384,7 @@ grepc_use_type_struct_union() grepc_helper \ "\b(struct|union)\b" \ "\b$1\b" \ - '(?s)^(?!^[ \t]*typedef\b)([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union)\b([\w \t[\]]|::)*\w+\n*([ \t]*){(?:(?!^\5}).)*?'"$1"'.*?^\5}.*?;' \ + '(?s)^(?!^[ \t]*typedef\b)([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union)\b([\w \t[\]]|::)*\w+\n*([ \t]*){(?:(?!^\5?}).)*?'"$1"'.*?^\5}.*?;' \ <"$files"; } @@ -404,7 +404,7 @@ grepc_use_type_typedef_struct_union() grepc_helper \ '^[ \t]*typedef\s+(struct|union)\b[^;]*$' \ "\b$1\b" \ - '(?s)^[ \t]*typedef\s+(struct|union)\b([\w \t[\]]|::)*\n*([ \t]*){(?:(?!^\3}|^\s*typedef).)*'"$1"'(?:(?!^\3}|^\s*typedef).)*^\3}\s*\w+;' \ + '(?s)^[ \t]*typedef\s+(struct|union)\b([\w \t[\]]|::)*\n*([ \t]*){(?:(?!^\3?}|^\s*typedef).)*'"$1"'(?:(?!^\3?}|^\s*typedef).)*^\3}\s*\w+;' \ <"$files"; } -- cgit v1.2.3