changeset 330:e0abd282d6b7

Changed struct member name subTune -> subTunes
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 22 Sep 2005 01:44:00 +0000
parents 8fadb3f38445
children 5e82b21d1914
files src/xs_stil.c src/xs_stil.h
diffstat 2 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/xs_stil.c	Tue Jan 18 06:35:05 2005 +0000
+++ b/src/xs_stil.c	Thu Sep 22 01:44:00 2005 +0000
@@ -56,11 +56,11 @@
  if (pNode)
  	{
  	/* Free subtune information */
- 	for (i = 0; i < XS_STIL_MAXENTRY; i++)
+ 	for (i = 0; i <= XS_STIL_MAXENTRY; i++)
  		{
- 		g_free(pNode->subTune[i].pName);
- 		g_free(pNode->subTune[i].pAuthor);
- 		g_free(pNode->subTune[i].pInfo);
+ 		g_free(pNode->subTunes[i].pName);
+ 		g_free(pNode->subTunes[i].pAuthor);
+ 		g_free(pNode->subTunes[i].pInfo);
  		}
  	
  	g_free(pNode->pcFilename);
@@ -92,7 +92,7 @@
 
 /* Read database (additively) to given db-structure
  */
-#define XS_STILDB_MULTI if (isMulti) { isMulti = FALSE; xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), "\n"); }
+#define XS_STILDB_MULTI if (isMulti) { isMulti = FALSE; xs_pstrcat(&(tmpNode->subTunes[subEntry].pInfo), "\n"); }
 
 
 gint xs_stildb_read(t_xs_stildb *db, gchar *dbFilename)
@@ -165,7 +165,7 @@
 	 		subEntry = atol(&inLine[2]);
 
 		 	/* Sanity check */
-		 	if ((subEntry < 1) || (subEntry >= XS_STIL_MAXENTRY))
+		 	if ((subEntry < 1) || (subEntry > XS_STIL_MAXENTRY))
  				{
  				XSERR("Number of subEntry (%i) for '%s' is invalid\n", subEntry, tmpNode->pcFilename);
  				subEntry = 0;
@@ -202,15 +202,15 @@
  		{
 		XS_STILDB_MULTI
 		
- 		g_free(tmpNode->subTune[subEntry].pName);
- 		tmpNode->subTune[subEntry].pName = g_strdup(&inLine[9]);
+ 		g_free(tmpNode->subTunes[subEntry].pName);
+ 		tmpNode->subTunes[subEntry].pName = g_strdup(&inLine[9]);
  		} else
  	if (strncmp(inLine, " AUTHOR:", 8) == 0)
  		{
 		XS_STILDB_MULTI
 
- 		g_free(tmpNode->subTune[subEntry].pAuthor);
- 		tmpNode->subTune[subEntry].pAuthor = g_strdup(&inLine[9]);
+ 		g_free(tmpNode->subTunes[subEntry].pAuthor);
+ 		tmpNode->subTunes[subEntry].pAuthor = g_strdup(&inLine[9]);
  		} else
  	if (strncmp(inLine, "  TITLE:", 8) == 0)
  		{
@@ -218,7 +218,7 @@
 
  		inLine[eolPos++] = '\n';
  		inLine[eolPos++] = 0;
- 		xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[2]);
+ 		xs_pstrcat(&(tmpNode->subTunes[subEntry].pInfo), &inLine[2]);
 		} else
  	if (strncmp(inLine, " ARTIST:", 8) == 0)
  		{
@@ -226,18 +226,18 @@
  			
  		inLine[eolPos++] = '\n';
  		inLine[eolPos++] = 0;
- 		xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[1]);
+ 		xs_pstrcat(&(tmpNode->subTunes[subEntry].pInfo), &inLine[1]);
  		} else
  	if (strncmp(inLine, "COMMENT:", 8) == 0)
  		{
 		XS_STILDB_MULTI
 
  		isMulti = TRUE;
- 		xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), inLine);
+ 		xs_pstrcat(&(tmpNode->subTunes[subEntry].pInfo), inLine);
  		} else
  	if (strncmp(inLine, "        ", 8) == 0)
  		{
- 		xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[8]);
+ 		xs_pstrcat(&(tmpNode->subTunes[subEntry].pInfo), &inLine[8]);
  		}
  	break;
  }
--- a/src/xs_stil.h	Tue Jan 18 06:35:05 2005 +0000
+++ b/src/xs_stil.h	Thu Sep 22 01:44:00 2005 +0000
@@ -18,7 +18,7 @@
 
 typedef struct _t_xs_stil_node {
 	gchar			*pcFilename;
-	t_xs_stil_subnode	subTune[XS_STIL_MAXENTRY];
+	t_xs_stil_subnode	subTunes[XS_STIL_MAXENTRY+1];
 	struct _t_xs_stil_node	*pPrev, *pNext;
 } t_xs_stil_node;