projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
prettyness police
[unix-history]
/
usr
/
src
/
usr.bin
/
ctags
/
fortran.c
diff --git
a/usr/src/usr.bin/ctags/fortran.c
b/usr/src/usr.bin/ctags/fortran.c
index
f635e40
..
eb838dd
100644
(file)
--- a/
usr/src/usr.bin/ctags/fortran.c
+++ b/
usr/src/usr.bin/ctags/fortran.c
@@
-1,38
+1,42
@@
/*
/*
- * Copyright (c) 1987
The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1987
, 1993
+ *
The Regents of the University of California.
All rights reserved.
*
* %sccs.include.redist.c%
*/
#ifndef lint
*
* %sccs.include.redist.c%
*/
#ifndef lint
-static char sccsid[] = "@(#)fortran.c
5.5
(Berkeley) %G%";
+static char sccsid[] = "@(#)fortran.c
8.2
(Berkeley) %G%";
#endif /* not lint */
#endif /* not lint */
+#include <ctype.h>
+#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
+
#include "ctags.h"
#include "ctags.h"
-static void takeprec
(
);
+static void takeprec
__P((void)
);
char *lbp; /* line buffer pointer */
char *lbp; /* line buffer pointer */
+int
PF_funcs()
{
PF_funcs()
{
- register bool pfcnt; /* pascal/fortran functions found */
- register char *cp;
- char tok[MAXTOKEN],
- *gettoken();
+ bool pfcnt; /* pascal/fortran functions found */
+ char *cp;
+ char tok[MAXTOKEN];
for (pfcnt = NO;;) {
lineftell = ftell(inf);
for (pfcnt = NO;;) {
lineftell = ftell(inf);
- if (!fgets(lbuf,
sizeof(lbuf),
inf))
- return(pfcnt);
+ if (!fgets(lbuf,
sizeof(lbuf),
inf))
+ return
(pfcnt);
++lineno;
lbp = lbuf;
if (*lbp == '%') /* Ratfor escape to fortran */
++lbp;
++lineno;
lbp = lbuf;
if (*lbp == '%') /* Ratfor escape to fortran */
++lbp;
- for (;isspace(*lbp);++lbp);
+ for (; isspace(*lbp); ++lbp)
+ continue;
if (!*lbp)
continue;
switch (*lbp | ' ') { /* convert to lower-case */
if (!*lbp)
continue;
switch (*lbp | ' ') { /* convert to lower-case */
@@
-42,7
+46,8
@@
PF_funcs()
break;
case 'd':
if (cicmp("double")) {
break;
case 'd':
if (cicmp("double")) {
- for (;isspace(*lbp);++lbp);
+ for (; isspace(*lbp); ++lbp)
+ continue;
if (!*lbp)
continue;
if (cicmp("precision"))
if (!*lbp)
continue;
if (cicmp("precision"))
@@
-63,7
+68,8
@@
PF_funcs()
takeprec();
break;
}
takeprec();
break;
}
- for (;isspace(*lbp);++lbp);
+ for (; isspace(*lbp); ++lbp)
+ continue;
if (!*lbp)
continue;
switch (*lbp | ' ') {
if (!*lbp)
continue;
switch (*lbp | ' ') {
@@
-81,16
+87,18
@@
PF_funcs()
default:
continue;
}
default:
continue;
}
- for (;isspace(*lbp);++lbp);
+ for (; isspace(*lbp); ++lbp)
+ continue;
if (!*lbp)
continue;
if (!*lbp)
continue;
- for (cp = lbp + 1;*cp && intoken(*cp);++cp);
+ for (cp = lbp + 1; *cp && intoken(*cp); ++cp)
+ continue;
if (cp = lbp + 1)
continue;
*cp = EOS;
if (cp = lbp + 1)
continue;
*cp = EOS;
- (void)strcpy(tok,lbp);
+ (void)strcpy(tok,
lbp);
getline(); /* process line for ex(1) */
getline(); /* process line for ex(1) */
- pfnote(tok,lineno);
+ pfnote(tok,
lineno);
pfcnt = YES;
}
/*NOTREACHED*/
pfcnt = YES;
}
/*NOTREACHED*/
@@
-100,30
+108,35
@@
PF_funcs()
* cicmp --
* do case-independent strcmp
*/
* cicmp --
* do case-independent strcmp
*/
+int
cicmp(cp)
cicmp(cp)
-
register char
*cp;
+
char
*cp;
{
{
-
register int
len;
-
register char
*bp;
+
int
len;
+
char
*bp;
- for (len = 0,bp = lbp;*cp && (*cp &~ ' ') == (*bp++ &~ ' ');
- ++cp,++len);
+ for (len = 0, bp = lbp; *cp && (*cp &~ ' ') == (*bp++ &~ ' ');
+ ++cp, ++len)
+ continue;
if (!*cp) {
lbp += len;
if (!*cp) {
lbp += len;
- return(YES);
+ return
(YES);
}
}
- return(NO);
+ return
(NO);
}
static void
takeprec()
{
}
static void
takeprec()
{
- for (;isspace(*lbp);++lbp);
+ for (; isspace(*lbp); ++lbp)
+ continue;
if (*lbp == '*') {
if (*lbp == '*') {
- for (++lbp;isspace(*lbp);++lbp);
+ for (++lbp; isspace(*lbp); ++lbp)
+ continue;
if (!isdigit(*lbp))
--lbp; /* force failure */
else
if (!isdigit(*lbp))
--lbp; /* force failure */
else
- while (isdigit(*++lbp));
+ while (isdigit(*++lbp))
+ continue;
}
}
}
}