# HG changeset patch # User Jan D # Date 1281517136 -7200 # Node ID d6fc586a0872075ed4d4dabda140cabc2afc5e18 # Parent b9025d71747a21cbd12044d1f8ff3083c0c75bb8 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*. diff -r b9025d71747a -r d6fc586a0872 src/ChangeLog --- a/src/ChangeLog Wed Aug 11 10:36:27 2010 +0200 +++ b/src/ChangeLog Wed Aug 11 10:58:56 2010 +0200 @@ -1,5 +1,15 @@ 2010-08-11 Jan Djärv + * 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 diff -r b9025d71747a -r d6fc586a0872 src/keyboard.h --- a/src/keyboard.h Wed Aug 11 10:36:27 2010 +0200 +++ b/src/keyboard.h Wed Aug 11 10:58:56 2010 +0200 @@ -338,12 +338,12 @@ { /* 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. */ diff -r b9025d71747a -r d6fc586a0872 src/nsfont.m --- a/src/nsfont.m Wed Aug 11 10:36:27 2010 +0200 +++ b/src/nsfont.m Wed Aug 11 10:58:56 2010 +0200 @@ -161,7 +161,9 @@ /* 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]; */ diff -r b9025d71747a -r d6fc586a0872 src/nsmenu.m --- a/src/nsmenu.m Wed Aug 11 10:36:27 2010 +0200 +++ b/src/nsmenu.m Wed Aug 11 10:58:56 2010 +0200 @@ -600,9 +600,9 @@ 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 @@ /* 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 @@ { /* 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 @@ 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 @@ } - (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 diff -r b9025d71747a -r d6fc586a0872 src/nsterm.h --- a/src/nsterm.h Wed Aug 11 10:36:27 2010 +0200 +++ b/src/nsterm.h Wed Aug 11 10:58:56 2010 +0200 @@ -114,10 +114,10 @@ - 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 @@ - (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