Merge pull request #223 from macvim-dev/fix/netbeans_warnings

Fix #222
This commit is contained in:
Kazuki Sakamoto
2016-01-27 09:08:57 -08:00
2 changed files with 17 additions and 23 deletions
+17 -3
View File
@@ -94,6 +94,9 @@ typedef struct {
#ifdef FEAT_GUI_W32
int ch_inputHandler; /* simply ret.value of WSAAsyncSelect() */
#endif
#ifdef FEAT_GUI_MACVIM
int ch_inputHandler;
#endif
void (*ch_close_cb)(void); /* callback invoked when channel is closed */
} channel_T;
@@ -174,7 +177,7 @@ messageFromNetbeans(gpointer clientData,
}
#endif
#if defined(FEAT_GUI_MACVIM)
#ifdef FEAT_GUI_MACVIM
static int
sock_select(int s)
{
@@ -234,7 +237,12 @@ channel_gui_register(int idx)
* Tell Core Foundation we are interested in being called when there
* is input on the editor connection socket
*/
gui_macvim_set_netbeans_socket(channel->ch_fd);
if (channel->ch_inputHandler == -1) {
channel->ch_inputHandler = 0;
# ifdef FEAT_NETBEANS_INTG
gui_macvim_set_netbeans_socket(channel->ch_fd);
# endif
}
# endif
# endif
# endif
@@ -282,7 +290,13 @@ channel_gui_unregister(int idx)
}
# else
# ifdef FEAT_GUI_MACVIM
gui_macvim_set_netbeans_socket(-1);
if (channel->ch_inputHandler == 0)
{
# ifdef FEAT_NETBEANS_INTG
gui_macvim_set_netbeans_socket(-1);
# endif
channel->ch_inputHandler = -1;
}
# endif
# endif
# endif
-20
View File
@@ -67,10 +67,6 @@ static void nb_free __ARGS((void));
static int nb_channel_idx = -1;
static int r_cmdno; /* current command number for reply */
#ifdef FEAT_GUI_MACVIM
static int sock_select(int s);
#endif
static int dosetvisible = FALSE;
/*
@@ -132,22 +128,6 @@ netbeans_close(void)
#endif
}
#if defined(FEAT_GUI_MACVIM)
static int
sock_select(int s)
{
fd_set readset;
struct timeval timeout;
FD_ZERO(&readset);
FD_SET(s, &readset);
timeout.tv_sec = 0;
timeout.tv_usec = 0;
return select(s + 1, &readset, NULL, NULL, &timeout);
}
#endif /* FEAT_GUI_MACVIM */
#define NB_DEF_HOST "localhost"
#define NB_DEF_ADDR "3219"
#define NB_DEF_PASS "changeme"