summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b50f370)
raw | patch | inline | side by side (parent: b50f370)
author | Junio C Hamano <gitster@pobox.com> | |
Thu, 19 Aug 2010 22:31:30 +0000 (15:31 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 19 Aug 2010 22:46:06 +0000 (15:46 -0700) |
These files mostly used ANSI style function definitions, but with small
number of old-style ones. Convert them to consistently use ANSI style.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
number of old-style ones. Convert them to consistently use ANSI style.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/regex/regcomp.c | patch | blob | history | |
compat/regex/regexec.c | patch | blob | history |
diff --git a/compat/regex/regcomp.c b/compat/regex/regcomp.c
index 4a80056e1f8444dffe194e541376ea88bfc55fa1..8c96ed942c3f7139a4b161c75c6c81e42530c085 100644 (file)
--- a/compat/regex/regcomp.c
+++ b/compat/regex/regcomp.c
are set in BUFP on entry. */
const char *
-re_compile_pattern (pattern, length, bufp)
- const char *pattern;
- size_t length;
- struct re_pattern_buffer *bufp;
+re_compile_pattern (const char *pattern,
+ size_t length,
+ struct re_pattern_buffer *bufp)
{
reg_errcode_t ret;
defined in regex.h. We return the old syntax. */
reg_syntax_t
-re_set_syntax (syntax)
- reg_syntax_t syntax;
+re_set_syntax (reg_syntax_t syntax)
{
reg_syntax_t ret = re_syntax_options;
#endif
int
-re_compile_fastmap (bufp)
- struct re_pattern_buffer *bufp;
+re_compile_fastmap (struct re_pattern_buffer *bufp)
{
re_dfa_t *dfa = (re_dfa_t *) bufp->buffer;
char *fastmap = bufp->fastmap;
the return codes and their meanings.) */
int
-regcomp (preg, pattern, cflags)
- regex_t *__restrict preg;
- const char *__restrict pattern;
- int cflags;
+regcomp (regex_t *__restrict preg,
+ const char *__restrict pattern,
+ int cflags)
{
reg_errcode_t ret;
reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED
/* Free dynamically allocated space used by PREG. */
void
-regfree (preg)
- regex_t *preg;
+regfree (regex_t *preg)
{
re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
if (BE (dfa != NULL, 1))
diff --git a/compat/regex/regexec.c b/compat/regex/regexec.c
index 0c2b054bce02cd433fa2a015feca3d1d52067964..b49585af760220db0bd92fb847e389291b67c10d 100644 (file)
--- a/compat/regex/regexec.c
+++ b/compat/regex/regexec.c
We return 0 if we find a match and REG_NOMATCH if not. */
int
-regexec (preg, string, nmatch, pmatch, eflags)
- const regex_t *__restrict preg;
- const char *__restrict string;
- size_t nmatch;
- regmatch_t pmatch[];
- int eflags;
+regexec (
+ const regex_t *__restrict preg,
+ const char *__restrict string,
+ size_t nmatch,
+ regmatch_t pmatch[],
+ int eflags)
{
reg_errcode_t err;
int start, length;
match was found and -2 indicates an internal error. */
int
-re_match (bufp, string, length, start, regs)
- struct re_pattern_buffer *bufp;
- const char *string;
- int length, start;
- struct re_registers *regs;
+re_match (struct re_pattern_buffer *bufp,
+ const char *string,
+ int length,
+ int start,
+ struct re_registers *regs)
{
return re_search_stub (bufp, string, length, start, 0, length, regs, 1);
}
#endif
int
-re_search (bufp, string, length, start, range, regs)
- struct re_pattern_buffer *bufp;
- const char *string;
- int length, start, range;
- struct re_registers *regs;
+re_search (struct re_pattern_buffer *bufp,
+ const char *string,
+ int length, int start, int range,
+ struct re_registers *regs)
{
return re_search_stub (bufp, string, length, start, range, length, regs, 0);
}
#endif
int
-re_match_2 (bufp, string1, length1, string2, length2, start, regs, stop)
- struct re_pattern_buffer *bufp;
- const char *string1, *string2;
- int length1, length2, start, stop;
- struct re_registers *regs;
+re_match_2 (struct re_pattern_buffer *bufp,
+ const char *string1, int length1,
+ const char *string2, int length2, int start,
+ struct re_registers *regs, int stop)
{
return re_search_2_stub (bufp, string1, length1, string2, length2,
start, 0, regs, stop, 1);
#endif
int
-re_search_2 (bufp, string1, length1, string2, length2, start, range, regs, stop)
- struct re_pattern_buffer *bufp;
- const char *string1, *string2;
- int length1, length2, start, range, stop;
- struct re_registers *regs;
+re_search_2 (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)
{
return re_search_2_stub (bufp, string1, length1, string2, length2,
start, range, regs, stop, 0);
#endif
static int
-re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs,
- stop, ret_len)
- struct re_pattern_buffer *bufp;
- const char *string1, *string2;
- int length1, length2, start, range, stop, ret_len;
- struct re_registers *regs;
+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)
{
const char *str;
int rval;
@@ -402,11 +398,10 @@ re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs,
otherwise the position of the match is returned. */
static int
-re_search_stub (bufp, string, length, start, range, stop, regs, ret_len)
- struct re_pattern_buffer *bufp;
- const char *string;
- int length, start, range, stop, ret_len;
- struct re_registers *regs;
+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)
{
reg_errcode_t result;
regmatch_t *pmatch;
}
static unsigned
-re_copy_regs (regs, pmatch, nregs, regs_allocated)
- struct re_registers *regs;
- regmatch_t *pmatch;
- int nregs, regs_allocated;
+re_copy_regs (struct re_registers *regs,
+ regmatch_t *pmatch,
+ int nregs, int regs_allocated)
{
int rval = REGS_REALLOCATE;
int i;
freeing the old data. */
void
-re_set_registers (bufp, regs, num_regs, starts, ends)
- struct re_pattern_buffer *bufp;
- struct re_registers *regs;
- unsigned num_regs;
- regoff_t *starts, *ends;
+re_set_registers (struct re_pattern_buffer *bufp,
+ struct re_registers *regs,
+ unsigned num_regs,
+ regoff_t *starts,
+ regoff_t *ends)
{
if (num_regs)
{
(START + RANGE >= 0 && START + RANGE <= LENGTH) */
static reg_errcode_t
-re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
- eflags)
- const regex_t *preg;
- const char *string;
- int length, start, range, stop, eflags;
- size_t nmatch;
- regmatch_t pmatch[];
+re_search_internal (const regex_t *preg,
+ const char *string,
+ int length, int start, int range, int stop,
+ size_t nmatch, regmatch_t pmatch[],
+ int eflags)
{
reg_errcode_t err;
const re_dfa_t *dfa = (const re_dfa_t *) preg->buffer;
}
static reg_errcode_t
-prune_impossible_nodes (mctx)
- re_match_context_t *mctx;
+prune_impossible_nodes (re_match_context_t *mctx)
{
const re_dfa_t *const dfa = mctx->dfa;
int halt_node, match_last;