DatagramSocket::write() - x64 Warning


#1

Hi Jules,

Just tired of seeing this warning :smiley: - so here’s the fix for it:

int DatagramSocket::write (const void* sourceBuffer, const int numBytesToWrite)
{
    // You need to call connect() first to set the server address..
    jassert (serverAddress != nullptr && connected);

    return connected ? (int) sendto (handle, (const char*) sourceBuffer,
                                     (size_t) numBytesToWrite, 0,
                                     static_cast <const struct addrinfo*> (serverAddress)->ai_addr,
                                     (int) static_cast <const struct addrinfo*> (serverAddress)->ai_addrlen) /*Added typecast to int*/
                     : -1;
}

#2

Thanks. It’s not actually an int on all platforms, but I can cast it to a juce_socklen_t type.