[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] sizeof int /= size of void*
From: |
Stephen Leake |
Subject: |
[Monotone-devel] sizeof int /= size of void* |
Date: |
Wed, 30 Apr 2014 04:31:04 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt) |
In mingw64, pointers are 64 bit, 'int' is 32 bit. So I'm getting an
error in netxx:
../monotone/src/netxx_pipe.cc:365:31: error: cast from 'HANDLE {aka void*}' to
'Netxx::socket_type {aka int}' loses precision [-fpermissive]
return (Netxx::socket_type) named_pipe;
The context is:
Netxx::socket_type
Netxx::PipeStream::get_socketfd (void) const
{
#ifdef WIN32
return (Netxx::socket_type) named_pipe;
#else
return Netxx::socket_type(-1);
#endif
}
'socket_type' is declared in src/netxx/types.h:
/// type for representing socket file descriptors
typedef signed int socket_type;
Changing this to:
/// type for representing socket file descriptors
#ifdef WIN32
typedef HANDLE socket_type;
#else
typedef signed int socket_type;
#endif
fixes that error. There are still a couple of others, like:
if (fd == -1)
break;
Should I commit these changes in nvm, or use a devel branch?
--
-- Stephe
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Monotone-devel] sizeof int /= size of void*,
Stephen Leake <=