diff options
| author | Jan D | 2015-05-15 17:06:03 +0200 |
|---|---|---|
| committer | Jan D | 2015-05-15 17:06:16 +0200 |
| commit | b00168e833ccca1b5c0eebe56688ec44e0efabe7 (patch) | |
| tree | 496d6cebab472c5b4a24d78194e40399f72028d0 /src | |
| parent | d02ce2c4321d7b99abc2de21e01f9504008ec735 (diff) | |
| download | emacs-b00168e833ccca1b5c0eebe56688ec44e0efabe7.tar.gz emacs-b00168e833ccca1b5c0eebe56688ec44e0efabe7.zip | |
Fix NS warnings.
* nsmenu.m (ns_popup_dialog)
* nsimage.m (initFromXBM:width:height:fg:bg:)
* nsfns.m (Fx_create_frame): Remove unused variables.
(Fns_read_file_name): Initialize fname, remove ret.
* nsterm.m (ns_draw_window_cursor): Handle DEFAULT_CURSOR in switch.
(ns_get_color, ns_set_horizontal_scroll_bar, keyDown): Remove unused
variable.
(init): Add parantesis in if.
(ns_create_terminal): Assign set_horizontal_scroll_bar_hook.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsfns.m | 13 | ||||
| -rw-r--r-- | src/nsimage.m | 1 | ||||
| -rw-r--r-- | src/nsmenu.m | 2 | ||||
| -rw-r--r-- | src/nsterm.m | 23 |
4 files changed, 9 insertions, 30 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index 5f584e1c1bb..8a3c6ccf2b0 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -1075,7 +1075,6 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 1075 | Lisp_Object name; | 1075 | Lisp_Object name; |
| 1076 | int minibuffer_only = 0; | 1076 | int minibuffer_only = 0; |
| 1077 | long window_prompting = 0; | 1077 | long window_prompting = 0; |
| 1078 | int width, height; | ||
| 1079 | ptrdiff_t count = specpdl_ptr - specpdl; | 1078 | ptrdiff_t count = specpdl_ptr - specpdl; |
| 1080 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 1079 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 1081 | Lisp_Object display; | 1080 | Lisp_Object display; |
| @@ -1475,10 +1474,9 @@ Optional arg DIR_ONLY_P, if non-nil, means choose only directories. */) | |||
| 1475 | Lisp_Object init, Lisp_Object dir_only_p) | 1474 | Lisp_Object init, Lisp_Object dir_only_p) |
| 1476 | { | 1475 | { |
| 1477 | static id fileDelegate = nil; | 1476 | static id fileDelegate = nil; |
| 1478 | BOOL ret; | ||
| 1479 | BOOL isSave = NILP (mustmatch) && NILP (dir_only_p); | 1477 | BOOL isSave = NILP (mustmatch) && NILP (dir_only_p); |
| 1480 | id panel; | 1478 | id panel; |
| 1481 | Lisp_Object fname; | 1479 | Lisp_Object fname = Qnil; |
| 1482 | 1480 | ||
| 1483 | NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : | 1481 | NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : |
| 1484 | [NSString stringWithUTF8String: SSDATA (prompt)]; | 1482 | [NSString stringWithUTF8String: SSDATA (prompt)]; |
| @@ -1558,20 +1556,17 @@ Optional arg DIR_ONLY_P, if non-nil, means choose only directories. */) | |||
| 1558 | while (ns_fd_data.panel != nil) | 1556 | while (ns_fd_data.panel != nil) |
| 1559 | [NSApp run]; | 1557 | [NSApp run]; |
| 1560 | 1558 | ||
| 1561 | ret = (ns_fd_data.ret == MODAL_OK_RESPONSE); | 1559 | if (ns_fd_data.ret == MODAL_OK_RESPONSE) |
| 1562 | |||
| 1563 | if (ret) | ||
| 1564 | { | 1560 | { |
| 1565 | NSString *str = ns_filename_from_panel (panel); | 1561 | NSString *str = ns_filename_from_panel (panel); |
| 1566 | if (! str) str = ns_directory_from_panel (panel); | 1562 | if (! str) str = ns_directory_from_panel (panel); |
| 1567 | if (! str) ret = NO; | 1563 | if (str) fname = build_string ([str UTF8String]); |
| 1568 | else fname = build_string ([str UTF8String]); | ||
| 1569 | } | 1564 | } |
| 1570 | 1565 | ||
| 1571 | [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow]; | 1566 | [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow]; |
| 1572 | unblock_input (); | 1567 | unblock_input (); |
| 1573 | 1568 | ||
| 1574 | return ret ? fname : Qnil; | 1569 | return fname; |
| 1575 | } | 1570 | } |
| 1576 | 1571 | ||
| 1577 | const char * | 1572 | const char * |
diff --git a/src/nsimage.m b/src/nsimage.m index 4d01419edf9..9302cd2f212 100644 --- a/src/nsimage.m +++ b/src/nsimage.m | |||
| @@ -211,7 +211,6 @@ ns_set_alpha (void *img, int x, int y, unsigned char a) | |||
| 211 | - initFromXBM: (unsigned char *)bits width: (int)w height: (int)h | 211 | - initFromXBM: (unsigned char *)bits width: (int)w height: (int)h |
| 212 | fg: (unsigned long)fg bg: (unsigned long)bg | 212 | fg: (unsigned long)fg bg: (unsigned long)bg |
| 213 | { | 213 | { |
| 214 | int bpr = (w + 7) / 8; | ||
| 215 | unsigned char *planes[5]; | 214 | unsigned char *planes[5]; |
| 216 | 215 | ||
| 217 | [self initWithSize: NSMakeSize (w, h)]; | 216 | [self initWithSize: NSMakeSize (w, h)]; |
diff --git a/src/nsmenu.m b/src/nsmenu.m index a4c26fe82ba..b5cb64d68e5 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -1418,7 +1418,7 @@ Lisp_Object | |||
| 1418 | ns_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) | 1418 | ns_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) |
| 1419 | { | 1419 | { |
| 1420 | id dialog; | 1420 | id dialog; |
| 1421 | Lisp_Object window, tem, title; | 1421 | Lisp_Object tem, title; |
| 1422 | NSPoint p; | 1422 | NSPoint p; |
| 1423 | BOOL isQ; | 1423 | BOOL isQ; |
| 1424 | NSAutoreleasePool *pool; | 1424 | NSAutoreleasePool *pool; |
diff --git a/src/nsterm.m b/src/nsterm.m index 11656a780ce..67a03898d13 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -1538,7 +1538,7 @@ ns_get_color (const char *name, NSColor **col) | |||
| 1538 | { | 1538 | { |
| 1539 | NSColor *new = nil; | 1539 | NSColor *new = nil; |
| 1540 | static char hex[20]; | 1540 | static char hex[20]; |
| 1541 | int scaling; | 1541 | int scaling = 0; |
| 1542 | float r = -1.0, g, b; | 1542 | float r = -1.0, g, b; |
| 1543 | NSString *nsname = [NSString stringWithUTF8String: name]; | 1543 | NSString *nsname = [NSString stringWithUTF8String: name]; |
| 1544 | 1544 | ||
| @@ -2465,6 +2465,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, | |||
| 2465 | 2465 | ||
| 2466 | switch (cursor_type) | 2466 | switch (cursor_type) |
| 2467 | { | 2467 | { |
| 2468 | case DEFAULT_CURSOR: | ||
| 2468 | case NO_CURSOR: | 2469 | case NO_CURSOR: |
| 2469 | break; | 2470 | break; |
| 2470 | case FILLED_BOX_CURSOR: | 2471 | case FILLED_BOX_CURSOR: |
| @@ -3963,7 +3964,6 @@ ns_set_horizontal_scroll_bar (struct window *window, | |||
| 3963 | EmacsScroller *bar; | 3964 | EmacsScroller *bar; |
| 3964 | int top, height, left, width; | 3965 | int top, height, left, width; |
| 3965 | int window_x, window_width; | 3966 | int window_x, window_width; |
| 3966 | int pixel_width = WINDOW_PIXEL_WIDTH (window); | ||
| 3967 | BOOL update_p = YES; | 3967 | BOOL update_p = YES; |
| 3968 | 3968 | ||
| 3969 | /* optimization; display engine sends WAY too many of these.. */ | 3969 | /* optimization; display engine sends WAY too many of these.. */ |
| @@ -4321,6 +4321,7 @@ ns_create_terminal (struct ns_display_info *dpyinfo) | |||
| 4321 | terminal->menu_show_hook = ns_menu_show; | 4321 | terminal->menu_show_hook = ns_menu_show; |
| 4322 | terminal->popup_dialog_hook = ns_popup_dialog; | 4322 | terminal->popup_dialog_hook = ns_popup_dialog; |
| 4323 | terminal->set_vertical_scroll_bar_hook = ns_set_vertical_scroll_bar; | 4323 | terminal->set_vertical_scroll_bar_hook = ns_set_vertical_scroll_bar; |
| 4324 | terminal->set_horizontal_scroll_bar_hook = ns_set_horizontal_scroll_bar; | ||
| 4324 | terminal->condemn_scroll_bars_hook = ns_condemn_scroll_bars; | 4325 | terminal->condemn_scroll_bars_hook = ns_condemn_scroll_bars; |
| 4325 | terminal->redeem_scroll_bar_hook = ns_redeem_scroll_bar; | 4326 | terminal->redeem_scroll_bar_hook = ns_redeem_scroll_bar; |
| 4326 | terminal->judge_scroll_bars_hook = ns_judge_scroll_bars; | 4327 | terminal->judge_scroll_bars_hook = ns_judge_scroll_bars; |
| @@ -4605,7 +4606,7 @@ ns_term_shutdown (int sig) | |||
| 4605 | 4606 | ||
| 4606 | - (id)init | 4607 | - (id)init |
| 4607 | { | 4608 | { |
| 4608 | if (self = [super init]) | 4609 | if ((self = [super init])) |
| 4609 | { | 4610 | { |
| 4610 | #ifdef NS_IMPL_COCOA | 4611 | #ifdef NS_IMPL_COCOA |
| 4611 | self->isFirst = YES; | 4612 | self->isFirst = YES; |
| @@ -5272,9 +5273,6 @@ not_in_argv (NSString *arg) | |||
| 5272 | int code; | 5273 | int code; |
| 5273 | unsigned fnKeysym = 0; | 5274 | unsigned fnKeysym = 0; |
| 5274 | static NSMutableArray *nsEvArray; | 5275 | static NSMutableArray *nsEvArray; |
| 5275 | #ifdef NS_IMPL_GNUSTEP | ||
| 5276 | static BOOL firstTime = YES; | ||
| 5277 | #endif | ||
| 5278 | int left_is_none; | 5276 | int left_is_none; |
| 5279 | unsigned int flags = [theEvent modifierFlags]; | 5277 | unsigned int flags = [theEvent modifierFlags]; |
| 5280 | 5278 | ||
| @@ -5503,18 +5501,6 @@ not_in_argv (NSString *arg) | |||
| 5503 | } | 5501 | } |
| 5504 | 5502 | ||
| 5505 | 5503 | ||
| 5506 | #ifdef NS_IMPL_GNUSTEP | ||
| 5507 | /* if we get here we should send the key for input manager processing */ | ||
| 5508 | /* Disable warning, there is nothing a user can do about it anyway, and | ||
| 5509 | it does not seem to matter. */ | ||
| 5510 | #if 0 | ||
| 5511 | if (firstTime && [[NSInputManager currentInputManager] | ||
| 5512 | wantsToDelayTextChangeNotifications] == NO) | ||
| 5513 | fprintf (stderr, | ||
| 5514 | "Emacs: WARNING: TextInput mgr wants marked text to be permanent!\n"); | ||
| 5515 | #endif | ||
| 5516 | firstTime = NO; | ||
| 5517 | #endif | ||
| 5518 | if (NS_KEYLOG && !processingCompose) | 5504 | if (NS_KEYLOG && !processingCompose) |
| 5519 | fprintf (stderr, "keyDown: Begin compose sequence.\n"); | 5505 | fprintf (stderr, "keyDown: Begin compose sequence.\n"); |
| 5520 | 5506 | ||
| @@ -7202,7 +7188,6 @@ if (cols > 0 && rows > 0) | |||
| 7202 | one screen, we want to constrain. Other times not. */ | 7188 | one screen, we want to constrain. Other times not. */ |
| 7203 | NSArray *screens = [NSScreen screens]; | 7189 | NSArray *screens = [NSScreen screens]; |
| 7204 | NSUInteger nr_screens = [screens count], nr_eff_screens = 0, i; | 7190 | NSUInteger nr_screens = [screens count], nr_eff_screens = 0, i; |
| 7205 | struct frame *f = ((EmacsView *)[self delegate])->emacsframe; | ||
| 7206 | NSTRACE (constrainFrameRect); | 7191 | NSTRACE (constrainFrameRect); |
| 7207 | NSTRACE_RECT ("input", frameRect); | 7192 | NSTRACE_RECT ("input", frameRect); |
| 7208 | 7193 | ||