summaryrefslogtreecommitdiff
path: root/src/lib/ecore_cocoa
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean@guyomarch.bzh>2016-10-30 16:34:35 +0100
committerJean Guyomarc'h <jean@guyomarch.bzh>2016-10-30 16:46:30 +0100
commit5c366cab268a8e6b1d11b84794277c725040d3e6 (patch)
treed282166c168953d464200001a03822a0e6c9eedb /src/lib/ecore_cocoa
parent4029164c8ecc301ebf055eb408b177deb278c9d9 (diff)
ecore_cocoa: prettify code a bit
Remove extraneous whitespaces, use appropriate macros when possible, and mark a memory allocation failure as an unlikely case.
Diffstat (limited to 'src/lib/ecore_cocoa')
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa.m16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/ecore_cocoa/ecore_cocoa.m b/src/lib/ecore_cocoa/ecore_cocoa.m
index d180561cc5..7204f89417 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa.m
@@ -124,13 +124,13 @@ _ecore_cocoa_event_key(NSEvent *event,
124 124
125 DBG("Event Key, keyType : %lu", keyType); 125 DBG("Event Key, keyType : %lu", keyType);
126 126
127 ev = calloc(1, sizeof (Ecore_Event_Key)); 127 ev = calloc(1, sizeof(*ev));
128 if (!ev) return NULL; 128 if (EINA_UNLIKELY(!ev)) return NULL;
129 129
130 if (compose && (keyType == NSEventTypeKeyDown)) 130 if (compose && (keyType == NSEventTypeKeyDown))
131 { 131 {
132 [edit interpretKeyEvents:[NSArray arrayWithObject:event]]; 132 [edit interpretKeyEvents:[NSArray arrayWithObject:event]];
133 compose=EINA_FALSE; 133 compose = EINA_FALSE;
134 } 134 }
135 135
136 ev->timestamp = time; 136 ev->timestamp = time;
@@ -145,7 +145,7 @@ _ecore_cocoa_event_key(NSEvent *event,
145 145
146 if ([keychar length] > 0) 146 if ([keychar length] > 0)
147 { 147 {
148 for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_cocoa_keys_s); ++i) 148 for (i = 0; i < EINA_C_ARRAY_LENGTH(keystable); ++i)
149 { 149 {
150 if (keystable[i].code == [keychar characterAtIndex:0]) 150 if (keystable[i].code == [keychar characterAtIndex:0])
151 { 151 {
@@ -161,10 +161,10 @@ _ecore_cocoa_event_key(NSEvent *event,
161 } 161 }
162 } 162 }
163 163
164 if (([keycharRaw length] == 0) && (keyType == NSEventTypeKeyDown)) 164 if (([keycharRaw length] == 0) && (keyType == NSEventTypeKeyDown))
165 { 165 {
166 compose=EINA_TRUE; 166 compose = EINA_TRUE;
167 edit = [[event window] fieldEditor:YES forObject:nil]; 167 edit = [[event window] fieldEditor:YES forObject:nil];
168 [edit interpretKeyEvents:[NSArray arrayWithObject:event]]; 168 [edit interpretKeyEvents:[NSArray arrayWithObject:event]];
169 free(ev); 169 free(ev);
170 return NULL; 170 return NULL;
@@ -182,7 +182,7 @@ _ecore_cocoa_feed_events(void *anEvent)
182 unsigned int time = (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff); 182 unsigned int time = (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff);
183 Eina_Bool pass = EINA_FALSE; 183 Eina_Bool pass = EINA_FALSE;
184 184
185 DBG("Feed events, event type ; %lu", [event type]); 185 DBG("Feed events, event type ; %lx", [event type]);
186 186
187 switch ([event type]) 187 switch ([event type])
188 { 188 {