Standardize on 'static const'
Francois Gouget
fgouget at free.fr
Wed Oct 5 11:26:21 CDT 2005
I have skipped the msi dll as I believe Mike McCormack may soon send a
similar patch for it.
Changelog:
* dlls/comctl32/rebar.c
dlls/comctl32/status.c
dlls/comctl32/tab.c
dlls/comctl32/theming.c
dlls/commdlg/filedlg.c
dlls/commdlg/printdlg.c
dlls/ole32/tests/storage32.c
dlls/shell32/enumidlist.c
dlls/shell32/shfldr_desktop.c
dlls/shell32/tests/shlfolder.c
programs/winefile/winefile.c
Francois Gouget <fgouget at free.fr>
Use "static const" rather than "const static" as gcc -W complains
about the former.
--
Francois Gouget fgouget at free.fr http://fgouget.free.fr/
$live{free} || die "";
-------------- next part --------------
Index: dlls/comctl32/rebar.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/rebar.c,v
retrieving revision 1.111
diff -u -p -r1.111 rebar.c
--- dlls/comctl32/rebar.c 20 Sep 2005 11:37:58 -0000 1.111
+++ dlls/comctl32/rebar.c 5 Oct 2005 10:29:08 -0000
@@ -1277,7 +1277,7 @@ REBAR_ForceResize (REBAR_INFO *infoPtr)
static VOID
REBAR_MoveChildWindows (REBAR_INFO *infoPtr, UINT start, UINT endplus)
{
- const static WCHAR strComboBox[] = { 'C','o','m','b','o','B','o','x',0 };
+ static const WCHAR strComboBox[] = { 'C','o','m','b','o','B','o','x',0 };
REBAR_BAND *lpBand;
WCHAR szClassName[40];
UINT i;
Index: dlls/comctl32/status.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/status.c,v
retrieving revision 1.75
diff -u -p -r1.75 status.c
--- dlls/comctl32/status.c 30 Aug 2005 10:07:17 -0000 1.75
+++ dlls/comctl32/status.c 5 Oct 2005 10:29:08 -0000
@@ -96,7 +96,7 @@ typedef struct
#define VERT_BORDER 2
#define HORZ_GAP 2
-const static WCHAR themeClass[] = { 'S','t','a','t','u','s',0 };
+static const WCHAR themeClass[] = { 'S','t','a','t','u','s',0 };
/* prototype */
static void
Index: dlls/comctl32/tab.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/tab.c,v
retrieving revision 1.119
diff -u -p -r1.119 tab.c
--- dlls/comctl32/tab.c 3 Oct 2005 18:46:07 -0000 1.119
+++ dlls/comctl32/tab.c 5 Oct 2005 10:29:08 -0000
@@ -2025,7 +2025,7 @@ static void TAB_DrawItem(
if ((theme = GetWindowTheme (infoPtr->hwnd))
&& ((lStyle & (TCS_VERTICAL | TCS_BOTTOM)) == 0))
{
- const static int partIds[8] = {
+ static const int partIds[8] = {
/* Normal item */
TABP_TABITEM,
TABP_TABITEMLEFTEDGE,
Index: dlls/comctl32/theming.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/theming.c,v
retrieving revision 1.9
diff -u -p -r1.9 theming.c
--- dlls/comctl32/theming.c 12 Sep 2005 11:10:58 -0000 1.9
+++ dlls/comctl32/theming.c 5 Oct 2005 10:29:08 -0000
@@ -91,7 +91,7 @@ MAKE_SUBCLASS_PROC(2)
MAKE_SUBCLASS_PROC(3)
MAKE_SUBCLASS_PROC(4)
-const static WNDPROC subclassProcs[NUM_SUBCLASSES] = {
+static const WNDPROC subclassProcs[NUM_SUBCLASSES] = {
subclass_proc0,
subclass_proc1,
subclass_proc2,
Index: dlls/commdlg/filedlg.c
===================================================================
RCS file: /var/cvs/wine/dlls/commdlg/filedlg.c,v
retrieving revision 1.114
diff -u -p -r1.114 filedlg.c
--- dlls/commdlg/filedlg.c 2 Sep 2005 11:33:51 -0000 1.114
+++ dlls/commdlg/filedlg.c 5 Oct 2005 10:29:08 -0000
@@ -2500,7 +2500,7 @@ static void FILEDLG95_FILETYPE_Clean(HWN
*/
static inline BOOL FILEDLG95_unixfs_is_rooted_at_desktop(void) {
HKEY hKey;
- const static WCHAR wszRootedAtDesktop[] = { 'S','o','f','t','w','a','r','e','\\',
+ static const WCHAR wszRootedAtDesktop[] = { 'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'E','x','p','l','o','r','e','r','\\','D','e','s','k','t','o','p','\\',
Index: dlls/commdlg/printdlg.c
===================================================================
RCS file: /var/cvs/wine/dlls/commdlg/printdlg.c,v
retrieving revision 1.95
diff -u -p -r1.95 printdlg.c
--- dlls/commdlg/printdlg.c 7 Sep 2005 11:31:18 -0000 1.95
+++ dlls/commdlg/printdlg.c 5 Oct 2005 10:29:08 -0000
@@ -1270,10 +1270,10 @@ static LRESULT PRINTDLG_WMInitDialog(HWN
static LRESULT PRINTDLG_WMInitDialogW(HWND hDlg, WPARAM wParam,
PRINT_PTRW* PrintStructures)
{
- const static WCHAR PD32_COLLATE[] = { 'P', 'D', '3', '2', '_', 'C', 'O', 'L', 'L', 'A', 'T', 'E', 0 };
- const static WCHAR PD32_NOCOLLATE[] = { 'P', 'D', '3', '2', '_', 'N', 'O', 'C', 'O', 'L', 'L', 'A', 'T', 'E', 0 };
- const static WCHAR PD32_PORTRAIT[] = { 'P', 'D', '3', '2', '_', 'P', 'O', 'R', 'T', 'R', 'A', 'I', 'T', 0 };
- const static WCHAR PD32_LANDSCAPE[] = { 'P', 'D', '3', '2', '_', 'L', 'A', 'N', 'D', 'S', 'C', 'A', 'P', 'E', 0 };
+ static const WCHAR PD32_COLLATE[] = { 'P', 'D', '3', '2', '_', 'C', 'O', 'L', 'L', 'A', 'T', 'E', 0 };
+ static const WCHAR PD32_NOCOLLATE[] = { 'P', 'D', '3', '2', '_', 'N', 'O', 'C', 'O', 'L', 'L', 'A', 'T', 'E', 0 };
+ static const WCHAR PD32_PORTRAIT[] = { 'P', 'D', '3', '2', '_', 'P', 'O', 'R', 'T', 'R', 'A', 'I', 'T', 0 };
+ static const WCHAR PD32_LANDSCAPE[] = { 'P', 'D', '3', '2', '_', 'L', 'A', 'N', 'D', 'S', 'C', 'A', 'P', 'E', 0 };
LPPRINTDLGW lppd = PrintStructures->lpPrintDlg;
DEVNAMES *pdn;
DEVMODEW *pdm;
@@ -2366,9 +2366,9 @@ _c_size2strA(PageSetupDataA *pda,DWORD s
}
static void
_c_size2strW(PageSetupDataW *pda,DWORD size,LPWSTR strout) {
- const static WCHAR UNDEF[] = { '<', 'u', 'n', 'd', 'e', 'f', '>', 0 };
- const static WCHAR mm_fmt[] = { '%', '.', '2', 'f', 'm', 'm', 0 };
- const static WCHAR in_fmt[] = { '%', '.', '2', 'f', 'i', 'n', 0 };
+ static const WCHAR UNDEF[] = { '<', 'u', 'n', 'd', 'e', 'f', '>', 0 };
+ static const WCHAR mm_fmt[] = { '%', '.', '2', 'f', 'm', 'm', 0 };
+ static const WCHAR in_fmt[] = { '%', '.', '2', 'f', 'i', 'n', 0 };
lstrcpyW(strout, UNDEF);
if (pda->dlga->Flags & PSD_INHUNDREDTHSOFMILLIMETERS) {
wsprintfW(strout,mm_fmt,(size*1.0)/100.0);
@@ -3182,7 +3182,7 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uM
static INT_PTR CALLBACK
PageDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- const static WCHAR __WINE_PAGESETUPDLGDATA[] =
+ static const WCHAR __WINE_PAGESETUPDLGDATA[] =
{ '_', '_', 'W', 'I', 'N', 'E', '_', 'P', 'A', 'G', 'E',
'S', 'E', 'T', 'U', 'P', 'D', 'L', 'G', 'D', 'A', 'T', 'A', 0 };
PageSetupDataW *pda;
Index: dlls/ole32/tests/storage32.c
===================================================================
RCS file: /var/cvs/wine/dlls/ole32/tests/storage32.c,v
retrieving revision 1.13
diff -u -p -r1.13 storage32.c
--- dlls/ole32/tests/storage32.c 7 Sep 2005 09:22:15 -0000 1.13
+++ dlls/ole32/tests/storage32.c 5 Oct 2005 10:29:32 -0000
@@ -434,7 +434,7 @@ static void test_open_storage(void)
ok(r==S_OK, "StgOpenStorage failed\n");
if(stg)
{
- const static WCHAR stmname[] = { 'w','i','n','e','t','e','s','t',0};
+ static const WCHAR stmname[] = { 'w','i','n','e','t','e','s','t',0};
IStream *stm = NULL;
IStorage *stg2 = NULL;
Index: dlls/shell32/enumidlist.c
===================================================================
RCS file: /var/cvs/wine/dlls/shell32/enumidlist.c,v
retrieving revision 1.46
diff -u -p -r1.46 enumidlist.c
--- dlls/shell32/enumidlist.c 3 Jul 2005 12:03:35 -0000 1.46
+++ dlls/shell32/enumidlist.c 5 Oct 2005 10:29:20 -0000
@@ -112,9 +112,9 @@ BOOL CreateFolderEnumList(
HANDLE hFile;
WCHAR szPath[MAX_PATH];
BOOL succeeded = TRUE;
- const static WCHAR stars[] = { '*','.','*',0 };
- const static WCHAR dot[] = { '.',0 };
- const static WCHAR dotdot[] = { '.','.',0 };
+ static const WCHAR stars[] = { '*','.','*',0 };
+ static const WCHAR dot[] = { '.',0 };
+ static const WCHAR dotdot[] = { '.','.',0 };
TRACE("(%p)->(path=%s flags=0x%08lx) \n",list,debugstr_w(lpszPath),dwFlags);
Index: dlls/shell32/shfldr_desktop.c
===================================================================
RCS file: /var/cvs/wine/dlls/shell32/shfldr_desktop.c,v
retrieving revision 1.46
diff -u -p -r1.46 shfldr_desktop.c
--- dlls/shell32/shfldr_desktop.c 15 Aug 2005 09:41:58 -0000 1.46
+++ dlls/shell32/shfldr_desktop.c 5 Oct 2005 10:29:20 -0000
@@ -430,7 +430,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetA
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = S_OK;
- const static DWORD dwDesktopAttributes =
+ static const DWORD dwDesktopAttributes =
SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
Index: dlls/shell32/tests/shlfolder.c
===================================================================
RCS file: /var/cvs/wine/dlls/shell32/tests/shlfolder.c,v
retrieving revision 1.37
diff -u -p -r1.37 shlfolder.c
--- dlls/shell32/tests/shlfolder.c 7 Sep 2005 13:28:49 -0000 1.37
+++ dlls/shell32/tests/shlfolder.c 5 Oct 2005 10:29:33 -0000
@@ -542,10 +548,10 @@ static void test_GetAttributesOf(void)
LPCITEMIDLIST pidlEmpty = (LPCITEMIDLIST)&emptyitem;
LPITEMIDLIST pidlMyComputer;
DWORD dwFlags;
- const static DWORD dwDesktopFlags = /* As observed on WinXP SP2 */
+ static const DWORD dwDesktopFlags = /* As observed on WinXP SP2 */
SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
- const static DWORD dwMyComputerFlags = /* As observed on WinXP SP2 */
+ static const DWORD dwMyComputerFlags = /* As observed on WinXP SP2 */
SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET |
SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
WCHAR wszMyComputer[] = {
Index: programs/winefile/winefile.c
===================================================================
RCS file: /var/cvs/wine/programs/winefile/winefile.c,v
retrieving revision 1.61
diff -u -p -r1.61 winefile.c
--- programs/winefile/winefile.c 3 Oct 2005 11:03:04 -0000 1.61
+++ programs/winefile/winefile.c 5 Oct 2005 10:29:29 -0000
@@ -178,23 +178,23 @@ WINEFILE_GLOBALS Globals;
static int last_split;
/* some common string constants */
-const static TCHAR sEmpty[] = {'\0'};
-const static TCHAR sSpace[] = {' ', '\0'};
-const static TCHAR sNumFmt[] = {'%','d','\0'};
-const static TCHAR sQMarks[] = {'?','?','?','\0'};
+static const TCHAR sEmpty[] = {'\0'};
+static const TCHAR sSpace[] = {' ', '\0'};
+static const TCHAR sNumFmt[] = {'%','d','\0'};
+static const TCHAR sQMarks[] = {'?','?','?','\0'};
/* window class names */
-const static TCHAR sWINEFILEFRAME[] = {'W','F','S','_','F','r','a','m','e','\0'};
-const static TCHAR sWINEFILETREE[] = {'W','F','S','_','T','r','e','e','\0'};
+static const TCHAR sWINEFILEFRAME[] = {'W','F','S','_','F','r','a','m','e','\0'};
+static const TCHAR sWINEFILETREE[] = {'W','F','S','_','T','r','e','e','\0'};
#ifdef _MSC_VER
/* #define LONGLONGARG _T("I64") */
-const static TCHAR sLongHexFmt[] = {'%','I','6','4','X','\0'};
-const static TCHAR sLongNumFmt[] = {'%','I','6','4','d','\0'};
+static const TCHAR sLongHexFmt[] = {'%','I','6','4','X','\0'};
+static const TCHAR sLongNumFmt[] = {'%','I','6','4','d','\0'};
#else
/* #define LONGLONGARG _T("L") */
-const static TCHAR sLongHexFmt[] = {'%','L','X','\0'};
-const static TCHAR sLongNumFmt[] = {'%','L','d','\0'};
+static const TCHAR sLongHexFmt[] = {'%','L','X','\0'};
+static const TCHAR sLongNumFmt[] = {'%','L','d','\0'};
#endif
@@ -1338,9 +1338,9 @@ static void read_directory(Entry* dir, L
static Entry* read_tree(Root* root, LPCTSTR path, LPITEMIDLIST pidl, LPTSTR drv, SORT_ORDER sortOrder, HWND hwnd)
{
#if !defined(_NO_EXTENSIONS) && defined(__WINE__)
- const static TCHAR sSlash[] = {'/', '\0'};
+ static const TCHAR sSlash[] = {'/', '\0'};
#endif
- const static TCHAR sBackslash[] = {'\\', '\0'};
+ static const TCHAR sBackslash[] = {'\\', '\0'};
#ifdef _SHELL_FOLDERS
if (pidl)
@@ -1401,7 +1401,7 @@ static ChildWnd* alloc_child_window(LPCT
{
TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
TCHAR b1[BUFFER_LEN];
- const static TCHAR sAsterics[] = {'*', '\0'};
+ static const TCHAR sAsterics[] = {'*', '\0'};
ChildWnd* child = (ChildWnd*) malloc(sizeof(ChildWnd));
Root* root = &child->root;
@@ -1891,7 +1891,7 @@ static INT_PTR CALLBACK PropertiesDialog
switch(nmsg) {
case WM_INITDIALOG: {
- const static TCHAR sByteFmt[] = {'%','s',' ','B','y','t','e','s','\0'};
+ static const TCHAR sByteFmt[] = {'%','s',' ','B','y','t','e','s','\0'};
TCHAR b1[BUFFER_LEN], b2[BUFFER_LEN];
LPWIN32_FIND_DATA pWFD;
ULONGLONG size;
@@ -2527,7 +2527,7 @@ static HWND create_header(HWND parent, P
static void init_output(HWND hwnd)
{
- const static TCHAR s1000[] = {'1','0','0','0','\0'};
+ static const TCHAR s1000[] = {'1','0','0','0','\0'};
TCHAR b[16];
HFONT old_font;
@@ -2819,9 +2819,9 @@ static int insert_entries(Pane* pane, En
static void format_bytes(LPTSTR buffer, LONGLONG bytes)
{
- const static TCHAR sFmtGB[] = {'%', '.', '1', 'f', ' ', 'G', 'B', '\0'};
- const static TCHAR sFmtMB[] = {'%', '.', '1', 'f', ' ', 'M', 'B', '\0'};
- const static TCHAR sFmtkB[] = {'%', '.', '1', 'f', ' ', 'k', 'B', '\0'};
+ static const TCHAR sFmtGB[] = {'%', '.', '1', 'f', ' ', 'G', 'B', '\0'};
+ static const TCHAR sFmtMB[] = {'%', '.', '1', 'f', ' ', 'M', 'B', '\0'};
+ static const TCHAR sFmtkB[] = {'%', '.', '1', 'f', ' ', 'k', 'B', '\0'};
float fBytes = (float)bytes;
@@ -2855,7 +2855,7 @@ static WNDPROC g_orgTreeWndProc;
static void create_tree_window(HWND parent, Pane* pane, int id, int id_header, LPCTSTR pattern, int filter_flags)
{
- const static TCHAR sListBox[] = {'L','i','s','t','B','o','x','\0'};
+ static const TCHAR sListBox[] = {'L','i','s','t','B','o','x','\0'};
static int s_init = 0;
Entry* entry = pane->root;
@@ -3342,10 +3342,10 @@ static void draw_item(Pane* pane, LPDRAW
/* show file attributes */
if (visible_cols & COL_ATTRIBUTES) {
#ifdef _NO_EXTENSIONS
- const static TCHAR s4Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
+ static const TCHAR s4Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
lstrcpy(buffer, s4Tabs);
#else
- const static TCHAR s11Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
+ static const TCHAR s11Tabs[] = {' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\t',' ','\0'};
lstrcpy(buffer, s11Tabs);
#endif
@@ -3377,7 +3377,7 @@ static void draw_item(Pane* pane, LPDRAW
/*TODO
if (flags.security) {
- const static TCHAR sSecTabs[] = {
+ static const TCHAR sSecTabs[] = {
' ','\t',' ','\t',' ','\t',' ',
' ','\t',' ',
' ','\t',' ','\t',' ','\t',' ',
@@ -4043,7 +4043,7 @@ static BOOL prompt_target(Pane* pane, LP
/* If the target already exists as directory, create a new target below this. */
if (is_directory(path)) {
TCHAR fname[_MAX_FNAME], ext[_MAX_EXT];
- const static TCHAR sAppend[] = {'%','s','/','%','s','%','s','\0'};
+ static const TCHAR sAppend[] = {'%','s','/','%','s','%','s','\0'};
_tsplitpath(source, NULL, NULL, fname, ext);
@@ -4558,7 +4558,7 @@ static LRESULT CALLBACK TreeWndProc(HWND
static void InitInstance(HINSTANCE hinstance)
{
- const static TCHAR sFont[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
+ static const TCHAR sFont[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
WNDCLASSEX wcFrame;
WNDCLASS wcChild;
@@ -4656,7 +4656,7 @@ static void InitInstance(HINSTANCE hinst
static void show_frame(HWND hwndParent, int cmdshow)
{
- const static TCHAR sMDICLIENT[] = {'M','D','I','C','L','I','E','N','T','\0'};
+ static const TCHAR sMDICLIENT[] = {'M','D','I','C','L','I','E','N','T','\0'};
TCHAR path[MAX_PATH], b1[BUFFER_LEN];
ChildWnd* child;
More information about the wine-patches
mailing list