1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 04:48:06 +01:00

Added a few 'const' to filename parameters for History functions

Name of file is, as usual, a read-only parameter.
This commit is contained in:
Christophe CURIS
2013-05-08 15:44:10 +02:00
committed by Carlos R. Mafra
parent ea19294b70
commit bcee010082

View File

@@ -167,7 +167,7 @@ typedef struct _WMInputPanelWithHistory {
int varpos;
} WMInputPanelWithHistory;
static char *HistoryFileName(char *name)
static char *HistoryFileName(const char *name)
{
char *filename = NULL;
@@ -185,7 +185,7 @@ static int strmatch(const void *str1, const void *str2)
return !strcmp((const char *)str1, (const char *)str2);
}
static WMArray *LoadHistory(char *filename, int max)
static WMArray *LoadHistory(const char *filename, int max)
{
WMPropList *plhistory;
WMPropList *plitem;
@@ -195,7 +195,7 @@ static WMArray *LoadHistory(char *filename, int max)
history = WMCreateArrayWithDestructor(1, wfree);
WMAddToArray(history, wstrdup(""));
plhistory = WMReadPropListFromFile((char *)filename);
plhistory = WMReadPropListFromFile(filename);
if (plhistory && WMIsPLArray(plhistory)) {
num = WMGetPropListItemCount(plhistory);
@@ -213,7 +213,7 @@ static WMArray *LoadHistory(char *filename, int max)
return history;
}
static void SaveHistory(WMArray * history, char *filename)
static void SaveHistory(WMArray * history, const char *filename)
{
int i;
WMPropList *plhistory;
@@ -223,7 +223,7 @@ static void SaveHistory(WMArray * history, char *filename)
for (i = 0; i < WMGetArrayItemCount(history); ++i)
WMAddToPLArray(plhistory, WMCreatePLString(WMGetFromArray(history, i)));
WMWritePropListToFile(plhistory, (char *)filename);
WMWritePropListToFile(plhistory, filename);
WMReleasePropList(plhistory);
}