Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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: 1 addition & 1 deletion agrep.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ CHAR *agrep_saved_pattern = NULL; /* to prevent multiple prepfs for each boolean
#ifdef _WIN32
#include <direct.h>
#include <io.h>
#endif
int agrep_usage(); /* agrep.c */
int exec(); /* agrep.c */
int exponen(); /* agrep.c */
Expand All @@ -244,7 +245,6 @@ int sgrep(); /* sgrep.c */
int initialize_common(); /* dummyfil.c */
int tuncompressible_filename(); /* dummyfil.c */
int quick_tcompress(); /* dummyfil.c */
#endif

/* Called when multipattern search and pattern has not changed */

Expand Down
6 changes: 3 additions & 3 deletions agrephlp.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

#ifdef _WIN32
#include "conio.h"
int get_current_codepage(); /* codepage.c */
#endif
int get_current_codepage(); /* codepage.c */

#define CUL 0x4B00
#define CUP 0x4800
Expand Down Expand Up @@ -65,8 +65,8 @@ int get_current_codepage(); /* codepage.c */
#include "agrep.h"
#include "version.h"

extern AGREPOPT_STR[MAX_LINE_LEN];
extern VERBOSE;
extern char AGREPOPT_STR[MAX_LINE_LEN];
extern int VERBOSE;

#ifdef __EMX__
extern unsigned int _emx_env;
Expand Down
2 changes: 0 additions & 2 deletions asearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ extern int NEW_FILE, POST_FILTER;

extern int LIMITOUTPUT, LIMITPERFILE;

#ifdef _WIN32
int output(); /* agrep.c */
int asearch0(); /* asearch.c */
int fill_buf(); /* bitap.c */
#endif

int
asearch(old_D_pat, text, D)
Expand Down
2 changes: 0 additions & 2 deletions asearch1.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ extern int NEW_FILE, POST_FILTER;

extern int LIMITOUTPUT, LIMITPERFILE;

#ifdef _WIN32
int output(); /* agrep.c */
int fill_buf(); /* bitap.c */
#endif

int
asearch1(old_D_pat, Text, D)
Expand Down
3 changes: 2 additions & 1 deletion bitap.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ extern int NEW_FILE, POST_FILTER;

#ifdef _WIN32
#include <io.h>
#endif
int output(); /* agrep.c */
int re(); /* agrep.c */
int re1(); /* agrep.c */
int asearch(); /* asearch.c */
int asearch1(); /* asearch1.c */
int fill_buf(); /* bitap.c */
#endif

/* bitap dispatches job */

Expand Down Expand Up @@ -447,6 +447,7 @@ int fd, M, D;
#endif /*AGREP_POINTER*/
}

int
fill_buf(fd, buf, record_size)
int fd, record_size;
unsigned char *buf;
Expand Down
2 changes: 1 addition & 1 deletion codepage.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ char CP_MAPPING; /* -i option = case(in)sensitive search ?
unsigned char LUT[256]; /* THE LOOK-UP TABLE (filled in AGREP.C) */


int get_current_codepage(VOID)
int get_current_codepage(void)

#ifdef __EMX__

Expand Down
14 changes: 7 additions & 7 deletions compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

extern int D;
extern int FILENAMEONLY, APPROX, PAT_FILE, PAT_BUFFER, MULTI_OUTPUT, COUNT, INVERSE, BESTMATCH;
extern FILEOUT;
extern REGEX;
extern DELIMITER;
extern WHOLELINE;
extern LINENUM;
extern I, S, DD;
extern JUMP;
extern int FILEOUT;
extern int REGEX;
extern int DELIMITER;
extern int WHOLELINE;
extern int LINENUM;
extern int I, S, DD;
extern int JUMP;
extern char Progname[32];
extern int agrep_initialfd;
extern int EXITONERROR;
Expand Down
2 changes: 0 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ extern int EXITONERROR;
extern unsigned int _emx_env; /* this variable denotes the operating system DOS, OS/2 */
#endif

#ifdef _WIN32
int fileagrep(); /* agrep.c */
#endif

#ifndef _WIN32
int
Expand Down
2 changes: 1 addition & 1 deletion maskgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extern int CODEPAGE;
extern struct CODEPAGE_struct CP[CODEPAGES][CPSIZE];

extern unsigned D_endpos, endposition, Init1, wildmask;
extern Mask[], Bit[], Init[], NO_ERR_MASK;
extern unsigned Mask[], Bit[], Init[], NO_ERR_MASK;
extern int AND, REGEX, NOUPPER, D_length;
extern unsigned char Progname[];
extern int agrep_initialfd;
Expand Down
12 changes: 5 additions & 7 deletions newmgrep.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ extern CHAR D_pattern[MaxDelimit*2];
extern int D_length;
extern CHAR tc_D_pattern[MaxDelimit*2];
extern int tc_D_length;
extern COUNT, FNAME, SILENT, FILENAMEONLY, prev_num_of_matched, num_of_matched;
extern INVERSE, OUTTAIL;
extern WORDBOUND, WHOLELINE, NOUPPER;
extern int COUNT, FNAME, SILENT, FILENAMEONLY, prev_num_of_matched, num_of_matched;
extern int INVERSE, OUTTAIL;
extern int WORDBOUND, WHOLELINE, NOUPPER;
extern ParseTree *AParse;
extern int AComplexPattern;
extern unsigned char CurrentFileName[], Progname[];
extern total_line;
extern agrep_initialfd;
extern int total_line;
extern int agrep_initialfd;
extern int EXITONERROR;
extern int PRINTPATTERN;
extern int agrep_inlen;
Expand Down Expand Up @@ -119,12 +119,10 @@ extern int anum_terminals;
extern int AComplexBoolean;
static void countline(unsigned char *text, int len);

