MinGW: Fix -Wsign-compare
This commit is contained in:
parent
6870449734
commit
f3152af8a0
|
@ -124,7 +124,7 @@ ssh_session create_ssh_connection(const ssh_params_t* ssh_params, char** err_inf
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Workaround: it may happen that libssh closes socket in meantime and any next ssh_ call fails so we should detect it in advance */
|
/* Workaround: it may happen that libssh closes socket in meantime and any next ssh_ call fails so we should detect it in advance */
|
||||||
if (ssh_get_fd(sshs) != -1) {
|
if (ssh_get_fd(sshs) != (socket_t)-1) {
|
||||||
/* If a password has been provided and all previous attempts failed, try to use it */
|
/* If a password has been provided and all previous attempts failed, try to use it */
|
||||||
if (ssh_params->password) {
|
if (ssh_params->password) {
|
||||||
ws_info("Connecting using password...");
|
ws_info("Connecting using password...");
|
||||||
|
@ -139,7 +139,7 @@ ssh_session create_ssh_connection(const ssh_params_t* ssh_params, char** err_inf
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Workaround: it may happen that libssh closes socket in meantime and any next ssh_ call fails so we should detect it in advance */
|
/* Workaround: it may happen that libssh closes socket in meantime and any next ssh_ call fails so we should detect it in advance */
|
||||||
if (ssh_get_fd(sshs) != -1) {
|
if (ssh_get_fd(sshs) != (socket_t)-1) {
|
||||||
/* Try to authenticate using standard public key */
|
/* Try to authenticate using standard public key */
|
||||||
ws_info("Connecting using standard public key...");
|
ws_info("Connecting using standard public key...");
|
||||||
if (ssh_userauth_publickey_auto(sshs, NULL, NULL) == SSH_AUTH_SUCCESS) {
|
if (ssh_userauth_publickey_auto(sshs, NULL, NULL) == SSH_AUTH_SUCCESS) {
|
||||||
|
|
|
@ -988,8 +988,8 @@ open_file_hook_proc(HWND of_hwnd, UINT msg, WPARAM w_param, LPARAM l_param) {
|
||||||
g_format_type = (unsigned int) SendMessage(cur_ctrl, CB_GETCURSEL, 0, 0);
|
g_format_type = (unsigned int) SendMessage(cur_ctrl, CB_GETCURSEL, 0, 0);
|
||||||
|
|
||||||
/* The list of file formats is sorted. Get the format by name. */
|
/* The list of file formats is sorted. Get the format by name. */
|
||||||
guint label_len;
|
LRESULT label_len;
|
||||||
label_len = (guint) SendMessage(cur_ctrl, CB_GETLBTEXTLEN, (WPARAM) g_format_type, 0);
|
label_len = SendMessage(cur_ctrl, CB_GETLBTEXTLEN, (WPARAM) g_format_type, 0);
|
||||||
if (label_len != CB_ERR) {
|
if (label_len != CB_ERR) {
|
||||||
TCHAR *label = g_new(TCHAR, label_len+1);
|
TCHAR *label = g_new(TCHAR, label_len+1);
|
||||||
SendMessage(cur_ctrl, CB_GETLBTEXT, (WPARAM) g_format_type, (LPARAM) label);
|
SendMessage(cur_ctrl, CB_GETLBTEXT, (WPARAM) g_format_type, (LPARAM) label);
|
||||||
|
|
|
@ -149,7 +149,7 @@ win32strexception(DWORD exception)
|
||||||
{
|
{
|
||||||
static char errbuf[ERRBUF_SIZE+1];
|
static char errbuf[ERRBUF_SIZE+1];
|
||||||
static const struct exception_msg {
|
static const struct exception_msg {
|
||||||
int code;
|
DWORD code;
|
||||||
char *msg;
|
char *msg;
|
||||||
} exceptions[] = {
|
} exceptions[] = {
|
||||||
{ EXCEPTION_ACCESS_VIOLATION, "Access violation" },
|
{ EXCEPTION_ACCESS_VIOLATION, "Access violation" },
|
||||||
|
@ -177,9 +177,8 @@ win32strexception(DWORD exception)
|
||||||
{ 0, NULL }
|
{ 0, NULL }
|
||||||
};
|
};
|
||||||
#define N_EXCEPTIONS (sizeof exceptions / sizeof exceptions[0])
|
#define N_EXCEPTIONS (sizeof exceptions / sizeof exceptions[0])
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < N_EXCEPTIONS; i++) {
|
for (size_t i = 0; i < N_EXCEPTIONS; i++) {
|
||||||
if (exceptions[i].code == exception)
|
if (exceptions[i].code == exception)
|
||||||
return exceptions[i].msg;
|
return exceptions[i].msg;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue