Changelog: dlls/comctl32/pager.c dlls/commdlg/filedlg95.c dlls/ddraw/ddraw/thunks.c dlls/ddraw/dsurface/thunks.c dlls/odbc32/proxyodbc.c dlls/winsock/socket.c programs/winefile/winefile.c - Forte C (SUNPRO_C) does not support non-static initializers for structures Gregg Mattinson Co-op Developer Sun Microsystems of Canada
Index: dlls/comctl32/pager.c =================================================================== RCS file: /opcom/comp/ws/wine/CVSROOT/wine/dlls/comctl32/pager.c,v retrieving revision 1.1 diff -u -r1.1 pager.c --- /tmp/T0eWaGsF Tue Jul 2 13:50:05 2002 +++ pager.c Tue Jun 25 07:58:27 2002 @@ -1114,7 +1114,11 @@ static LRESULT PAGER_NCHitTest (HWND hwnd, WPARAM wParam, LPARAM lParam) { - POINT pt = { SLOWORD(lParam), SHIWORD(lParam) }; + POINT pt; + + pt.x = SLOWORD(lParam); + pt.y = SHIWORD(lParam); + ScreenToClient (hwnd, &pt); return PAGER_HitTest(hwnd, &pt); } @@ -1184,7 +1188,7 @@ PAGER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) { PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); - POINT clpt, pt = {SLOWORD(lParam), SHIWORD(lParam)}; + POINT clpt, pt; RECT wnrect, TLbtnrect, BRbtnrect, *btnrect = NULL; DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE); BOOL topLeft = FALSE; @@ -1192,6 +1196,9 @@ INT hit; HDC hdc; + pt.x = SLOWORD(lParam); + pt.y = SHIWORD(lParam); + TRACE("[%08x] to (%ld,%ld)\n", hwnd, pt.x, pt.y); ClientToScreen(hwnd, &pt); GetWindowRect(hwnd, &wnrect); @@ -1272,9 +1279,12 @@ { PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); BOOL repaintBtns = FALSE; - POINT pt = { SLOWORD(lParam), SHIWORD(lParam) }; + POINT pt; INT hit; + pt.x = SLOWORD(lParam); + pt.y = SHIWORD(lParam); + TRACE("[%08x] at (%d,%d)\n", hwnd, SLOWORD(lParam), SHIWORD(lParam)); hit = PAGER_HitTest(hwnd, &pt); @@ -1339,7 +1349,10 @@ static LRESULT PAGER_NCLButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) { - POINT pt = {SLOWORD(lParam), SHIWORD(lParam)}; + POINT pt; + + pt.x = SLOWORD(lParam); + pt.y = SHIWORD(lParam); TRACE("[%08x] at (%d,%d)\n", hwnd, SLOWORD(lParam), SHIWORD(lParam)); MapWindowPoints(0, hwnd, &pt, 1); Index: dlls/commdlg/filedlg95.c =================================================================== RCS file: /opcom/comp/ws/wine/CVSROOT/wine/dlls/commdlg/filedlg95.c,v retrieving revision 1.1 diff -u -r1.1 filedlg95.c --- /tmp/T07qa4sF Tue Jul 2 13:50:12 2002 +++ filedlg95.c Tue Jun 25 08:08:12 2002 @@ -961,15 +961,14 @@ {VIEW_LIST, FCIDM_TB_SMALLICON, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, {VIEW_DETAILS, FCIDM_TB_REPORTVIEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, }; - TBADDBITMAP tba[] = - { - { HINST_COMMCTRL, IDB_VIEW_SMALL_COLOR }, - { COMDLG32_hInstance, 800 } /* desktop icon */ - }; - + TBADDBITMAP tba[2]; RECT rectTB; - FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); + + tba[0].hInst = HINST_COMMCTRL; + tba[0].nID = IDB_VIEW_SMALL_COLOR; + tba[1].hInst = COMDLG32_hInstance; + tba[1].nID = 800; TRACE("%p\n", fodInfos); Index: dlls/ddraw/ddraw/thunks.c =================================================================== RCS file: /opcom/comp/ws/wine/CVSROOT/wine/dlls/ddraw/ddraw/thunks.c,v retrieving revision 1.1 diff -u -r1.1 thunks.c --- /tmp/T0qZaqtF Tue Jul 2 13:50:18 2002 +++ thunks.c Mon Jun 24 16:41:49 2002 @@ -336,7 +336,10 @@ LPDDSURFACEDESC pDDSD, LPVOID context, LPDDENUMMODESCALLBACK cb) { - struct displaymodescallback_context cbcontext = { cb, context }; + struct displaymodescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl, IDirectDraw, @@ -351,7 +354,10 @@ LPDDSURFACEDESC pDDSD, LPVOID context, LPDDENUMMODESCALLBACK cb) { - struct displaymodescallback_context cbcontext = { cb, context }; + struct displaymodescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl, IDirectDraw2, @@ -399,7 +405,11 @@ LPDDSURFACEDESC pDDSD, LPVOID context, LPDDENUMSURFACESCALLBACK cb) { - struct surfacescallback_context cbcontext = { cb, context }; + struct surfacescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; + return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl, IDirectDraw, IDirectDraw7, This), @@ -412,7 +422,11 @@ LPDDSURFACEDESC pDDSD, LPVOID context, LPDDENUMSURFACESCALLBACK cb) { - struct surfacescallback_context cbcontext = { cb, context }; + struct surfacescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; + return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl, IDirectDraw2, IDirectDraw7, This), Index: dlls/ddraw/dsurface/thunks.c =================================================================== RCS file: /opcom/comp/ws/wine/CVSROOT/wine/dlls/ddraw/dsurface/thunks.c,v retrieving revision 1.1 diff -u -r1.1 thunks.c --- /tmp/T0PSaWuF Tue Jul 2 13:50:22 2002 +++ thunks.c Tue Jun 25 07:29:45 2002 @@ -135,7 +135,11 @@ LPVOID context, LPDDENUMSURFACESCALLBACK callback) { - struct callback_info info = { callback, context }; + struct callback_info info; + + info.callback = callback; + info.context = context; + return IDirectDrawSurface7_EnumAttachedSurfaces(CONVERT(This), &info, EnumCallback); } @@ -145,7 +149,11 @@ DWORD dwFlags, LPVOID context, LPDDENUMSURFACESCALLBACK callback) { - struct callback_info info = { callback, context }; + struct callback_info info; + + info.callback = callback; + info.context = context; + return IDirectDrawSurface7_EnumOverlayZOrders(CONVERT(This), dwFlags, &info, EnumCallback); } @@ -163,9 +171,14 @@ LPDDSCAPS pCaps, LPDIRECTDRAWSURFACE3* ppAttached) { - DDSCAPS2 caps = { pCaps->dwCaps, 0, 0, 0 }; + DDSCAPS2 caps; LPDIRECTDRAWSURFACE7 pAttached7; HRESULT hr; + + caps.dwCaps = pCaps->dwCaps; + caps.dwCaps2 = 0; + caps.dwCaps3 = 0; + caps.dwCaps4 = 0; hr = IDirectDrawSurface7_GetAttachedSurface(CONVERT(This), &caps, &pAttached7); Index: dlls/odbc32/proxyodbc.c =================================================================== RCS file: /opcom/comp/ws/wine/CVSROOT/wine/dlls/odbc32/proxyodbc.c,v retrieving revision 1.1 diff -u -r1.1 proxyodbc.c --- /tmp/T0KZayzF Tue Jul 2 13:51:15 2002 +++ proxyodbc.c Tue Jun 25 08:16:39 2002 @@ -133,7 +133,7 @@ FALSE, FALSE, ERROR_LIBRARY_NOT_FOUND, - { }, + { 0, 0, 0, 0 }, "", "", "", Index: dlls/winsock/socket.c =================================================================== RCS file: /opcom/comp/ws/wine/CVSROOT/wine/dlls/winsock/socket.c,v retrieving revision 1.1 diff -u -r1.1 socket.c --- /tmp/T0NVa4DF Tue Jul 2 13:52:29 2002 +++ socket.c Tue Jun 25 09:08:26 2002 @@ -2303,7 +2303,10 @@ int WINAPI WS_recv(SOCKET s, char *buf, int len, int flags) { DWORD n, dwFlags = flags; - WSABUF wsabuf = { len, buf }; + WSABUF wsabuf; + + wsabuf.len = len; + wsabuf.buf = buf; if ( WSARecvFrom (s, &wsabuf, 1, &n, &dwFlags, NULL, NULL, NULL, NULL) == SOCKET_ERROR ) return SOCKET_ERROR; @@ -2327,7 +2330,10 @@ struct WS_sockaddr *from, int *fromlen) { DWORD n, dwFlags = flags; - WSABUF wsabuf = { len, buf }; + WSABUF wsabuf; + + wsabuf.len = len; + wsabuf.buf = buf; if ( WSARecvFrom (s, &wsabuf, 1, &n, &dwFlags, from, fromlen, NULL, NULL) == SOCKET_ERROR ) return SOCKET_ERROR; @@ -2450,7 +2456,10 @@ int WINAPI WS_send(SOCKET s, const char *buf, int len, int flags) { DWORD n; - WSABUF wsabuf = { len, (char*) buf }; + WSABUF wsabuf; + + wsabuf.len = len; + wsabuf.buf = (char*) buf; if ( WSASendTo ( s, &wsabuf, 1, &n, flags, NULL, 0, NULL, NULL) == SOCKET_ERROR ) return SOCKET_ERROR; @@ -2596,7 +2605,10 @@ const struct WS_sockaddr *to, int tolen) { DWORD n; - WSABUF wsabuf = { len, (char*) buf }; + WSABUF wsabuf; + + wsabuf.len = len; + wsabuf.buf = (char*) buf; if ( WSASendTo (s, &wsabuf, 1, &n, flags, to, tolen, NULL, NULL) == SOCKET_ERROR ) return SOCKET_ERROR; Index: programs/winefile/winefile.c =================================================================== RCS file: /opcom/comp/ws/wine/CVSROOT/wine/programs/winefile/winefile.c,v retrieving revision 1.1 diff -u -r1.1 winefile.c --- /tmp/T0jLa4XF Tue Jul 2 13:54:10 2002 +++ winefile.c Tue Jun 25 09:05:55 2002 @@ -809,7 +809,12 @@ static void resize_frame(HWND hwnd, int cx, int cy) { - RECT rect = {0, 0, cx, cy}; + RECT rect; + + rect.left = 0; + rect.top = 0; + rect.right = cx; + rect.bottom = cy; resize_frame_rect(hwnd, &rect); } @@ -842,15 +847,19 @@ static HWND create_child_window(ChildWnd* child) { - MDICREATESTRUCT mcs = { - WINEFILETREE, (LPTSTR)child->path, Globals.hInstance, - child->pos.rcNormalPosition.left, child->pos.rcNormalPosition.top, - child->pos.rcNormalPosition.right-child->pos.rcNormalPosition.left, - child->pos.rcNormalPosition.bottom-child->pos.rcNormalPosition.top, - 0/*style*/, 0/*lParam*/ - }; + MDICREATESTRUCT mcs; int idx; + mcs.szClass = WINEFILETREE; + mcs.szTitle = (LPTSTR)child->path; + mcs.hOwner = Globals.hInstance; + mcs.x = child->pos.rcNormalPosition.left; + mcs.y = child->pos.rcNormalPosition.top; + mcs.cx = child->pos.rcNormalPosition.right-child->pos.rcNormalPosition.left; + mcs.cy = child->pos.rcNormalPosition.bottom-child->pos.rcNormalPosition.top; + mcs.style = 0; + mcs.lParam = 0; + hcbthook = SetWindowsHookEx(WH_CBT, CBTProc, 0, GetCurrentThreadId()); newchild = child; @@ -1243,18 +1252,26 @@ HDF_LEFT /* Security */ #endif }; static void resize_tree(ChildWnd* child, int cx, int cy) { HDWP hdwp = BeginDeferWindowPos(4); - RECT rt = {0, 0, cx, cy}; + RECT rt; + + rt.left = 0; + rt.top = 0; + rt.right = cx; + rt.bottom = cy; cx = child->split_pos + SPLIT_WIDTH/2; #ifndef _NO_EXTENSIONS { WINDOWPOS wp; - HD_LAYOUT hdl = {&rt, &wp}; + HD_LAYOUT hdl; + + hdl.prc = &rt; + hdl.pwpos = ℘ Header_Layout(child->left.hwndHeader, &hdl); @@ -1345,9 +1362,15 @@ for(cnt=0; cnt<entries; cnt++) { Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, cnt); - DRAWITEMSTRUCT dis = {0/*CtlType*/, 0/*CtlID*/, - 0/*itemID*/, 0/*itemAction*/, 0/*itemState*/, - pane->hwnd/*hwndItem*/, hdc}; + DRAWITEMSTRUCT dis; + + dis.CtlType = 0; + dis.CtlID = 0; + dis.itemID = 0; + dis.itemAction = 0; + dis.itemState = 0; + dis.hwndItem = pane->hwnd; + dis.hDC = hdc; draw_item(pane, &dis, entry, COLUMNS); } @@ -1412,7 +1435,15 @@ for(cnt=0; cnt<entries; cnt++) { Entry* entry = (Entry*) ListBox_GetItemData(pane->hwnd, cnt); - DRAWITEMSTRUCT dis = {0, 0, 0, 0, 0, pane->hwnd, hdc}; + DRAWITEMSTRUCT dis; + + dis.CtlType = 0; + dis.CtlID = 0; + dis.itemID = 0; + dis.itemAction = 0; + dis.itemState = 0; + dis.hwndItem = pane->hwnd; + dis.hDC = hdc; draw_item(pane, &dis, entry, col); } @@ -1586,7 +1617,12 @@ static void output_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str, DWORD flags) { int x = dis->rcItem.left; - RECT rt = {x+pane->positions[col]+Globals.spaceSize.cx, dis->rcItem.top, x+pane->positions[col+1]-Globals.spaceSize.cx, dis->rcItem.bottom}; + RECT rt; + + rt.left = x+pane->positions[col]+Globals.spaceSize.cx; + rt.top = dis->rcItem.top; + rt.right = x+pane->positions[col+1]-Globals.spaceSize.cx; + rt.bottom = dis->rcItem.bottom; DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|flags); } @@ -1594,7 +1630,12 @@ static void output_tabbed_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str) { int x = dis->rcItem.left; - RECT rt = {x+pane->positions[col]+Globals.spaceSize.cx, dis->rcItem.top, x+pane->positions[col+1]-Globals.spaceSize.cx, dis->rcItem.bottom}; + RECT rt; + + rt.left = x+pane->positions[col]+Globals.spaceSize.cx; + rt.top = dis->rcItem.top; + rt.right = x+pane->positions[col+1]-Globals.spaceSize.cx; + rt.bottom = dis->rcItem.bottom; /* DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2}; DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/ @@ -1605,12 +1646,17 @@ static void output_number(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str) { int x = dis->rcItem.left; - RECT rt = {x+pane->positions[col]+Globals.spaceSize.cx, dis->rcItem.top, x+pane->positions[col+1]-Globals.spaceSize.cx, dis->rcItem.bottom}; + RECT rt; LPCTSTR s = str; TCHAR b[128]; LPTSTR d = b; int pos; + rt.left = x+pane->positions[col]+Globals.spaceSize.cx; + rt.top = dis->rcItem.top; + rt.right = x+pane->positions[col+1]-Globals.spaceSize.cx; + rt.bottom = dis->rcItem.bottom; + if (*s) *d++ = *s++; @@ -1726,9 +1772,16 @@ int x; int y = dis->rcItem.top + IMAGE_HEIGHT/2; Entry* up; - RECT rt_clip = {dis->rcItem.left, dis->rcItem.top, dis->rcItem.left+pane->widths[col], dis->rcItem.bottom}; + RECT rt_clip; HRGN hrgn_org = CreateRectRgn(0, 0, 0, 0); - HRGN hrgn = CreateRectRgnIndirect(&rt_clip); + HRGN hrgn; + + rt_clip.left = dis->rcItem.left; + rt_clip.top = dis->rcItem.top; + rt_clip.right = dis->rcItem.left+pane->widths[col]; + rt_clip.bottom = dis->rcItem.bottom; + + hrgn = CreateRectRgnIndirect(&rt_clip); if (!GetClipRgn(dis->hDC, hrgn_org)) { DeleteObject(hrgn_org); @@ -2100,8 +2153,18 @@ { int scroll_pos = GetScrollPos(pane->hwnd, SB_HORZ); - RECT rt_scr = {pane->positions[idx+1]-scroll_pos, 0, clnt.right, clnt.bottom}; - RECT rt_clip = {pane->positions[idx]-scroll_pos, 0, clnt.right, clnt.bottom}; + RECT rt_scr; + RECT rt_clip; + + rt_scr.left = pane->positions[idx+1]-scroll_pos; + rt_scr.top = 0; + rt_scr.right = clnt.right; + rt_scr.bottom = clnt.bottom; + + rt_clip.left = pane->positions[idx]-scroll_pos; + rt_clip.top = 0; + rt_clip.right = clnt.right; + rt_clip.bottom = clnt.bottom; if (rt_scr.left < 0) rt_scr.left = 0; if (rt_clip.left < 0) rt_clip.left = 0; @@ -2636,49 +2699,14 @@ static void InitInstance(HINSTANCE hinstance) { - WNDCLASSEX wcFrame = { - sizeof(WNDCLASSEX), - 0/*style*/, - FrameWndProc, - 0/*cbClsExtra*/, - 0/*cbWndExtra*/, - hinstance, - LoadIcon(hinstance, MAKEINTRESOURCE(IDI_WINEFILE)), - LoadCursor(0, IDC_ARROW), - 0/*hbrBackground*/, - 0/*lpszMenuName*/, - WINEFILEFRAME, - (HICON)LoadImage(hinstance, MAKEINTRESOURCE(IDI_WINEFILE), IMAGE_ICON, - GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED) - }; - - // register frame window class - ATOM hframeClass = RegisterClassEx(&wcFrame); - - - WNDCLASS wcChild = { - CS_CLASSDC|CS_DBLCLKS|CS_VREDRAW, - ChildWndProc, - 0/*cbClsExtra*/, - 0/*cbWndExtra*/, - hinstance, - 0/*hIcon*/, - LoadCursor(0, IDC_ARROW), - 0/*hbrBackground*/, - 0/*lpszMenuName*/, - WINEFILETREE - }; - - // register tree windows class - WINE_UNUSED ATOM hChildClass = RegisterClass(&wcChild); - - + WNDCLASSEX wcFrame; + ATOM hframeClass; + WNDCLASS wcChild; + WINE_UNUSED ATOM hChildClass; HMENU hMenuFrame = LoadMenu(hinstance, MAKEINTRESOURCE(IDM_WINEFILE)); HMENU hMenuWindow = GetSubMenu(hMenuFrame, GetMenuItemCount(hMenuFrame)-2); - CLIENTCREATESTRUCT ccs = { - hMenuWindow, IDW_FIRST_CHILD - }; + CLIENTCREATESTRUCT ccs; INITCOMMONCONTROLSEX icc = { sizeof(INITCOMMONCONTROLSEX), @@ -2690,6 +2718,46 @@ HDC hdc = GetDC(0); + + wcFrame.cbSize = sizeof(WNDCLASSEX); + wcFrame.style = 0; + wcFrame.lpfnWndProc = FrameWndProc; + wcFrame.cbClsExtra = 0; + wcFrame.cbWndExtra = 0; + wcFrame.hInstance = hinstance; + wcFrame.hIcon = LoadIcon(hinstance, + MAKEINTRESOURCE(IDI_WINEFILE)); + wcFrame.hCursor = LoadCursor(0, IDC_ARROW); + wcFrame.hbrBackground = 0; + wcFrame.lpszMenuName = 0; + wcFrame.lpszClassName = WINEFILEFRAME; + wcFrame.hIconSm = (HICON)LoadImage(hinstance, + MAKEINTRESOURCE(IDI_WINEFILE), + IMAGE_ICON, + GetSystemMetrics(SM_CXSMICON), + GetSystemMetrics(SM_CYSMICON), + LR_SHARED); + + /* register frame window class */ + hframeClass = RegisterClassEx(&wcFrame); + + wcChild.style = CS_CLASSDC|CS_DBLCLKS|CS_VREDRAW; + wcChild.lpfnWndProc = ChildWndProc; + wcChild.cbClsExtra = 0; + wcChild.cbWndExtra = 0; + wcChild.hInstance = hinstance; + wcChild.hIcon = 0; + wcChild.hCursor = LoadCursor(0, IDC_ARROW); + wcChild.hbrBackground = 0; + wcChild.lpszMenuName = 0; + wcChild.lpszClassName = WINEFILETREE; + + /* register tree windows class */ + hChildClass = RegisterClass(&wcChild); + + ccs.hWindowMenu = hMenuWindow; + ccs.idFirstChild = IDW_FIRST_CHILD; + Globals.hMenuFrame = hMenuFrame; Globals.hMenuView = GetSubMenu(hMenuFrame, 3); Globals.hMenuOptions = GetSubMenu(hMenuFrame, 4);