code cleanup: warning and style

This commit is contained in:
Campbell Barton 2012-09-17 22:34:42 +00:00
parent aff591c6e1
commit f6251a1f32
7 changed files with 49 additions and 41 deletions

View File

@ -355,9 +355,11 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
/* alphanumerical or punctuation key that is remappable in int'l keyboards */
if ((recvChar >= 'A') && (recvChar <= 'Z')) {
return (GHOST_TKey) (recvChar - 'A' + GHOST_kKeyA);
} else if ((recvChar >= 'a') && (recvChar <= 'z')) {
}
else if ((recvChar >= 'a') && (recvChar <= 'z')) {
return (GHOST_TKey) (recvChar - 'a' + GHOST_kKeyA);
} else {
}
else {
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
KeyboardLayoutRef keyLayout;
UCKeyboardLayout *uchrData;
@ -870,8 +872,8 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
// SetMouseCoalescingEnabled(false, NULL);
//TODO : implement timer ??
/*do {
#if 0
do {
GHOST_TimerManager* timerMgr = getTimerManager();
if (waitForEvent) {
@ -880,7 +882,8 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
if (next == GHOST_kFireTimeNever) {
timeOut = kEventDurationForever;
} else {
}
else {
timeOut = (double)(next - getMilliSeconds())/1000.0;
if (timeOut < 0.0)
timeOut = 0.0;
@ -892,7 +895,7 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
if (timerMgr->fireTimers(getMilliSeconds())) {
anyProcessed = true;
}
*/
#endif
do {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@ -963,7 +966,9 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
[NSApp sendEvent:event];
[pool drain];
} while (event!= nil);
//} while (waitForEvent && !anyProcessed); Needed only for timer implementation
#if 0
} while (waitForEvent && !anyProcessed); // Needed only for timer implementation
#endif
if (m_needDelayedApplicationBecomeActiveEventProcessing) handleApplicationBecomeActiveEvent();
@ -1290,7 +1295,8 @@ GHOST_TUns8 GHOST_SystemCocoa::handleQuitRequest()
{
pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventQuit, NULL) );
return GHOST_kExitNow;
} else {
}
else {
//Give back focus to the blender window if user selected cancel quit
NSArray *windowsList = [NSApp orderedWindows];
if ([windowsList count]) {
@ -1405,7 +1411,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleTabletEvent(void *eventPtr, short eventT
ct.Active = GHOST_kTabletModeNone;
break;
}
} else {
}
else {
// pointer is leaving - return to mouse
ct.Active = GHOST_kTabletModeNone;
}
@ -1694,7 +1701,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
if ([event type] == NSKeyDown) {
pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii, utf8_buf) );
//printf("Key down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf);
} else {
}
else {
pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, 0, '\0') );
//printf("Key up rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf);
}
@ -1780,7 +1788,8 @@ GHOST_TUns8* GHOST_SystemCocoa::getClipboard(bool selection) const
if(temp_buff) {
return temp_buff;
} else {
}
else {
return NULL;
}
}

View File

@ -670,7 +670,8 @@ void GHOST_WindowCocoa::setTitle(const STR_String& title)
[m_window setRepresentedFilename:@""];
}
} else {
}
else {
[m_window setTitle:windowTitle];
[m_window setRepresentedFilename:@""];
}
@ -1288,7 +1289,8 @@ void GHOST_WindowCocoa::loadCursor(bool visible, GHOST_TStandardCursor cursor) c
if (cursor == GHOST_kStandardCursorCustom && m_customCursor) {
tmpCursor = m_customCursor;
} else {
}
else {
switch (cursor) {
case GHOST_kStandardCursorDestroy:
tmpCursor = [NSCursor disappearingItemCursor];

View File

@ -208,7 +208,8 @@ void event_to_buf(GHOST_EventHandle evt, char buf[128])
char *s= GHOST_GetTitle(win);
pos += sprintf(pos, " - win: %s", s);
free(s);
} else {
}
else {
pos+= sprintf(pos, " - sys evt");
}
switch (type) {

View File

@ -181,7 +181,8 @@ public:
if (getDataSize) {
mem_in_use = total_size();
} else {
}
else {
mem_in_use = MEM_get_memory_in_use();
}
@ -198,14 +199,16 @@ public:
if (getDataSize) {
cur_size = getDataSize(elem->get()->get_data());
} else {
}
else {
cur_size = mem_in_use;
}
if (elem->destroy_if_possible()) {
if (getDataSize) {
mem_in_use -= cur_size;
} else {
}
else {
mem_in_use -= cur_size - MEM_get_memory_in_use();
}
}

View File

@ -515,7 +515,7 @@ void FILE_OT_delete_bookmark(wmOperatorType *ot)
RNA_def_int(ot->srna, "index", -1, -1, 20000, "Index", "", -1, 20000);
}
static int reset_recent_exec(bContext *C, wmOperator *op)
static int reset_recent_exec(bContext *C, wmOperator *UNUSED(op))
{
ScrArea *sa = CTX_wm_area(C);
char name[FILE_MAX];

View File

@ -206,7 +206,8 @@ void fsmenu_insert_entry(struct FSMenu *fsmenu, FSMenuCategory category, const c
if (flag & FS_INSERT_FIRST) {
fsm_iter->next = fsm_head;
fsmenu_set_category(fsmenu, category, fsm_iter);
} else {
}
else {
fsm_iter->next = fsm_prev->next;
fsm_prev->next = fsm_iter;
}

View File

@ -713,14 +713,6 @@ static void playanim_window_open(const char *title, int posx, int posy, int size
inital_state,
GHOST_kDrawingContextTypeOpenGL,
FALSE /* no stereo */, FALSE);
//if (ghostwin) {
//if (win) {
// GHOST_SetWindowUserData(ghostwin, win);
//} else {
// GHOST_DisposeWindow(g_WS.ghost_system, ghostwin);
//}
//}
}