Commit 9c5bd55a authored by Jan D's avatar Jan D

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*.
parent 7aee76f4
2010-08-11 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.h (parseKeyEquiv, addSubmenuWithTitle)
(addDisplayItemWithImage): Use const char*.
* nsmenu.m (parseKeyEquiv, addSubmenuWithTitle)
(addDisplayItemWithImage, update_frame_tool_bar): Use const char*.
* nsfont.m (ns_descriptor_to_entity): Use const char*.
* keyboard.h (_widget_value): name, value and key are const char*.
* unexmacosx.c (unexec_error): Use const char *.
2010-08-09 Dan Nicolaescu <dann@ics.uci.edu>
......
......@@ -338,12 +338,12 @@ typedef struct _widget_value
{
/* name of widget */
Lisp_Object lname;
char* name;
const char* name;
/* value (meaning depend on widget type) */
char* value;
const char* value;
/* keyboard equivalent. no implications for XtTranslations */
Lisp_Object lkey;
char* key;
const char* key;
/* Help string or nil if none.
GC finds this string through the frame's menu_bar_vector
or through menu_items. */
......
......@@ -161,7 +161,9 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
/* Converts NSFont descriptor to FONT_WEIGHT, FONT_SLANT, FONT_WIDTH, etc.. */
static Lisp_Object
ns_descriptor_to_entity (NSFontDescriptor *desc, Lisp_Object extra, char *style)
ns_descriptor_to_entity (NSFontDescriptor *desc,
Lisp_Object extra,
const char *style)
{
Lisp_Object font_entity = font_make_entity ();
/* NSString *psName = [desc postscriptName]; */
......
......@@ -600,9 +600,9 @@ - (BOOL)performKeyEquivalent: (NSEvent *)theEvent
NSMenuItem get ignored. For now we try to display a super-single letter
combo, and return the others as strings to be appended to the item title.
(This is signaled by setting keyEquivModMask to 0 for now.) */
-(NSString *)parseKeyEquiv: (char *)key
-(NSString *)parseKeyEquiv: (const char *)key
{
char *tpos = key;
const char *tpos = key;
keyEquivModMask = NSCommandKeyMask;
if (!key || !strlen (key))
......@@ -719,7 +719,7 @@ - (void)fillWithWidgetValue: (void *)wvptr
/* adds an empty submenu and returns it */
- (EmacsMenu *)addSubmenuWithTitle: (char *)title forFrame: (struct frame *)f
- (EmacsMenu *)addSubmenuWithTitle: (const char *)title forFrame: (struct frame *)f
{
NSString *titleStr = [NSString stringWithUTF8String: title];
NSMenuItem *item = [self addItemWithTitle: titleStr
......@@ -836,7 +836,7 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
{
/* Create a new pane. */
Lisp_Object pane_name, prefix;
char *pane_string;
const char *pane_string;
pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
......@@ -1033,7 +1033,7 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
struct image *img;
Lisp_Object image;
Lisp_Object helpObj;
char *helpText;
const char *helpText;
/* If image is a vector, choose the image according to the
button state. */
......@@ -1153,7 +1153,7 @@ - (BOOL) changed
}
- (void) addDisplayItemWithImage: (EmacsImage *)img idx: (int)idx
helpText: (char *)help enabled: (BOOL)enabled
helpText: (const char *)help enabled: (BOOL)enabled
{
/* 1) come up w/identifier */
NSString *identifier
......
......@@ -114,10 +114,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
- initWithTitle: (NSString *)title frame: (struct frame *)f;
- (void)setFrame: (struct frame *)f;
- (void)menuNeedsUpdate: (NSMenu *)menu; /* (delegate method) */
- (NSString *)parseKeyEquiv: (char *)key;
- (NSString *)parseKeyEquiv: (const char *)key;
- (NSMenuItem *)addItemWithWidgetValue: (void *)wvptr;
- (void)fillWithWidgetValue: (void *)wvptr;
- (EmacsMenu *)addSubmenuWithTitle: (char *)title forFrame: (struct frame *)f;
- (EmacsMenu *)addSubmenuWithTitle: (const char *)title forFrame: (struct frame *)f;
- (void) clear;
- (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
keymaps: (int)keymaps;
......@@ -144,7 +144,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
- (void) clearActive;
- (BOOL) changed;
- (void) addDisplayItemWithImage: (EmacsImage *)img idx: (int)idx
helpText: (char *)help
helpText: (const char *)help
enabled: (BOOL)enabled;
/* delegate methods */
- (NSToolbarItem *)toolbar: (NSToolbar *)toolbar
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment