Fix 2 warnings, formatting

This commit is contained in:
Philip Zander 2020-07-16 15:44:08 +02:00
parent 9bf9c76365
commit 5b81864211
2 changed files with 10 additions and 7 deletions

View File

@ -2589,12 +2589,14 @@ gdk_event_translate (MSG *msg,
/* The character is encoded in WPARAM as UTF-16. */
gunichar2 c = msg2.wParam;
if (!g_unichar_iscntrl(c)) { /* Ignore control sequences like Backspace */
/* Append character to translation string. */
event_priv->translation_len ++;
event_priv->translation = g_realloc (event_priv->translation, event_priv->translation_len * sizeof (event_priv->translation[0]));
event_priv->translation[event_priv->translation_len - 1] = c;
}
/* Ignore control sequences like Backspace */
if (!g_unichar_iscntrl(c))
{
/* Append character to translation string. */
event_priv->translation_len ++;
event_priv->translation = g_realloc (event_priv->translation, event_priv->translation_len * sizeof (event_priv->translation[0]));
event_priv->translation[event_priv->translation_len - 1] = c;
}
/* Remove message from queue */
GetMessageW (&msg2, msg->hwnd, 0, 0);

View File

@ -27,6 +27,7 @@
#undef GTK_DISABLE_DEPRECATED
#endif
#include "config.h"
#include "gtkimcontextime.h"
#include "imm-extra.h"
@ -328,7 +329,7 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context,
context_ime = GTK_IM_CONTEXT_IME (context);
g_return_val_if_fail (gdk_event_is_allocated (event), FALSE);
g_return_val_if_fail (gdk_event_is_allocated ((GdkEvent*)event), FALSE);
event_priv = (GdkEventPrivate*) event;
if (event_priv->translation_len == 0)