diff options
| author | Jan D | 2010-08-11 10:58:56 +0200 |
|---|---|---|
| committer | Jan D | 2010-08-11 10:58:56 +0200 |
| commit | 9c5bd55ac617d8978b36815eb711f977aee82ace (patch) | |
| tree | 0853f826b2363c42ff07b9dc53be2cd7e4421777 /src | |
| parent | 7aee76f47d6c0d03e8ca490e7f1721eeb2bca64a (diff) | |
| download | emacs-9c5bd55ac617d8978b36815eb711f977aee82ace.tar.gz emacs-9c5bd55ac617d8978b36815eb711f977aee82ace.zip | |
Use const char* for -Wwrite_strings.
* keyboard.h (_widget_value): name, value and key are const char*.
* nsfont.m (ns_descriptor_to_entity): Use const char*.
* nsmenu.m (parseKeyEquiv, addSubmenuWithTitle)
(addDisplayItemWithImage, update_frame_tool_bar): Use const char*.
* nsterm.h (parseKeyEquiv, addSubmenuWithTitle)
(addDisplayItemWithImage): Use const char*.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/keyboard.h | 6 | ||||
| -rw-r--r-- | src/nsfont.m | 4 | ||||
| -rw-r--r-- | src/nsmenu.m | 12 | ||||
| -rw-r--r-- | src/nsterm.h | 6 |
5 files changed, 25 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1ec37f440c0..240af42ac47 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,15 @@ | |||
| 1 | 2010-08-11 Jan Djärv <jan.h.d@swipnet.se> | 1 | 2010-08-11 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 2 | ||
| 3 | * nsterm.h (parseKeyEquiv, addSubmenuWithTitle) | ||
| 4 | (addDisplayItemWithImage): Use const char*. | ||
| 5 | |||
| 6 | * nsmenu.m (parseKeyEquiv, addSubmenuWithTitle) | ||
| 7 | (addDisplayItemWithImage, update_frame_tool_bar): Use const char*. | ||
| 8 | |||
| 9 | * nsfont.m (ns_descriptor_to_entity): Use const char*. | ||
| 10 | |||
| 11 | * keyboard.h (_widget_value): name, value and key are const char*. | ||
| 12 | |||
| 3 | * unexmacosx.c (unexec_error): Use const char *. | 13 | * unexmacosx.c (unexec_error): Use const char *. |
| 4 | 14 | ||
| 5 | 2010-08-09 Dan Nicolaescu <dann@ics.uci.edu> | 15 | 2010-08-09 Dan Nicolaescu <dann@ics.uci.edu> |
diff --git a/src/keyboard.h b/src/keyboard.h index 693137b08f4..757f538560c 100644 --- a/src/keyboard.h +++ b/src/keyboard.h | |||
| @@ -338,12 +338,12 @@ typedef struct _widget_value | |||
| 338 | { | 338 | { |
| 339 | /* name of widget */ | 339 | /* name of widget */ |
| 340 | Lisp_Object lname; | 340 | Lisp_Object lname; |
| 341 | char* name; | 341 | const char* name; |
| 342 | /* value (meaning depend on widget type) */ | 342 | /* value (meaning depend on widget type) */ |
| 343 | char* value; | 343 | const char* value; |
| 344 | /* keyboard equivalent. no implications for XtTranslations */ | 344 | /* keyboard equivalent. no implications for XtTranslations */ |
| 345 | Lisp_Object lkey; | 345 | Lisp_Object lkey; |
| 346 | char* key; | 346 | const char* key; |
| 347 | /* Help string or nil if none. | 347 | /* Help string or nil if none. |
| 348 | GC finds this string through the frame's menu_bar_vector | 348 | GC finds this string through the frame's menu_bar_vector |
| 349 | or through menu_items. */ | 349 | or through menu_items. */ |
diff --git a/src/nsfont.m b/src/nsfont.m index aaa5999e048..115986774d8 100644 --- a/src/nsfont.m +++ b/src/nsfont.m | |||
| @@ -161,7 +161,9 @@ static NSFontDescriptor | |||
| 161 | 161 | ||
| 162 | /* Converts NSFont descriptor to FONT_WEIGHT, FONT_SLANT, FONT_WIDTH, etc.. */ | 162 | /* Converts NSFont descriptor to FONT_WEIGHT, FONT_SLANT, FONT_WIDTH, etc.. */ |
| 163 | static Lisp_Object | 163 | static Lisp_Object |
| 164 | ns_descriptor_to_entity (NSFontDescriptor *desc, Lisp_Object extra, char *style) | 164 | ns_descriptor_to_entity (NSFontDescriptor *desc, |
| 165 | Lisp_Object extra, | ||
| 166 | const char *style) | ||
| 165 | { | 167 | { |
| 166 | Lisp_Object font_entity = font_make_entity (); | 168 | Lisp_Object font_entity = font_make_entity (); |
| 167 | /* NSString *psName = [desc postscriptName]; */ | 169 | /* NSString *psName = [desc postscriptName]; */ |
diff --git a/src/nsmenu.m b/src/nsmenu.m index c7ea6bb90fd..86b3775e9e6 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -600,9 +600,9 @@ name_is_separator ( const char *name) | |||
| 600 | NSMenuItem get ignored. For now we try to display a super-single letter | 600 | NSMenuItem get ignored. For now we try to display a super-single letter |
| 601 | combo, and return the others as strings to be appended to the item title. | 601 | combo, and return the others as strings to be appended to the item title. |
| 602 | (This is signaled by setting keyEquivModMask to 0 for now.) */ | 602 | (This is signaled by setting keyEquivModMask to 0 for now.) */ |
| 603 | -(NSString *)parseKeyEquiv: (char *)key | 603 | -(NSString *)parseKeyEquiv: (const char *)key |
| 604 | { | 604 | { |
| 605 | char *tpos = key; | 605 | const char *tpos = key; |
| 606 | keyEquivModMask = NSCommandKeyMask; | 606 | keyEquivModMask = NSCommandKeyMask; |
| 607 | 607 | ||
| 608 | if (!key || !strlen (key)) | 608 | if (!key || !strlen (key)) |
| @@ -719,7 +719,7 @@ name_is_separator ( const char *name) | |||
| 719 | 719 | ||
| 720 | 720 | ||
| 721 | /* adds an empty submenu and returns it */ | 721 | /* adds an empty submenu and returns it */ |
| 722 | - (EmacsMenu *)addSubmenuWithTitle: (char *)title forFrame: (struct frame *)f | 722 | - (EmacsMenu *)addSubmenuWithTitle: (const char *)title forFrame: (struct frame *)f |
| 723 | { | 723 | { |
| 724 | NSString *titleStr = [NSString stringWithUTF8String: title]; | 724 | NSString *titleStr = [NSString stringWithUTF8String: title]; |
| 725 | NSMenuItem *item = [self addItemWithTitle: titleStr | 725 | NSMenuItem *item = [self addItemWithTitle: titleStr |
| @@ -836,7 +836,7 @@ ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | |||
| 836 | { | 836 | { |
| 837 | /* Create a new pane. */ | 837 | /* Create a new pane. */ |
| 838 | Lisp_Object pane_name, prefix; | 838 | Lisp_Object pane_name, prefix; |
| 839 | char *pane_string; | 839 | const char *pane_string; |
| 840 | 840 | ||
| 841 | pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); | 841 | pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); |
| 842 | prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); | 842 | prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); |
| @@ -1033,7 +1033,7 @@ update_frame_tool_bar (FRAME_PTR f) | |||
| 1033 | struct image *img; | 1033 | struct image *img; |
| 1034 | Lisp_Object image; | 1034 | Lisp_Object image; |
| 1035 | Lisp_Object helpObj; | 1035 | Lisp_Object helpObj; |
| 1036 | char *helpText; | 1036 | const char *helpText; |
| 1037 | 1037 | ||
| 1038 | /* If image is a vector, choose the image according to the | 1038 | /* If image is a vector, choose the image according to the |
| 1039 | button state. */ | 1039 | button state. */ |
| @@ -1153,7 +1153,7 @@ update_frame_tool_bar (FRAME_PTR f) | |||
| 1153 | } | 1153 | } |
| 1154 | 1154 | ||
| 1155 | - (void) addDisplayItemWithImage: (EmacsImage *)img idx: (int)idx | 1155 | - (void) addDisplayItemWithImage: (EmacsImage *)img idx: (int)idx |
| 1156 | helpText: (char *)help enabled: (BOOL)enabled | 1156 | helpText: (const char *)help enabled: (BOOL)enabled |
| 1157 | { | 1157 | { |
| 1158 | /* 1) come up w/identifier */ | 1158 | /* 1) come up w/identifier */ |
| 1159 | NSString *identifier | 1159 | NSString *identifier |
diff --git a/src/nsterm.h b/src/nsterm.h index 9b7f0accad1..21b18f15cae 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -114,10 +114,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 114 | - initWithTitle: (NSString *)title frame: (struct frame *)f; | 114 | - initWithTitle: (NSString *)title frame: (struct frame *)f; |
| 115 | - (void)setFrame: (struct frame *)f; | 115 | - (void)setFrame: (struct frame *)f; |
| 116 | - (void)menuNeedsUpdate: (NSMenu *)menu; /* (delegate method) */ | 116 | - (void)menuNeedsUpdate: (NSMenu *)menu; /* (delegate method) */ |
| 117 | - (NSString *)parseKeyEquiv: (char *)key; | 117 | - (NSString *)parseKeyEquiv: (const char *)key; |
| 118 | - (NSMenuItem *)addItemWithWidgetValue: (void *)wvptr; | 118 | - (NSMenuItem *)addItemWithWidgetValue: (void *)wvptr; |
| 119 | - (void)fillWithWidgetValue: (void *)wvptr; | 119 | - (void)fillWithWidgetValue: (void *)wvptr; |
| 120 | - (EmacsMenu *)addSubmenuWithTitle: (char *)title forFrame: (struct frame *)f; | 120 | - (EmacsMenu *)addSubmenuWithTitle: (const char *)title forFrame: (struct frame *)f; |
| 121 | - (void) clear; | 121 | - (void) clear; |
| 122 | - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f | 122 | - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f |
| 123 | keymaps: (int)keymaps; | 123 | keymaps: (int)keymaps; |
| @@ -144,7 +144,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 144 | - (void) clearActive; | 144 | - (void) clearActive; |
| 145 | - (BOOL) changed; | 145 | - (BOOL) changed; |
| 146 | - (void) addDisplayItemWithImage: (EmacsImage *)img idx: (int)idx | 146 | - (void) addDisplayItemWithImage: (EmacsImage *)img idx: (int)idx |
| 147 | helpText: (char *)help | 147 | helpText: (const char *)help |
| 148 | enabled: (BOOL)enabled; | 148 | enabled: (BOOL)enabled; |
| 149 | /* delegate methods */ | 149 | /* delegate methods */ |
| 150 | - (NSToolbarItem *)toolbar: (NSToolbar *)toolbar | 150 | - (NSToolbarItem *)toolbar: (NSToolbar *)toolbar |