[geany/geany] 3dd1fb: Rename "mio" member of sInputFile to "fp"

Jiří Techet git-noreply at xxxxx
Sat Sep 10 07:25:59 UTC 2016


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Fri, 29 Jul 2016 22:32:59 UTC
Commit:      3dd1fb4853952d8fd80963952a03299e9b2c8012
             https://github.com/geany/geany/commit/3dd1fb4853952d8fd80963952a03299e9b2c8012

Log Message:
-----------
Rename "mio" member of sInputFile to "fp"


Modified Paths:
--------------
    ctags/main/get.c
    ctags/main/read.c
    ctags/main/read.h
    ctags/parsers/c.c

Modified: ctags/main/get.c
12 lines changed, 6 insertions(+), 6 deletions(-)
===================================================================
@@ -843,25 +843,25 @@ extern char *getArglistFromFilePos(MIOPos startPosition, const char *tokenName)
 	char *arglist = NULL;
 	long pos1, pos2;
 
-	pos2 = mio_tell(File.mio);
+	pos2 = mio_tell(File.fp);
 
-	mio_getpos(File.mio, &originalPosition);
-	mio_setpos(File.mio, &startPosition);
-	pos1 = mio_tell(File.mio);
+	mio_getpos(File.fp, &originalPosition);
+	mio_setpos(File.fp, &startPosition);
+	pos1 = mio_tell(File.fp);
 
 	if (pos2 > pos1)
 	{
 		size_t len = pos2 - pos1;
 
 		result = (char *) g_malloc(len + 1);
-		if (result != NULL && (len = mio_read(File.mio, result, 1, len)) > 0)
+		if (result != NULL && (len = mio_read(File.fp, result, 1, len)) > 0)
 		{
 			result[len] = '\0';
 			arglist = getArglistFromStr(result, tokenName);
 		}
 		g_free(result);
 	}
-	mio_setpos(File.mio, &originalPosition);
+	mio_setpos(File.fp, &originalPosition);
 	return arglist;
 }
 


Modified: ctags/main/read.c
52 lines changed, 26 insertions(+), 26 deletions(-)
===================================================================
@@ -35,12 +35,12 @@ static MIOPos StartOfLine;      /* holds deferred position of start of line */
 /* Read a character choosing automatically between file or buffer, depending
  * on which mode we are.
  */
-#define readNextChar() (mio_getc (File.mio))
+#define readNextChar() (mio_getc (File.fp))
 
 /* Replaces ungetc() for file. In case of buffer we'll perform the same action:
  * fpBufferPosition-- and write of the param char into the buf.
  */
-#define pushBackChar(c) (mio_ungetc (File.mio, c))
+#define pushBackChar(c) (mio_ungetc (File.fp, c))
 
 /*
 *   FUNCTION DEFINITIONS
@@ -260,22 +260,22 @@ extern boolean fileOpen (const char *const fileName, const langType language)
 
 	/*  If another file was already open, then close it.
 	 */
-	if (File.mio != NULL)
+	if (File.fp != NULL)
 	{
-		mio_free (File.mio);            /* close any open source file */
-		File.mio = NULL;
+		mio_free (File.fp);            /* close any open source file */
+		File.fp = NULL;
 	}
 
-	File.mio = mio_new_file_full (fileName, openMode, g_fopen, fclose);
-	if (File.mio == NULL)
+	File.fp = mio_new_file_full (fileName, openMode, g_fopen, fclose);
+	if (File.fp == NULL)
 		error (WARNING | PERROR, "cannot open \"%s\"", fileName);
 	else
 	{
 		opened = TRUE;
 
 		setInputFileName (fileName);
-		mio_getpos (File.mio, &StartOfLine);
-		mio_getpos (File.mio, &File.filePosition);
+		mio_getpos (File.fp, &StartOfLine);
+		mio_getpos (File.fp, &File.filePosition);
 		File.currentLine  = NULL;
 		File.lineNumber   = 0L;
 		File.eof          = FALSE;
@@ -305,9 +305,9 @@ extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size,
 		
 	/* Check whether a file of a buffer were already open, then close them.
 	 */
-	if (File.mio != NULL) {
-		mio_free (File.mio);            /* close any open source file */
-		File.mio = NULL;
+	if (File.fp != NULL) {
+		mio_free (File.fp);            /* close any open source file */
+		File.fp = NULL;
 	}
 
 	/* check if we got a good buffer */
@@ -318,10 +318,10 @@ extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size,
 		
 	opened = TRUE;
 			
-	File.mio = mio_new_memory (buffer, buffer_size, NULL, NULL);
+	File.fp = mio_new_memory (buffer, buffer_size, NULL, NULL);
 	setInputFileName (fileName);
-	mio_getpos (File.mio, &StartOfLine);
-	mio_getpos (File.mio, &File.filePosition);
+	mio_getpos (File.fp, &StartOfLine);
+	mio_getpos (File.fp, &File.filePosition);
 	File.currentLine  = NULL;
 	File.lineNumber   = 0L;
 	File.eof          = FALSE;
@@ -342,7 +342,7 @@ extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size,
 
 extern void fileClose (void)
 {
-	if (File.mio != NULL)
+	if (File.fp != NULL)
 	{
 		/*  The line count of the file is 1 too big, since it is one-based
 		 *  and is incremented upon each newline.
@@ -351,8 +351,8 @@ extern void fileClose (void)
 			addTotals (0, File.lineNumber - 1L,
 					  getFileSize (vStringValue (File.name)));
 
-		mio_free (File.mio);
-		File.mio = NULL;
+		mio_free (File.fp);
+		File.fp = NULL;
 	}
 }
 
@@ -393,7 +393,7 @@ static int iFileGetc (void)
 				goto readnext;
 			else
 			{
-				mio_setpos (File.mio, &StartOfLine);
+				mio_setpos (File.fp, &StartOfLine);
 
 				c = readNextChar ();
 			}
@@ -405,7 +405,7 @@ static int iFileGetc (void)
 	else if (c == NEWLINE)
 	{
 		File.newLine = TRUE;
-		mio_getpos (File.mio, &StartOfLine);
+		mio_getpos (File.fp, &StartOfLine);
 	}
 	else if (c == CRETURN)
 	{
@@ -420,7 +420,7 @@ static int iFileGetc (void)
 
 		c = NEWLINE;                            /* convert CR into newline */
 		File.newLine = TRUE;
-		mio_getpos (File.mio, &StartOfLine);
+		mio_getpos (File.fp, &StartOfLine);
 	}
 	DebugStatement ( debugPutc (DEBUG_RAW, c); )
 	return c;
@@ -615,14 +615,14 @@ extern char *readSourceLine (vString *const vLine, MIOPos location,
 	MIOPos orignalPosition;
 	char *result;
 
-	mio_getpos (File.mio, &orignalPosition);
-	mio_setpos (File.mio, &location);
+	mio_getpos (File.fp, &orignalPosition);
+	mio_setpos (File.fp, &location);
 	if (pSeekValue != NULL)
-		*pSeekValue = mio_tell (File.mio);
-	result = readLine (vLine, File.mio);
+		*pSeekValue = mio_tell (File.fp);
+	result = readLine (vLine, File.fp);
 	if (result == NULL)
 		error (FATAL, "Unexpected end of file: %s", vStringValue (File.name));
-	mio_setpos (File.mio, &orignalPosition);
+	mio_setpos (File.fp, &orignalPosition);
 
 	return result;
 }


Modified: ctags/main/read.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -67,7 +67,7 @@ typedef struct sInputFile {
 	vString *path;      /* path of input file (if any) */
 	vString *line;      /* last line read from file */
 	const unsigned char* currentLine;   /* current line being worked on */
-	MIO     *mio;       /* stream used for reading the file */
+	MIO     *fp;        /* stream used for reading the file */
 	unsigned long lineNumber;   /* line number in the input file */
 	MIOPos  filePosition;   /* file position of current line */
 	unsigned int ungetchIdx;


Modified: ctags/parsers/c.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -2586,7 +2586,7 @@ static int parseParens (statementInfo *const st, parenInfo *const info)
 		--depth;
 	}
 	if (st->argEndPosition == 0)
-		st->argEndPosition = mio_tell (File.mio);
+		st->argEndPosition = mio_tell (File.fp);
 
 	if (! info->isNameCandidate)
 		initToken (token);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list