code cleanup: warning and style
This commit is contained in:
parent
aff591c6e1
commit
f6251a1f32
|
@ -355,16 +355,18 @@ 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;
|
||||
|
||||
KLGetCurrentKeyboardLayout(&keyLayout);
|
||||
KLGetKeyboardLayoutProperty(keyLayout, kKLuchrData, (const void **)
|
||||
&uchrData);
|
||||
&uchrData);
|
||||
/*get actual character value of the "remappable" keys in int'l keyboards,
|
||||
if keyboard layout is not correctly reported (e.g. some non Apple keyboards in Tiger),
|
||||
then fallback on using the received charactersIgnoringModifiers */
|
||||
|
@ -870,29 +872,30 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
|
|||
|
||||
// SetMouseCoalescingEnabled(false, NULL);
|
||||
//TODO : implement timer ??
|
||||
|
||||
/*do {
|
||||
#if 0
|
||||
do {
|
||||
GHOST_TimerManager* timerMgr = getTimerManager();
|
||||
|
||||
if (waitForEvent) {
|
||||
GHOST_TUns64 next = timerMgr->nextFireTime();
|
||||
double timeOut;
|
||||
GHOST_TUns64 next = timerMgr->nextFireTime();
|
||||
double timeOut;
|
||||
|
||||
if (next == GHOST_kFireTimeNever) {
|
||||
timeOut = kEventDurationForever;
|
||||
} else {
|
||||
timeOut = (double)(next - getMilliSeconds())/1000.0;
|
||||
if (timeOut < 0.0)
|
||||
timeOut = 0.0;
|
||||
}
|
||||
if (next == GHOST_kFireTimeNever) {
|
||||
timeOut = kEventDurationForever;
|
||||
}
|
||||
else {
|
||||
timeOut = (double)(next - getMilliSeconds())/1000.0;
|
||||
if (timeOut < 0.0)
|
||||
timeOut = 0.0;
|
||||
}
|
||||
|
||||
::ReceiveNextEvent(0, NULL, timeOut, false, &event);
|
||||
::ReceiveNextEvent(0, NULL, timeOut, false, &event);
|
||||
}
|
||||
|
||||
if (timerMgr->fireTimers(getMilliSeconds())) {
|
||||
anyProcessed = true;
|
||||
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();
|
||||
|
||||
|
@ -1285,12 +1290,13 @@ GHOST_TUns8 GHOST_SystemCocoa::handleQuitRequest()
|
|||
if (m_windowManager->getAnyModifiedState())
|
||||
{
|
||||
int shouldQuit = NSRunAlertPanel(@"Exit Blender", @"Some changes have not been saved.\nDo you really want to quit ?",
|
||||
@"Cancel", @"Quit Anyway", nil);
|
||||
@"Cancel", @"Quit Anyway", nil);
|
||||
if (shouldQuit == NSAlertAlternateReturn)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -179,9 +179,10 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
if(getDataSize) {
|
||||
if (getDataSize) {
|
||||
mem_in_use = total_size();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
mem_in_use = MEM_get_memory_in_use();
|
||||
}
|
||||
|
||||
|
@ -196,16 +197,18 @@ public:
|
|||
|
||||
priority_queue.pop();
|
||||
|
||||
if(getDataSize) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
//}
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue