From bc6ed5498655ea0e2cc4f0748ad8311e803d5b71 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 13 Oct 2001 01:35:15 +0000 Subject: [PATCH] * autoload.cc (wsock_init): Reorganize slightly to accomodate a new compiler. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/autoload.cc | 2 +- winsup/cygwin/exceptions.cc | 4 ++-- winsup/cygwin/fhandler_console.cc | 2 +- winsup/cygwin/fhandler_socket.cc | 2 +- winsup/cygwin/grp.cc | 2 +- winsup/cygwin/localtime.cc | 2 +- winsup/cygwin/net.cc | 2 +- winsup/cygwin/passwd.cc | 2 +- winsup/cygwin/strace.cc | 2 +- winsup/cygwin/uinfo.cc | 6 +++--- winsup/cygwin/window.cc | 2 +- 12 files changed, 19 insertions(+), 14 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index fa782b77a..91562c327 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2001-10-12 Christopher Faylor + + * autoload.cc (wsock_init): Reorganize slightly to accomodate a new + compiler. + 2001-10-11 Egor Duda * net.cc (cygwin_sendto): Use correct socket address when sending diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc index d1cbd59cc..5ae8e1c5a 100644 --- a/winsup/cygwin/autoload.cc +++ b/winsup/cygwin/autoload.cc @@ -244,7 +244,6 @@ wsock_init () extern WSADATA wsadata; struct func_info *func = (struct func_info *) __builtin_return_address (0); struct dll_info *dll = func->dll; - retchain ret; __asm__ (" \n\ .section .ws2_32_info \n\ @@ -293,6 +292,7 @@ wsock_init () movl $dll_chain1,4(%ebp) \n\ "); + volatile retchain ret; /* Set "arguments for dll_chain1. */ ret.low = (long) dll_func_load; ret.high = (long) func; diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index e3d3c45f4..9fd018e1b 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -49,11 +49,11 @@ static NO_COPY muto *mask_sync = NULL; HMODULE NO_COPY cygwin_hmodule; -static const struct +NO_COPY static struct { unsigned int code; const char *name; -} status_info[] NO_COPY = +} status_info[] = { #define X(s) s, #s { X (STATUS_ABANDONED_WAIT_0) }, diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 3756ad2ab..d9f8cac99 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -1647,7 +1647,7 @@ fhandler_console::write (const void *vsrc, size_t len) static struct { int vk; const char *val[4]; -} const keytable[] NO_COPY = { +} keytable[] NO_COPY = { /* NORMAL */ /* SHIFT */ /* CTRL */ /* ALT */ {VK_LEFT, {"\033[D", "\033[D", "\033[D", "\033\033[D"}}, {VK_RIGHT, {"\033[C", "\033[C", "\033[C", "\033\033[C"}}, diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 01feff306..4711189c0 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -198,7 +198,7 @@ fhandler_socket::fixup_after_fork (HANDLE parent) } if (new_sock != INVALID_SOCKET && ws2_32_handle) { - debug_printf ("WSASocket went fine"); + debug_printf ("WSASocket went fine %p", new_sock); set_io_handle ((HANDLE) new_sock); } else diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index 87cc4b484..e2b0648a6 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -198,7 +198,7 @@ read_etc_group () debug_printf ("Failed to get local admins group name. %E"); } - snprintf (linebuf, sizeof (linebuf), "%s::%u:\n", group_name, DEFAULT_GID); + snprintf (linebuf, sizeof (linebuf), "%s::%u:\n", group_name, (unsigned) DEFAULT_GID); add_grp_line (linebuf); group_state = emulated; } diff --git a/winsup/cygwin/localtime.cc b/winsup/cygwin/localtime.cc index 43c64ce3c..4f4e54ed8 100644 --- a/winsup/cygwin/localtime.cc +++ b/winsup/cygwin/localtime.cc @@ -501,7 +501,7 @@ struct tzhead { static char wildabbr[] NO_COPY = WILDABBR; -static const char gmt[] NO_COPY = "GMT"; +static char gmt[] NO_COPY = "GMT"; struct ttinfo { /* time type information */ long tt_gmtoff; /* UTC offset in seconds */ diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index d32cfc1d9..94b37c3d8 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -356,7 +356,7 @@ __set_winsock_errno (const char *fn, int ln) * Since the member `s' isn't used for debug output we can use it * for the error text returned by herror and hstrerror. */ -const static NO_COPY struct tl host_errmap[] = +static NO_COPY struct tl host_errmap[] = { {WSAHOST_NOT_FOUND, "Unknown host", HOST_NOT_FOUND}, {WSATRY_AGAIN, "Host name lookup failure", TRY_AGAIN}, diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc index 2f52473c7..833964a19 100644 --- a/winsup/cygwin/passwd.cc +++ b/winsup/cygwin/passwd.cc @@ -170,7 +170,7 @@ read_etc_passwd () { debug_printf ("Emulating /etc/passwd"); snprintf (linebuf, sizeof (linebuf), "%s::%u:%u::%s:/bin/sh", cygheap->user.name (), - DEFAULT_UID, DEFAULT_GID, getenv ("HOME") ?: "/"); + (unsigned) DEFAULT_UID, (unsigned) DEFAULT_GID, getenv ("HOME") ?: "/"); add_pwd_line (linebuf); passwd_state = emulated; } diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc index 7ffea8501..b7e0a2a32 100644 --- a/winsup/cygwin/strace.cc +++ b/winsup/cygwin/strace.cc @@ -229,7 +229,7 @@ strace_printf (unsigned category, const char *func, const char *fmt, ...) } } -static NO_COPY const struct tab +static NO_COPY struct tab { int v; const char *n; diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index bed8ba9a0..d12d254f3 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -59,7 +59,7 @@ internal_getlogin (cygheap_user &user) if (user.name () && user.domain ()) debug_printf ("User: %s, Domain: %s, Logon Server: %s", user.name (), user.domain (), user.logsrv ()); - else if (!(ret = NetWkstaUserGetInfo (NULL, 1, (LPBYTE *)&wui))) + else if (!(ret = NetWkstaUserGetInfo (NULL, 1, (LPBYTE *) &wui))) { sys_wcstombs (buf, wui->wkui1_username, UNLEN + 1); user.set_name (buf); @@ -78,17 +78,17 @@ internal_getlogin (cygheap_user &user) } LPUSER_INFO_3 ui = NULL; WCHAR wuser[UNLEN + 1]; - WCHAR wlogsrv[INTERNET_MAX_HOST_NAME_LENGTH + 3]; /* HOMEDRIVE and HOMEPATH are wrong most of the time, too, after changing user context! */ sys_mbstowcs (wuser, user.name (), UNLEN + 1); if (NetUserGetInfo (NULL, wuser, 3, (LPBYTE *) &ui) && user.logsrv ()) { + WCHAR wlogsrv[INTERNET_MAX_HOST_NAME_LENGTH + 3]; strcat (strcpy (buf, "\\\\"), user.logsrv ()); sys_mbstowcs (wlogsrv, buf, INTERNET_MAX_HOST_NAME_LENGTH + 3); ui = NULL; - if (NetUserGetInfo (wlogsrv, wuser, 3,(LPBYTE *) &ui)) + if (NetUserGetInfo (wlogsrv, wuser, 3, (LPBYTE *) &ui)) ui = NULL; } if (ui) diff --git a/winsup/cygwin/window.cc b/winsup/cygwin/window.cc index 4567da6a7..0554f37df 100644 --- a/winsup/cygwin/window.cc +++ b/winsup/cygwin/window.cc @@ -74,7 +74,7 @@ Winmain (VOID *) { MSG msg; WNDCLASS wc; - static const NO_COPY char classname[] = "CygwinWndClass"; + static NO_COPY char classname[] = "CygwinWndClass"; /* Register the window class for the main window. */