summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2316824)
raw | patch | inline | side by side (parent: 2316824)
author | Johannes Sixt <j6t@kdbg.org> | |
Thu, 26 Aug 2010 07:58:26 +0000 (09:58 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 26 Aug 2010 16:25:53 +0000 (09:25 -0700) |
compat/regexec.c had a weird combination of function declaration in ANSI
style and function definition in K&R style, for example:
static unsigned
re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
int nregs, int regs_allocated) internal_function;
static unsigned
re_copy_regs (regs, pmatch, nregs, regs_allocated)
struct re_registers *regs;
regmatch_t *pmatch;
int nregs, regs_allocated;
{ ... }
with this #define:
#ifndef _LIBC
# ifdef __i386__
# define internal_function __attribute ((regparm (3), stdcall))
# else
# define internal_function
# endif
#endif
The original version as shown above was fine, but with the ANSIfied
function definition and in the case where internal_function is not empty,
gcc identifies the declaration and definition as different and bails out.
Adding internal_function to the definition doesn't help (it results in
a syntax error); hence, remove it from the subset of declarations that gcc
flags as erroneous.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
style and function definition in K&R style, for example:
static unsigned
re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
int nregs, int regs_allocated) internal_function;
static unsigned
re_copy_regs (regs, pmatch, nregs, regs_allocated)
struct re_registers *regs;
regmatch_t *pmatch;
int nregs, regs_allocated;
{ ... }
with this #define:
#ifndef _LIBC
# ifdef __i386__
# define internal_function __attribute ((regparm (3), stdcall))
# else
# define internal_function
# endif
#endif
The original version as shown above was fine, but with the ANSIfied
function definition and in the case where internal_function is not empty,
gcc identifies the declaration and definition as different and bails out.
Adding internal_function to the definition doesn't help (it results in
a syntax error); hence, remove it from the subset of declarations that gcc
flags as erroneous.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/regex/regexec.c | patch | blob | history |
diff --git a/compat/regex/regexec.c b/compat/regex/regexec.c
index b49585af760220db0bd92fb847e389291b67c10d..0194965c5d255a914de814f3e623698932f8a917 100644 (file)
--- a/compat/regex/regexec.c
+++ b/compat/regex/regexec.c
const char *string, int length,
int start, int range, int stop,
size_t nmatch, regmatch_t pmatch[],
- int eflags) internal_function;
+ int eflags);
static int re_search_2_stub (struct re_pattern_buffer *bufp,
const char *string1, int length1,
const char *string2, int length2,
int start, int range, struct re_registers *regs,
- int stop, int ret_len) internal_function;
+ int stop, int ret_len);
static int re_search_stub (struct re_pattern_buffer *bufp,
const char *string, int length, int start,
int range, int stop, struct re_registers *regs,
- int ret_len) internal_function;
+ int ret_len);
static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
- int nregs, int regs_allocated) internal_function;
-static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx)
- internal_function;
+ int nregs, int regs_allocated);
+static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx);
static int check_matching (re_match_context_t *mctx, int fl_longest_match,
int *p_match_first) internal_function;
static int check_halt_state_context (const re_match_context_t *mctx,