From 6b4762086a3d5168385f521fa418b52189fc5f29 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 12 Nov 2008 15:15:42 +0800 Subject: [PATCH] shell32: Make some data static const. --- dlls/shell32/dialogs.c | 2 +- dlls/shell32/shellpath.c | 4 ++-- dlls/shell32/xdg.c | 4 ++-- dlls/shell32/xdg.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index a39b39210b1..d71f852fca0 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -118,7 +118,7 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline) { const WCHAR *src; WCHAR *dest, *result, *result_end=NULL; - static WCHAR dotexeW[] = {'.','e','x','e',0}; + static const WCHAR dotexeW[] = {'.','e','x','e',0}; result = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(strlenW(cmdline)+5)); diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 77e027b8e1a..09254f83fc6 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -2127,7 +2127,8 @@ static void _SHCreateSymbolicLinks(void) { UINT aidsMyStuff[] = { IDS_MYPICTURES, IDS_MYVIDEO, IDS_MYMUSIC }, i; int acsidlMyStuff[] = { CSIDL_MYPICTURES, CSIDL_MYVIDEO, CSIDL_MYMUSIC }; - static const char * xdg_dirs[] = { "PICTURES", "VIDEOS", "MUSIC", "DESKTOP" }; + static const char * const xdg_dirs[] = { "PICTURES", "VIDEOS", "MUSIC", "DESKTOP" }; + static const unsigned int num = sizeof(xdg_dirs) / sizeof(xdg_dirs[0]); WCHAR wszTempPath[MAX_PATH]; char szPersonalTarget[FILENAME_MAX], *pszPersonal; char szMyStuffTarget[FILENAME_MAX], *pszMyStuff; @@ -2135,7 +2136,6 @@ static void _SHCreateSymbolicLinks(void) struct stat statFolder; const char *pszHome; HRESULT hr; - const unsigned int num = sizeof(xdg_dirs) / sizeof(xdg_dirs[0]); char ** xdg_results; char * xdg_desktop_dir; diff --git a/dlls/shell32/xdg.c b/dlls/shell32/xdg.c index 6eb13a2864c..ba15a456b1b 100644 --- a/dlls/shell32/xdg.c +++ b/dlls/shell32/xdg.c @@ -781,7 +781,7 @@ static HRESULT get_xdg_config_file(char * home_dir, char ** config_file) * [in/out] p_ptr - pointer to where we are in the buffer * Returns the index to xdg_dirs if we find the key, or -1 on error. */ -static int parse_config1(const char ** xdg_dirs, const unsigned int num_dirs, char ** p_ptr) +static int parse_config1(const char * const *xdg_dirs, const unsigned int num_dirs, char ** p_ptr) { char *p; int i; @@ -884,7 +884,7 @@ static HRESULT parse_config2(char * p, const char * home_dir, char ** out_ptr) * [in] num_dirs - number of elements in xdg_dirs * [out] out_ptr - an array of the xdg directories names */ -HRESULT XDG_UserDirLookup(const char ** xdg_dirs, const unsigned int num_dirs, char *** out_ptr) +HRESULT XDG_UserDirLookup(const char * const *xdg_dirs, const unsigned int num_dirs, char *** out_ptr) { FILE *file; char **out; diff --git a/dlls/shell32/xdg.h b/dlls/shell32/xdg.h index 9ae2872baab..4ff2dba3674 100644 --- a/dlls/shell32/xdg.h +++ b/dlls/shell32/xdg.h @@ -47,6 +47,6 @@ HRESULT TRASH_UnpackItemID(LPCSHITEMID id, TRASH_ELEMENT *element, WIN32_FIND_DA HRESULT TRASH_EnumItems(LPITEMIDLIST **pidls, int *count); void TRASH_DisposeElement(TRASH_ELEMENT *element); -HRESULT XDG_UserDirLookup(const char ** xdg_dirs, const unsigned int num_dirs, char *** out_ptr); +HRESULT XDG_UserDirLookup(const char * const *xdg_dirs, const unsigned int num_dirs, char *** out_ptr); #endif /* ndef __XDG_H__ */ -- 2.11.4.GIT