Minor style changes.

This commit is contained in:
David Capello 2010-10-26 13:50:31 -07:00
parent c1598c01e6
commit e7db41ab66
3 changed files with 14 additions and 14 deletions

View File

@ -182,7 +182,7 @@ void reload_matrices_stock()
strcpy(leavings, "");
/* read the matrix name */
while (tok_read (f, buf, leavings, sizeof (leavings))) {
while (tok_read(f, buf, leavings, sizeof(leavings))) {
/* name of the matrix */
name = jstrdup(buf);

View File

@ -23,32 +23,32 @@
static int line_num;
static char *tok_fgets (char *buf, int size, FILE *file);
static char* tok_fgets(char* buf, int size, FILE* file);
void tok_reset_line_num ()
void tok_reset_line_num()
{
line_num = 0;
}
int tok_line_num ()
int tok_line_num()
{
return line_num;
}
char *tok_read (FILE *f, char *buf, char *leavings, int sizeof_leavings)
char* tok_read(FILE* f, char* buf, char* leavings, int sizeof_leavings)
{
int ch, len = 0;
char *s;
char* s;
*buf = 0;
if (feof (f))
if (feof(f))
return NULL;
while (!*buf) {
if (!*leavings) {
line_num++;
if (!tok_fgets (leavings, sizeof_leavings, f))
if (!tok_fgets(leavings, sizeof_leavings, f))
return NULL;
}
@ -59,7 +59,7 @@ char *tok_read (FILE *f, char *buf, char *leavings, int sizeof_leavings)
s++;
}
else if (ch == '#') {
s += strlen (s);
s += strlen(s);
break;
}
else if (ch == '\"') {
@ -68,7 +68,7 @@ char *tok_read (FILE *f, char *buf, char *leavings, int sizeof_leavings)
for (ch=*s; ; ch=*s) {
if (!ch) {
line_num++;
if (!tok_fgets (leavings, sizeof_leavings, f))
if (!tok_fgets(leavings, sizeof_leavings, f))
break;
else {
s = leavings;
@ -100,7 +100,7 @@ char *tok_read (FILE *f, char *buf, char *leavings, int sizeof_leavings)
}
}
memmove (leavings, s, strlen (s)+1);
memmove(leavings, s, strlen(s)+1);
}
buf[len] = 0;

View File

@ -21,9 +21,9 @@
#include <stdio.h>
void tok_reset_line_num ();
int tok_line_num ();
void tok_reset_line_num();
int tok_line_num();
char *tok_read (FILE *f, char *buf, char *leavings, int sizeof_leavings);
char* tok_read(FILE* f, char* buf, char* leavings, int sizeof_leavings);
#endif