Permalink
Browse files

Remove unused variables and static functions in various source files.

  • Loading branch information...
mleair committed Sep 13, 2017
1 parent f58bf5a commit 25bc87d0c445ea34e71ccab6d70a2ce67c176834
@@ -309,7 +309,6 @@ void
parse_arguments(const arg_parser_t *parser, int argc, char **argv)
{
int argindex = 1; /* Argument counter */
int next; /* Index of the next argument for convenience */
char *next_string; /* Next argument */
int x_index, x_value; /* Index to xflags array and value to set there */
@@ -804,7 +804,6 @@ static void
get_literal(char *buffer, size_t length, const char *s, int n, bool is_hex)
{
char *p = buffer;
bool saw_dot = false, saw_digit = false;
assert(length > 0);
while (n > 0 && isspace(*s)) {
++s;
View
@@ -101,7 +101,7 @@ __pg_get_lock(char *lname)
{
int r;
struct stat ss, ss1;
int count, force;
int count;
char *fullname;
if (udir == NULL || uname == NULL)
return;
@@ -112,7 +112,6 @@ __pg_get_lock(char *lname)
strcat(fullname, lname);
memset(&ss1, 0, sizeof(ss1));
count = 0;
force = 0;
do {
r = link(uname, fullname);
if (r != 0) {
View
@@ -79,11 +79,11 @@ addn(char *p, unsigned long val, int n)
return p;
} /* addn */
static int next = 0; /* counter of files created */
static long pgrand = 0;
static unsigned long pid = 0;
#if defined(USETEMPNAM) || defined(HOST_WIN) || defined(WIN64)
static int next = 0; /* counter of files created */
/*
* call tempnam to generate a filename using the prefix
@@ -175,7 +175,6 @@ extern long time(long *);
static char *
gentmp(char *pfx, char *sfx)
{
char *nulldir = (char *)0;
char *filename;
char *tmpdir;
char *p, *q;
@@ -267,7 +266,7 @@ char *
pg_newfile(char *pfx, char *sfx)
{
char *filename;
int fd, r;
int r;
while (1) {
filename = gentmp(pfx, sfx);
@@ -316,8 +315,7 @@ pg_makenewfile(char *pfx, char *sfx, int make)
if (fd >= 0) {
/* we have exclusive access, write something to create a nonempty file
*/
int ee;
ee = write(fd, "pgnf", 4);
write(fd, "nf", 2);
close(fd);
break;
}
@@ -345,7 +343,7 @@ char *
pg_makenewdir(char *pfx, char *sfx, int make)
{
char *filename;
int fd, r;
int r;
while (1) {
filename = gentmp(pfx, sfx);
View
@@ -20,7 +20,7 @@
long long
__mth_i_kpowi(long long x, int i)
{
int j, k;
int k;
long long f;
f = 1;
View
@@ -20,7 +20,7 @@
long long
__mth_i_kpowk(long long x, long long i)
{
int j, k;
int k;
long long f;
f = 1;
k = i;
View
@@ -101,26 +101,21 @@ _mp_ecs_nest(void)
void
_mp_cdeclp(void *blk, void ***blk_tp, int size)
{
void* ret;
ret = __kmpc_threadprivate_cached(0, __kmpc_global_thread_num(0), (void*)blk, (size_t)size, blk_tp);
__kmpc_threadprivate_cached(0, __kmpc_global_thread_num(0), (void*)blk, (size_t)size, blk_tp);
}
void
_mp_cdecli(void *blk, void ***blk_tp, int size)
{
void * ret;
ret = __kmpc_threadprivate_cached(0, __kmpc_global_thread_num(0), (void*)blk, (size_t)size, blk_tp);
__kmpc_threadprivate_cached(0, __kmpc_global_thread_num(0), (void*)blk, (size_t)size, blk_tp);
}
void
_mp_cdecl(void *blk, void ***blk_tp, int size)
{
void * ret;
ret = __kmpc_threadprivate_cached(0, __kmpc_global_thread_num(0), (void*)blk, (size_t)size, blk_tp);
__kmpc_threadprivate_cached(0, __kmpc_global_thread_num(0), (void*)blk, (size_t)size, blk_tp);
}
@@ -169,7 +164,7 @@ void
_mp_copypriv_move(void *blk_tp, int off, int size, int single_thread)
{
int lcpu;
char *to, *fr;
char *to;
char *garbage = 0;
if (single_thread != -1) { /* single thread */
@@ -193,7 +188,7 @@ void
_mp_copypriv_move_tls(void **blk_tp, int off, int size, int single_thread)
{
int lcpu;
char *to, *fr;
char *to;
char *garbage = 0;
if (single_thread != -1) { /* single thread */
@@ -339,9 +334,7 @@ void
_mp_copyin_move_cpp_tls(void *master, void* slave, int class_size,
int vector_size,assign_func_ptr assign_op)
{
int lcpu;
char *to, *fr;
char *garbage = 0;
int i;
fr = (char*)master;
View
@@ -21,7 +21,7 @@
float
__mth_i_rpowi(float x, int i)
{
int j, k;
int k;
float f;
f = 1;
View
@@ -21,7 +21,7 @@
float
__mth_i_rpowk(float x, long long i)
{
long long j, k;
long long k;
float f;
f = 1;
View
@@ -47,7 +47,6 @@ static struct opts opts[] = {{"debug", T_DEBUG | T_SIGNAL},
static int tracopt = 0;
static long sem = 0;
static char *fn; /* image name */
/* this routine allows a debugger to set a breakpoint before exit */
@@ -76,7 +75,8 @@ __abort(int sv, char *msg)
char cmd[128];
char *p;
int n;
int tid;
const char * dbg_env = "F90_TERM_DEBUG";
const char * dbg_cmd = "gdb -p %d";
if (msg != NULL) {
fprintf(__io_stderr(), "Error: %s\n", msg);
@@ -87,8 +87,8 @@ __abort(int sv, char *msg)
}
fflush(__io_stderr());
if (tracopt & T_DEBUG) {
p = getenv("F90_TERM_DEBUG");
p = (p == NULL ? "pgdbg -text -attach %d" : p);
p = getenv(dbg_env);
p = (char *)(p == NULL ? dbg_cmd : p);
sprintf(cmd, p, getpid());
system(cmd);
} else if (tracopt & T_TRACE) {
@@ -140,7 +140,6 @@ __abort_init(char *path)
struct opts *op;
int n;
int neg;
int v;
#if defined(WINNT)
fn = path;
@@ -97,7 +97,7 @@ __abort_trace(int skip)
void *array[MAXTRACE];
size_t size;
char **strings;
size_t i, n;
size_t i;
if (regs != (gregset_t *)0) {
dumpregs(regs);
@@ -185,7 +185,6 @@ direct_fini()
void
direct_rou_end(void)
{
int i;
/* CPLUS also needs to save routine's structure: */
if (flg.genilm) {
update_rou_begin();
@@ -683,8 +682,6 @@ rd_dir(DIRSET *dd)
int v;
int change;
int idx;
int i;
int c;
#undef ST_VAL
#undef ST_BV
@@ -97,10 +97,6 @@ error(error_code_t ecode, enum error_severity sev, int eline, const char *op1,
}
if (sev >= flg.inform) {
int lang = 0; /* default language: english */
if (XBIT(125, 16)) /* check for alternate language */
lang = 1;
if (gbl.curr_file != NULL) {
if (eline)
formatstr = "%s-%c-%04d-%s (%s: %d)";
@@ -262,7 +258,6 @@ interrf(enum error_severity sev, const char *fmt, ...)
size_t size;
char *buffer;
va_list ap;
size_t size2;
#if !DEBUG
if (sev == ERR_Informational)
@@ -174,8 +174,7 @@ stg_need(STG *stg)
if (stg->stg_cleared > stg->stg_avail)
stg->stg_cleared = stg->stg_avail;
if (stg->stg_avail > stg->stg_size) {
int oldsize, newsize;
oldsize = stg->stg_size;
int newsize;
newsize = (stg->stg_avail - 1) * 2;
/* reallocate stg and all its sidecars */
for (thisstg = stg; thisstg; thisstg = (STG *)thisstg->stg_sidecar) {
@@ -119,7 +119,6 @@ lookupsym(const char *name, int olength)
int length;
SPTR sptr; /* pointer to symbol table entry */
INT hashval; /* index into hashtb. */
char *np, *sp; /* pointer to symbol name characters */
/*
* Loop thru the appropriate hash link list to see if symbol is
@@ -217,9 +216,8 @@ installsym_ex(const char *name, int olength, IS_MODE mode)
int length;
SPTR sptr; /* pointer to symbol table entry */
INT hashval; /* index into hashtb. */
char *np, *sp; /* pointer to symbol name characters */
bool toolong;
int i, nmptr;
int nmptr;
static int max_idlen = MAXIDLEN;
/*
@@ -241,11 +239,8 @@ installsym_ex(const char *name, int olength, IS_MODE mode)
* Loop thru the appropriate hash link list to see if symbol is
* already in the table.
*/
int prev;
HASH_ID(hashval, name, length);
prev = 0;
for (sptr = stb.hashtb[hashval]; sptr != 0;
prev = sptr, sptr = HASHLKG(sptr)) {
for (sptr = stb.hashtb[hashval]; sptr != 0; sptr = HASHLKG(sptr)) {
const char *sname;
int np = NMPTRG(sptr);
if (np + length >= stb.namavl)
@@ -147,7 +147,6 @@ lookupsym(const char *name, int olength)
int length;
SPTR sptr; /* pointer to symbol table entry */
INT hashval; /* index into hashtb. */
char *np, *sp; /* pointer to symbol name characters */
/*
* Loop thru the appropriate hash link list to see if symbol is
@@ -247,9 +246,8 @@ installsym_ex(const char *name, int olength, IS_MODE mode)
int length;
SPTR sptr; /* pointer to symbol table entry */
INT hashval; /* index into hashtb. */
char *np, *sp; /* pointer to symbol name characters */
bool toolong;
int i, nmptr;
int nmptr;
static int max_idlen = MAXIDLEN;
/*
@@ -277,11 +275,8 @@ installsym_ex(const char *name, int olength, IS_MODE mode)
* Loop thru the appropriate hash link list to see if symbol is
* already in the table.
*/
int prev;
HASH_ID(hashval, name, length);
prev = 0;
for (sptr = stb.hashtb[hashval]; sptr != 0;
prev = sptr, sptr = HASHLKG(sptr)) {
for (sptr = stb.hashtb[hashval]; sptr != 0; sptr = HASHLKG(sptr)) {
const char *sname;
int np = NMPTRG(sptr);
if (np + length >= stb.namavl)
@@ -43,8 +43,6 @@ extern void wrilts();
void
bih_init(void)
{
int i;
STG_ALLOC(bihb, BIH, 128);
STG_SET_FREELINK(bihb, BIH, next);
BIH_LPCNTFROM(0) = 0;
@@ -441,21 +439,18 @@ unsplit(void)
}
#endif
for (bihx = gbl.entbih; bihx; bihx = BIH_NEXT(bihx)) {
int b, iltx;
int b;
if (BIH_LAST(bihx))
break;
for (b = bihx; b;) {
int next;
/* if 'bihx' ends in a branch or jump or call that can throw, stop here */
bihx = b;
if (!BIH_FT(bihx))
break;
if (BIH_ILTLAST(bihx) && ILT_BR_OR_CAN_THROW(BIH_ILTLAST(bihx)))
break;
next = BIH_NEXT(bihx);
b = merge_bih(bihx);
}
no_merge:;
}
} /* unsplit */
@@ -126,7 +126,6 @@ direct_fini()
void
direct_rou_end(void)
{
int i;
/* CPLUS also needs to save routine's structure: */
direct.lpg.avail = 1;
@@ -498,8 +497,6 @@ rd_dir(DIRSET *dd)
int v;
int change;
int idx;
int i;
int c;
#undef ST_VAL
#undef ST_BV
@@ -96,10 +96,6 @@ error(error_code_t ecode, enum error_severity sev, int eline, const char *op1,
}
if (sev >= flg.inform) {
int lang = 0; /* default language: english */
if (XBIT(125, 16)) /* check for alternate language */
lang = 1;
if (gbl.curr_file != NULL) {
if (eline)
formatstr = "%s-%c-%04d-%s (%s: %d)";
@@ -257,7 +253,6 @@ interrf(enum error_severity sev, const char *fmt, ...)
size_t size;
char *buffer;
va_list ap;
size_t size2;
#if !DEBUG
if (sev == ERR_Informational)
Oops, something went wrong.

0 comments on commit 25bc87d

Please sign in to comment.