forked from enlightenment/efl
ecore_cocoa: prettify code a bit
Remove extraneous whitespaces, use appropriate macros when possible, and mark a memory allocation failure as an unlikely case.
This commit is contained in:
parent
4029164c8e
commit
5c366cab26
|
@ -124,8 +124,8 @@ _ecore_cocoa_event_key(NSEvent *event,
|
|||
|
||||
DBG("Event Key, keyType : %lu", keyType);
|
||||
|
||||
ev = calloc(1, sizeof (Ecore_Event_Key));
|
||||
if (!ev) return NULL;
|
||||
ev = calloc(1, sizeof(*ev));
|
||||
if (EINA_UNLIKELY(!ev)) return NULL;
|
||||
|
||||
if (compose && (keyType == NSEventTypeKeyDown))
|
||||
{
|
||||
|
@ -145,7 +145,7 @@ _ecore_cocoa_event_key(NSEvent *event,
|
|||
|
||||
if ([keychar length] > 0)
|
||||
{
|
||||
for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_cocoa_keys_s); ++i)
|
||||
for (i = 0; i < EINA_C_ARRAY_LENGTH(keystable); ++i)
|
||||
{
|
||||
if (keystable[i].code == [keychar characterAtIndex:0])
|
||||
{
|
||||
|
@ -182,7 +182,7 @@ _ecore_cocoa_feed_events(void *anEvent)
|
|||
unsigned int time = (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff);
|
||||
Eina_Bool pass = EINA_FALSE;
|
||||
|
||||
DBG("Feed events, event type ; %lu", [event type]);
|
||||
DBG("Feed events, event type ; %lx", [event type]);
|
||||
|
||||
switch ([event type])
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue