From 967b572240513689fc2f6f9aefa929e7d54f6bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= Date: Sun, 7 Aug 2016 12:16:24 +0200 Subject: [PATCH] Rename MIO variables from fp to mio --- ctags/main/entry.c | 4 ++-- ctags/main/read.c | 14 +++++++------- ctags/main/read.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ctags/main/entry.c b/ctags/main/entry.c index a2085c0f75..d0706ccba1 100644 --- a/ctags/main/entry.c +++ b/ctags/main/entry.c @@ -366,8 +366,8 @@ extern void openTagFile (void) static int replacementTruncate (const char *const name, const long size) { char *tempName = NULL; - FILE *fp = tempFile ("w", &tempName); - fclose (fp); + MIO *mio = tempFile ("w", &tempName); + fclose (mio); copyFile (name, tempName, size); copyFile (tempName, name, WHOLE_FILE); remove (tempName); diff --git a/ctags/main/read.c b/ctags/main/read.c index 3d13756d9f..380d5b9fc4 100644 --- a/ctags/main/read.c +++ b/ctags/main/read.c @@ -247,7 +247,7 @@ static boolean parseLineDirective (void) */ /* This function opens an input file, and resets the line counter. If it - * fails, it will display an error message and leave the File.fp set to NULL. + * fails, it will display an error message and leave the File.mio set to NULL. */ extern boolean fileOpen (const char *const fileName, const langType language) { @@ -539,12 +539,12 @@ extern const unsigned char *readLineFromInputFile (void) /* * Raw file line reading with automatic buffer sizing */ -extern char *readLineRaw (vString *const vLine, MIO *const fp) +extern char *readLineRaw (vString *const vLine, MIO *const mio) { char *result = NULL; vStringClear (vLine); - if (fp == NULL) /* to free memory allocated to buffer */ + if (mio == NULL) /* to free memory allocated to buffer */ error (FATAL, "NULL file pointer"); else { @@ -560,13 +560,13 @@ extern char *readLineRaw (vString *const vLine, MIO *const fp) char *const pLastChar = vStringValue (vLine) + vStringSize (vLine) -2; long startOfLine; - startOfLine = mio_tell(fp); + startOfLine = mio_tell(mio); reReadLine = FALSE; *pLastChar = '\0'; - result = mio_gets (fp, vStringValue (vLine), (int) vStringSize (vLine)); + result = mio_gets (mio, vStringValue (vLine), (int) vStringSize (vLine)); if (result == NULL) { - if (! mio_eof (fp)) + if (! mio_eof (mio)) error (FATAL | PERROR, "Failure on attempt to read file"); } else if (*pLastChar != '\0' && @@ -575,7 +575,7 @@ extern char *readLineRaw (vString *const vLine, MIO *const fp) /* buffer overflow */ reReadLine = vStringAutoResize (vLine); if (reReadLine) - mio_seek (fp, startOfLine, SEEK_SET); + mio_seek (mio, startOfLine, SEEK_SET); else error (FATAL | PERROR, "input line too big; out of memory"); } diff --git a/ctags/main/read.h b/ctags/main/read.h index 5d2e30834e..2e1f298c54 100644 --- a/ctags/main/read.h +++ b/ctags/main/read.h @@ -114,7 +114,7 @@ extern int getNthPrevCFromInputFile (unsigned int nth, int def); extern int skipToCharacterInInputFile (int c); extern void ungetcToInputFile (int c); extern const unsigned char *readLineFromInputFile (void); -extern char *readLineRaw (vString *const vLine, MIO *const fp); +extern char *readLineRaw (vString *const vLine, MIO *const mio); extern char *readSourceLine (vString *const vLine, MIOPos location, long *const pSeekValue); extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, const char *const fileName, const langType language );