Mercurial > hg > xmms-sid
changeset 224:df4cb5115322
Removed duplicate function, more portability cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 15 Dec 2004 14:23:03 +0000 |
parents | 16e3b2446a73 |
children | 2986069309c6 |
files | src/xs_config.c src/xs_stil.c src/xs_support.c |
diffstat | 3 files changed, 13 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xs_config.c Wed Dec 15 14:18:00 2004 +0000 +++ b/src/xs_config.c Wed Dec 15 14:23:03 2004 +0000 @@ -213,11 +213,11 @@ xs_cfg.playMinTime = 15; xs_cfg.songlenDBEnable = FALSE; - xs_strcalloc(&xs_cfg.songlenDBPath, "~/C64Music/Songlengths.txt"); + xs_pstrcpy(&xs_cfg.songlenDBPath, "~/C64Music/Songlengths.txt"); xs_cfg.stilDBEnable = FALSE; - xs_strcalloc(&xs_cfg.stilDBPath, "~/C64Music/DOCUMENTS/STIL.txt"); - xs_strcalloc(&xs_cfg.hvscPath, "~/C64Music"); + xs_pstrcpy(&xs_cfg.stilDBPath, "~/C64Music/DOCUMENTS/STIL.txt"); + xs_pstrcpy(&xs_cfg.hvscPath, "~/C64Music"); #ifdef HAVE_SONG_POSITION xs_cfg.subsongControl = XS_SSC_PATCH; @@ -232,7 +232,7 @@ #else xs_cfg.titleOverride = TRUE; #endif - xs_strcalloc(&xs_cfg.titleFormat, "%p - %t (%c) [%n]"); + xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) [%n]"); /* Try to open the XMMS configuration file */ @@ -272,7 +272,7 @@ if (xmms_cfg_read_string(cfgFile, XS_CONFIG_IDENT, xs_cfgtable[i].itemName, (gchar **) &tmpStr)) { /* Read was successfull */ - xs_strcalloc((gchar **) xs_cfgtable[i].itemData, tmpStr); + xs_pstrcpy((gchar **) xs_cfgtable[i].itemData, tmpStr); g_free(tmpStr); } break; @@ -428,7 +428,7 @@ case WTYPE_TEXT: /* Get text from text-widget */ - xs_strcalloc((gchar **) xs_widtable[i].itemData, + xs_pstrcpy((gchar **) xs_widtable[i].itemData, gtk_entry_get_text(GTK_ENTRY(LUW(xs_widtable[i].widName))) ); break;
--- a/src/xs_stil.c Wed Dec 15 14:18:00 2004 +0000 +++ b/src/xs_stil.c Wed Dec 15 14:23:03 2004 +0000 @@ -91,28 +91,6 @@ } } -gint xs_strmcat(gchar **ppResult, gchar *pStr) -{ - assert(ppResult); - - /* Check the string pointers */ - if (!pStr) return -1; - - if (*ppResult != NULL) - { - *ppResult = (gchar *) g_realloc(*ppResult, strlen(*ppResult) + strlen(pStr) + 1); - if (*ppResult == NULL) return -1; - strcat(*ppResult, pStr); - } else - { - *ppResult = (gchar *) g_malloc(strlen(pStr) + 1); - if (*ppResult == NULL) return -1; - strcpy(*ppResult, pStr); - } - - return 0; -} - /* * Read database to memory @@ -232,19 +210,19 @@ { inLine[eolPos++] = '\n'; inLine[eolPos++] = 0; - xs_strmcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[2]); + xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[2]); } else if (strncmp(inLine, " ARTIST:", 8) == 0) { inLine[eolPos++] = '\n'; inLine[eolPos++] = 0; - xs_strmcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[1]); + xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[1]); } else if (strncmp(inLine, "COMMENT:", 8) == 0) - xs_strmcat(&(tmpNode->subTune[subEntry].pInfo), inLine); + xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), inLine); else if (strncmp(inLine, " ", 8) == 0) - xs_strmcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[8]); + xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[8]); break; }
--- a/src/xs_support.c Wed Dec 15 14:18:00 2004 +0000 +++ b/src/xs_support.c Wed Dec 15 14:23:03 2004 +0000 @@ -21,7 +21,7 @@ */ #include "xmms-sid.h" #include "xs_support.h" - +#include <ctype.h> /* Copy a string */ @@ -75,15 +75,13 @@ if (*ppResult != NULL) { - *ppResult = g_realloc(*ppResult, strlen(*ppResult) + strlen(pStr) + 1); + *ppResult = (gchar *) g_realloc(*ppResult, strlen(*ppResult) + strlen(pStr) + 1); if (*ppResult == NULL) return -1; - strcat(*ppResult, pStr); } else { - *ppResult = g_malloc(strlen(pStr) + 1); + *ppResult = (gchar *) g_malloc(strlen(pStr) + 1); if (*ppResult == NULL) return -1; - strcpy(*ppResult, pStr); }