1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-10 10:35:46 +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; int varpos;
} WMInputPanelWithHistory; } WMInputPanelWithHistory;
static char *HistoryFileName(char *name) static char *HistoryFileName(const char *name)
{ {
char *filename = NULL; char *filename = NULL;
@@ -185,7 +185,7 @@ static int strmatch(const void *str1, const void *str2)
return !strcmp((const char *)str1, (const char *)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 *plhistory;
WMPropList *plitem; WMPropList *plitem;
@@ -195,7 +195,7 @@ static WMArray *LoadHistory(char *filename, int max)
history = WMCreateArrayWithDestructor(1, wfree); history = WMCreateArrayWithDestructor(1, wfree);
WMAddToArray(history, wstrdup("")); WMAddToArray(history, wstrdup(""));
plhistory = WMReadPropListFromFile((char *)filename); plhistory = WMReadPropListFromFile(filename);
if (plhistory && WMIsPLArray(plhistory)) { if (plhistory && WMIsPLArray(plhistory)) {
num = WMGetPropListItemCount(plhistory); num = WMGetPropListItemCount(plhistory);
@@ -213,7 +213,7 @@ static WMArray *LoadHistory(char *filename, int max)
return history; return history;
} }
static void SaveHistory(WMArray * history, char *filename) static void SaveHistory(WMArray * history, const char *filename)
{ {
int i; int i;
WMPropList *plhistory; WMPropList *plhistory;
@@ -223,7 +223,7 @@ static void SaveHistory(WMArray * history, char *filename)
for (i = 0; i < WMGetArrayItemCount(history); ++i) for (i = 0; i < WMGetArrayItemCount(history); ++i)
WMAddToPLArray(plhistory, WMCreatePLString(WMGetFromArray(history, i))); WMAddToPLArray(plhistory, WMCreatePLString(WMGetFromArray(history, i)));
WMWritePropListToFile(plhistory, (char *)filename); WMWritePropListToFile(plhistory, filename);
WMReleasePropList(plhistory); WMReleasePropList(plhistory);
} }