#ifdef _WIN32
int eval_tree(); /* asplit.c */
int fill_buf(); /* bitap.c */
int monkey1(); /* newmgrep.c */
int m_short(); /* newmgrep.c */
#endif

#if DOTCOMPRESSED
/* Equivalent variables for compression search */
Expand Down
2 changes: 1 addition & 1 deletion parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

#ifdef _WIN32
#include <memory.h>
#include <stdlib.h>
#endif

#include <stdio.h>
#include <stdlib.h>
#include "re.h"

#define FALSE 0
Expand Down
2 changes: 0 additions & 2 deletions preproce.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ extern ParseTree aterminals[MAXNUM_PAT];
extern char FREQ_FILE[MAX_LINE_LEN], HASH_FILE[MAX_LINE_LEN], STRING_FILE[MAX_LINE_LEN]; /* interfacing with tcompress */
extern int AComplexBoolean;

#ifdef _WIN32
int asplit_pattern(); /* asplit.c */
int asplit_terminal(); /* asplit.c */
int init(); /* follow.c */
void destroy_tree(); /* putils.c */
int quick_tcompress(); /* preproce.c */
#endif

int
preprocess(D_pattern, Pattern) /* need two parameters */
Expand Down
1 change: 1 addition & 0 deletions putils.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ get_token_bool(buffer, len, ptr, tokenbuf, tokenlen)
void
print_tree(t, level)
ParseTree *t;
int level;
{
int i;

Expand Down
5 changes: 3 additions & 2 deletions re.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
allows the fully ISO-Charset.
*/

#include <stdlib.h>
#include <string.h>

/*************************************************************
* *
* Macros defining special characters. *
Expand Down Expand Up @@ -72,8 +75,6 @@

#define new_node(type, l, x) \
{\
extern void *malloc();\
\
(l) = (type) malloc(sizeof(*(x)));\
if ((l) == NULL) {\
fprintf(stderr, "malloc failure in new_node\n");\
Expand Down
6 changes: 3 additions & 3 deletions recursiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "autoconf.h" /* ../libtemplate/include */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>

#if ISO_CHAR_SET
Expand Down Expand Up @@ -59,12 +61,10 @@

#ifdef _WIN32
#include "config.h"
#include <string.h>
#include <malloc.h>
#include <sys/types.h>
#include <sys/stat.h>
int exec(); /* agrep.c */
#endif
int exec(); /* agrep.c */

/*
* #include <sys/stat.h>
Expand Down
8 changes: 3 additions & 5 deletions sgrep.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ extern int CONSTANT, COUNT, FNAME, SILENT, FILENAMEONLY, prev_num_of_matched, nu
extern int DNA ; /* DNA flag is set in checksg when pattern is DNA pattern
and p_size > 16 */

extern WORDBOUND, WHOLELINE, NOUPPER;
extern int WORDBOUND, WHOLELINE, NOUPPER;
extern unsigned char CurrentFileName[], Progname[];
extern unsigned Mask[];
extern unsigned endposition;
Expand All @@ -123,7 +123,6 @@ extern void free_buf(int fd, char *sbuf);
extern unsigned char * backward_delimiter(unsigned char *end, unsigned char *begin, unsigned char *delim, int len, int outtail);
extern unsigned char * forward_delimiter(unsigned char *begin, unsigned char *end, unsigned char *delim, int len, int outtail);

#ifdef _WIN32
int fill_buf(); /* bitap.c */
int a_monkey(); /* sgrep.c */
int agrep(); /* sgrep.c */
Expand All @@ -133,7 +132,6 @@ int monkey(); /* sgrep.c */
int monkey4(); /* sgrep.c */
int s_output(); /* sgrep.c */
int verify(); /* sgrep.c */
#endif

#if MEASURE_TIMES
/* timing variables */
Expand Down Expand Up @@ -262,7 +260,7 @@ int *m;
int sgrep(in_pat, in_m, fd, D, samepattern)

CHARTYPE *in_pat;
int fd, in_m, D;
int fd, in_m, D, samepattern;
{
CHARTYPE patbuf[MAXLINE];
CHARTYPE *pat = patbuf;
Expand Down Expand Up @@ -1485,7 +1483,7 @@ CHARTYPE **lastout; /* in, out */
static void
prep_bm(Pattern, m)
unsigned char *Pattern;
register m;
register int m;
{
int i;
unsigned hash;
Expand Down
5 changes: 3 additions & 2 deletions utilitie.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
/* this file contains various utility functions for accessing
and manipulating regular expression syntax trees. */

#include <stdio.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "re.h"

#ifdef _WIN32
#include <malloc.h>
#include <process.h>
#include <string.h>
#endif

/************************************************************************/
Expand Down