window_context->geometry.width, window_context->geometry.height);
Gesture_Info *info = (Gesture_Info *)calloc(sizeof(Gesture_Info), 1);
+ if (!info) {
+ LOGD("Memory alloc failed for Gesture_Info");
+ return;
+ }
if (!eldbus_message_arguments_get(msg, "iii", &g_type, &info->x,
&info->y)) {
LOGD("Getting message arguments failed");
if (coordinate) {
SCLShiftState shift_index = get_shift_state();
- if (shift_index < 0 || shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
+ if (shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
desc->key_event = coordinate->key_event[shift_index][0];
desc->key_value = coordinate->key_value[shift_index][0];
desc->key_type = coordinate->key_type;
SCLShiftState CSCLContext::get_shift_state() const
{
SCLShiftState ret = SCL_SHIFT_STATE_OFF;
- if (m_shift_state >= 0 && m_shift_state < SCL_SHIFT_STATE_MAX) {
+ if (m_shift_state < SCL_SHIFT_STATE_MAX) {
ret = m_shift_state;
}
return ret;
void CSCLContext::set_shift_state(SCLShiftState val)
{
- if (val >= 0 && val < SCL_SHIFT_STATE_MAX) {
+ if (val < SCL_SHIFT_STATE_MAX) {
m_shift_state = val;
if (val == SCL_SHIFT_STATE_OFF) {
m_shift_multi_touch_state = SCL_SHIFT_MULTITOUCH_OFF;
SCLShiftMultitouchState CSCLContext::get_shift_multi_touch_state() const
{
SCLShiftMultitouchState ret = SCL_SHIFT_MULTITOUCH_OFF;
- if (m_shift_multi_touch_state >= 0 && m_shift_multi_touch_state < SCL_SHIFT_MULTITOUCH_MAX) {
+ if (m_shift_multi_touch_state < SCL_SHIFT_MULTITOUCH_MAX) {
ret = m_shift_multi_touch_state;
}
return ret;
void CSCLContext::set_shift_multi_touch_state(SCLShiftMultitouchState val)
{
- if (val >= 0 && val < SCL_SHIFT_MULTITOUCH_MAX) {
+ if (val < SCL_SHIFT_MULTITOUCH_MAX) {
m_shift_multi_touch_state = val;
}
}
/* FIXME : There is a case that begin_pain fails. Inspection on the root cause is needed */
if (draw_ctx) {
SCLShiftState shift_index = context->get_shift_state();
- if (shift_index < 0 || shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
+ if (shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
const SclLayout* layout = cache->get_cur_layout(window);
const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
SclButtonContext* button_context = cache->get_cur_button_context(pressed_window, pressed_key);
SCLShiftState shift_index = context->get_shift_state();
- if (shift_index < 0 || shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
+ if (shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}