Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions regex/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DisableFormat: true
SortIncludes: Never
13 changes: 4 additions & 9 deletions regex/collate.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ struct __collate_st_chain_pri __collate_chain_pri_table[TABLE_SIZE];
void __collate_err(int ex, const char *f);

int
__collate_load_tables(encoding)
char *encoding;
__collate_load_tables(char *encoding)
{
char buf[PATH_MAX];
FILE *fp;
Expand Down Expand Up @@ -113,8 +112,7 @@ __collate_load_tables(encoding)
}

u_char *
__collate_substitute(s)
const u_char *s;
__collate_substitute(const u_char *s)
{
int dest_len, len, nlen;
int delta = strlen((const char *) s);
Expand Down Expand Up @@ -143,9 +141,7 @@ __collate_substitute(s)
}

void
__collate_lookup(t, len, prim, sec)
const u_char *t;
int *len, *prim, *sec;
__collate_lookup(const u_char *t, int *len, int *prim, int *sec)
{
struct __collate_st_chain_pri *p2;

Expand All @@ -165,8 +161,7 @@ __collate_lookup(t, len, prim, sec)
}

u_char *
__collate_strdup(s)
u_char *s;
__collate_strdup(u_char *s)
{
u_char *t = (u_char *) strdup((const char *) s);

Expand Down
10 changes: 5 additions & 5 deletions regex/collate.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ extern struct __collate_st_char_pri __collate_char_pri_table[UCHAR_MAX + 1];
extern struct __collate_st_chain_pri __collate_chain_pri_table[TABLE_SIZE];

__BEGIN_DECLS
u_char *__collate_strdup(u_char *);
u_char *__collate_substitute(const u_char *);
int __collate_load_tables(char *);
void __collate_lookup(const u_char *, int *, int *, int *);
int __collate_range_cmp(int, int);
u_char *__collate_strdup(u_char *s);
u_char *__collate_substitute(const u_char *s);
int __collate_load_tables(char *encoding);
void __collate_lookup(const u_char *t, int *len, int *prim, int *sec);
int __collate_range_cmp(int c1, int c2);
#ifdef COLLATE_DEBUG
void __collate_print_tables(void);
#endif
Expand Down
3 changes: 1 addition & 2 deletions regex/collcmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
* "[a-z]"-type ranges with national characters.
*/

int __collate_range_cmp (c1, c2)
int c1, c2;
int __collate_range_cmp(int c1, int c2)
{
static char s1[2], s2[2];
int ret;
Expand Down
74 changes: 21 additions & 53 deletions regex/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,8 @@ static char *pchar(int ch);
== size_t nmatch, regmatch_t pmatch[], int eflags);
*/
static int /* 0 success, REG_NOMATCH failure */
matcher(g, string, nmatch, pmatch, eflags)
struct re_guts *g;
char *string;
size_t nmatch;
regmatch_t pmatch[];
int eflags;
matcher(struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[],
int eflags)
{
char *endp;
int i;
Expand Down Expand Up @@ -346,12 +342,7 @@ int eflags;
== char *stop, sopno startst, sopno stopst);
*/
static char * /* == stop (success) always */
dissect(m, start, stop, startst, stopst)
struct match *m;
char *start;
char *stop;
sopno startst;
sopno stopst;
dissect(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
{
int i;
sopno ss; /* start sop of current subRE */
Expand Down Expand Up @@ -539,13 +530,12 @@ sopno stopst;
== char *stop, sopno startst, sopno stopst, sopno lev);
*/
static char * /* == stop (success) or NULL (failure) */
backref(m, start, stop, startst, stopst, lev)
struct match *m;
char *start;
char *stop;
sopno startst;
sopno stopst;
sopno lev; /* PLUS nesting level */
backref(struct match *m,
char *start,
char *stop,
sopno startst,
sopno stopst,
sopno lev /* PLUS nesting level */)
{
int i;
sopno ss; /* start sop of current subRE */
Expand Down Expand Up @@ -744,12 +734,7 @@ sopno lev; /* PLUS nesting level */
== char *stop, sopno startst, sopno stopst);
*/
static char * /* where tentative match ended, or NULL */
fast(m, start, stop, startst, stopst)
struct match *m;
char *start;
char *stop;
sopno startst;
sopno stopst;
fast(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
{
states st = m->st;
states fresh = m->fresh;
Expand Down Expand Up @@ -835,12 +820,7 @@ sopno stopst;
== char *stop, sopno startst, sopno stopst);
*/
static char * /* where it ended */
slow(m, start, stop, startst, stopst)
struct match *m;
char *start;
char *stop;
sopno startst;
sopno stopst;
slow(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
{
states st = m->st;
states empty = m->empty;
Expand Down Expand Up @@ -931,13 +911,12 @@ sopno stopst;
== #define NNONCHAR (CODEMAX-CHAR_MAX)
*/
static states
step(g, start, stop, bef, ch, aft)
struct re_guts *g;
sopno start; /* start state within strip */
sopno stop; /* state after stop state within strip */
states bef; /* states reachable before */
int ch; /* character or NONCHAR code */
states aft; /* states already known reachable after */
step(struct re_guts *g,
sopno start, /* start state within strip */
sopno stop, /* state after stop state within strip */
states bef, /* states reachable before */
int ch, /* character or NONCHAR code */
states aft /* states already known reachable after */)
{
cset *cs;
sop s;
Expand Down Expand Up @@ -1053,12 +1032,7 @@ states aft; /* states already known reachable after */
== #endif
*/
static void
print(m, caption, st, ch, d)
struct match *m;
char *caption;
states st;
int ch;
FILE *d;
print(struct match *m, char *caption, states st, int ch, FILE *d)
{
struct re_guts *g = m->g;
int i;
Expand Down Expand Up @@ -1086,13 +1060,8 @@ FILE *d;
== #endif
*/
static void
at(m, title, start, stop, startst, stopst)
struct match *m;
char *title;
char *start;
char *stop;
sopno startst;
sopno stopst;
at(struct match *m, char *title, char *start, char *stop, sopno startst,
sopno stopst)
{
if (!(m->eflags&REG_TRACE))
return;
Expand All @@ -1116,8 +1085,7 @@ sopno stopst;
* the non-debug compilation anyway, so it doesn't matter much.
*/
static char * /* -> representation */
pchar(ch)
int ch;
pchar(int ch)
{
static char pbuf[10];

Expand Down
12 changes: 3 additions & 9 deletions regex/fnmatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94";
#define RANGE_NOMATCH 0
#define RANGE_ERROR (-1)

static int rangematch(const char *, char, int, char **);
static int rangematch(const char *pattern, char test, int flags, char **newp);

int
fnmatch(pattern, string, flags)
const char *pattern, *string;
int flags;
fnmatch(const char *pattern, const char *string, int flags)
{
const char *stringstart;
char *newp;
Expand Down Expand Up @@ -163,11 +161,7 @@ fnmatch(pattern, string, flags)
}

static int
rangematch(pattern, test, flags, newp)
const char *pattern;
char test;
int flags;
char **newp;
rangematch(const char *pattern, char test, int flags, char **newp)
{
int negate, ok;
char c, c2;
Expand Down
Loading
Loading