From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LqWgw-0001iF-EH for qemu-devel@nongnu.org; Sun, 05 Apr 2009 14:03:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LqWgv-0001ha-Mw for qemu-devel@nongnu.org; Sun, 05 Apr 2009 14:03:33 -0400 Received: from [199.232.76.173] (port=47464 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LqWgv-0001hQ-Dm for qemu-devel@nongnu.org; Sun, 05 Apr 2009 14:03:33 -0400 Received: from savannah.gnu.org ([199.232.41.3]:35308 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LqWgu-0006Sd-Rc for qemu-devel@nongnu.org; Sun, 05 Apr 2009 14:03:33 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LqWgu-0008GI-BD for qemu-devel@nongnu.org; Sun, 05 Apr 2009 18:03:32 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LqWgt-0008GD-VM for qemu-devel@nongnu.org; Sun, 05 Apr 2009 18:03:32 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Sun, 05 Apr 2009 18:03:31 +0000 Subject: [Qemu-devel] [6984] Fix some win32 compile warnings Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6984 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6984 Author: blueswir1 Date: 2009-04-05 18:03:31 +0000 (Sun, 05 Apr 2009) Log Message: ----------- Fix some win32 compile warnings Modified Paths: -------------- trunk/block-raw-win32.c trunk/exec.c trunk/nbd.c trunk/net.c trunk/slirp/misc.c trunk/slirp/socket.h trunk/tap-win32.c trunk/vl.c Modified: trunk/block-raw-win32.c =================================================================== --- trunk/block-raw-win32.c 2009-04-05 17:41:02 UTC (rev 6983) +++ trunk/block-raw-win32.c 2009-04-05 18:03:31 UTC (rev 6984) @@ -166,7 +166,7 @@ static int raw_truncate(BlockDriverState *bs, int64_t offset) { BDRVRawState *s = bs->opaque; - DWORD low, high; + LONG low, high; low = offset; high = offset >> 32; @@ -188,7 +188,7 @@ switch(s->type) { case FTYPE_FILE: - l.LowPart = GetFileSize(s->hfile, &l.HighPart); + l.LowPart = GetFileSize(s->hfile, (PDWORD)&l.HighPart); if (l.LowPart == 0xffffffffUL && GetLastError() != NO_ERROR) return -EIO; break; Modified: trunk/exec.c =================================================================== --- trunk/exec.c 2009-04-05 17:41:02 UTC (rev 6983) +++ trunk/exec.c 2009-04-05 18:03:31 UTC (rev 6984) @@ -19,7 +19,6 @@ */ #include "config.h" #ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN #include #else #include Modified: trunk/nbd.c =================================================================== --- trunk/nbd.c 2009-04-05 17:41:02 UTC (rev 6983) +++ trunk/nbd.c 2009-04-05 18:03:31 UTC (rev 6984) @@ -579,7 +579,7 @@ if ((request.from + request.len) > size) { LOG("From: %" PRIu64 ", Len: %u, Size: %" PRIu64 ", Offset: %" PRIu64 "\n", - request.from, request.len, size, dev_offset); + request.from, request.len, (uint64_t)size, dev_offset); LOG("requested operation past EOF--bad client?"); errno = EINVAL; return -1; Modified: trunk/net.c =================================================================== --- trunk/net.c 2009-04-05 17:41:02 UTC (rev 6983) +++ trunk/net.c 2009-04-05 18:03:31 UTC (rev 6984) @@ -1903,9 +1903,9 @@ void net_cleanup(void) { +#if !defined(_WIN32) VLANState *vlan; -#if !defined(_WIN32) /* close network clients */ for(vlan = first_vlan; vlan != NULL; vlan = vlan->next) { VLANClientState *vc; Modified: trunk/slirp/misc.c =================================================================== --- trunk/slirp/misc.c 2009-04-05 17:41:02 UTC (rev 6983) +++ trunk/slirp/misc.c 2009-04-05 18:03:31 UTC (rev 6984) @@ -777,7 +777,11 @@ fd_nonblock(int fd) { #ifdef FIONBIO - int opt = 1; +#ifdef _WIN32 + long opt = 1; +#else + int opt = 1; +#endif ioctlsocket(fd, FIONBIO, &opt); #else Modified: trunk/slirp/socket.h =================================================================== --- trunk/slirp/socket.h 2009-04-05 17:41:02 UTC (rev 6983) +++ trunk/slirp/socket.h 2009-04-05 18:03:31 UTC (rev 6984) @@ -87,6 +87,7 @@ void soisfconnected _P((register struct socket *)); void soisfdisconnected _P((struct socket *)); void sofwdrain _P((struct socket *)); +struct iovec; /* For win32 */ size_t sopreprbuf(struct socket *so, struct iovec *iov, int *np); int soreadbuf(struct socket *so, const char *buf, int size); Modified: trunk/tap-win32.c =================================================================== --- trunk/tap-win32.c 2009-04-05 17:41:02 UTC (rev 6983) +++ trunk/tap-win32.c 2009-04-05 18:03:31 UTC (rev 6984) @@ -254,7 +254,7 @@ component_id_string, NULL, &data_type, - component_id, + (LPBYTE)component_id, &len); if (!(status != ERROR_SUCCESS || data_type != REG_SZ)) { @@ -264,7 +264,7 @@ net_cfg_instance_id_string, NULL, &data_type, - net_cfg_instance_id, + (LPBYTE)net_cfg_instance_id, &len); if (status == ERROR_SUCCESS && data_type == REG_SZ) { @@ -353,7 +353,7 @@ name_string, NULL, &name_type, - name_data, + (LPBYTE)name_data, &len); if (status != ERROR_SUCCESS || name_type != REG_SZ) { @@ -560,7 +560,7 @@ } static void tap_win32_free_buffer(tap_win32_overlapped_t *overlapped, - char* pbuf) + uint8_t *pbuf) { tun_buffer_t* buffer = (tun_buffer_t*)pbuf; put_buffer_on_free_list(overlapped, buffer); @@ -580,7 +580,7 @@ unsigned long minor; unsigned long debug; } version; - LONG version_len; + DWORD version_len; DWORD idThread; HANDLE hThread; Modified: trunk/vl.c =================================================================== --- trunk/vl.c 2009-04-05 17:41:02 UTC (rev 6983) +++ trunk/vl.c 2009-04-05 18:03:31 UTC (rev 6984) @@ -245,7 +245,9 @@ int no_shutdown = 0; int cursor_hide = 1; int graphic_rotate = 0; +#ifndef _WIN32 int daemonize = 0; +#endif const char *option_rom[MAX_OPTION_ROMS]; int nb_option_roms; int semihosting_enabled = 0; @@ -1297,8 +1299,9 @@ } #ifdef _WIN32 -void CALLBACK host_alarm_handler(UINT uTimerID, UINT uMsg, - DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) +static void CALLBACK host_alarm_handler(UINT uTimerID, UINT uMsg, + DWORD_PTR dwUser, DWORD_PTR dw1, + DWORD_PTR dw2) #else static void host_alarm_handler(int host_signum) #endif @@ -4262,14 +4265,18 @@ const char *cpu_model; const char *usb_devices[MAX_USB_CMDLINE]; int usb_devices_index; +#ifndef _WIN32 int fds[2]; +#endif int tb_size; const char *pid_file = NULL; const char *incoming = NULL; +#ifndef _WIN32 int fd = 0; struct passwd *pwd = NULL; const char *chroot_dir = NULL; const char *run_as = NULL; +#endif qemu_cache_utils_init(envp); @@ -5015,7 +5022,6 @@ signal(SIGTTOU, SIG_IGN); signal(SIGTTIN, SIG_IGN); } -#endif if (pid_file && qemu_create_pidfile(pid_file) != 0) { if (daemonize) { @@ -5025,6 +5031,7 @@ fprintf(stderr, "Could not acquire pid file\n"); exit(1); } +#endif #ifdef USE_KQEMU if (smp_cpus > 1) @@ -5385,6 +5392,7 @@ if (autostart) vm_start(); +#ifndef _WIN32 if (daemonize) { uint8_t status = 0; ssize_t len; @@ -5403,7 +5411,6 @@ exit(1); } -#ifndef _WIN32 if (run_as) { pwd = getpwnam(run_as); if (!pwd) { @@ -5434,7 +5441,6 @@ exit(1); } } -#endif if (daemonize) { dup2(fd, 0); @@ -5443,6 +5449,7 @@ close(fd); } +#endif main_loop(); quit_timers();