summaryrefslogtreecommitdiff
path: root/src/xsmfns.c
diff options
context:
space:
mode:
authorJan D <jan.h.d@swipnet.se>2010-07-05 11:17:12 +0200
committerJan D <jan.h.d@swipnet.se>2010-07-05 11:17:12 +0200
commite4c8d29a32adbde811a109d5e19caa75fd9d042b (patch)
treeffaa67180bd87eae947408a76cddecaaa1c227b0 /src/xsmfns.c
parent898b4c5c2cb4b4ae2fa2cd1631db63a9acff787a (diff)
downloademacs-e4c8d29a32adbde811a109d5e19caa75fd9d042b.tar.gz
Fix some bad prototypes and formatting after conversion from K&R declaration.
* lwlib/lwlib-Xaw.c: Include <ctype.h> for isdigit. (fill_xft_data, set_text): Remove unused variable screen. (draw_text): Cast bp to FcChar8*. (find_xft_data): Return 0 if inst or xft_data is not set. (wm_delete_window): Correct prototype. Initialize widget to 0 and return if widget is still 0 after loop. * lwlib/xlwmenu.c (XlwMenuSetValues, XlwMenuInitialize): Correct prototype. (display_menu_item): Remove unused variable gi. (make_windows_if_needed): Remove unused variable screen. (XlwMenuRedisplay): Remove unused variable i. * src/gtkutil.c (xg_get_pixbuf_from_pix_and_mask) (xg_get_image_for_pixmap, create_dialog) (xg_get_file_with_selection, xg_get_file_name, update_cl_data) (menuitem_highlight_callback, make_menu_item) (xg_create_one_menuitem, create_menus, xg_update_menu_item) (xg_create_scroll_bar, xg_update_scrollbar_pos) (xg_set_toolkit_scroll_bar_thumb, xg_tool_bar_button_cb) (xg_tool_bar_proxy_help_callback, xg_tool_bar_detach_callback) (xg_tool_bar_attach_callback, xg_tool_bar_help_callback) (xg_tool_bar_item_expose_callback): Reformat prototype. (xg_update_menubar): GList *group => GSList *group. (xg_modify_menubar_widgets): Initialize witem to 0, check witem != 0 before use. (update_frame_tool_bar): 4:th param to xg_get_image_for_pixmap changed to GTK_IMAGE (wimage). * src/xsettings.c (something_changedCB, parse_settings) (apply_xft_settings): Reformat prototype. (something_changedCB, init_gconf): Remove unused variable i. (read_settings): Remove unused variable long_len. * src/xsmfns.c (SSDATA): New macro. (smc_save_yourself_CB, x_session_initialize): Use SSDATA for strings passed to strlen/strcpy/strcat. (create_client_leader_window): Surround with #ifndef USE_GTK. Cast 7:th arg to XChangeProperty to (unsigned char *)
Diffstat (limited to 'src/xsmfns.c')
-rw-r--r--src/xsmfns.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/xsmfns.c b/src/xsmfns.c
index dbf52af92d5..2ebd4a45c41 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -42,6 +42,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "termopts.h"
#include "xterm.h"
+/* Avoid "differ in sign" warnings */
+#define SSDATA(x) ((char *) SDATA (x))
+
/* The user login name. */
extern Lisp_Object Vuser_login_name;
@@ -219,7 +222,7 @@ smc_save_yourself_CB (SmcConn smcConn,
props[props_idx]->type = SmARRAY8;
props[props_idx]->num_vals = 1;
props[props_idx]->vals = &values[val_idx++];
- props[props_idx]->vals[0].length = strlen (SDATA (Vinvocation_name));
+ props[props_idx]->vals[0].length = strlen (SSDATA (Vinvocation_name));
props[props_idx]->vals[0].value = SDATA (Vinvocation_name);
++props_idx;
@@ -263,7 +266,7 @@ smc_save_yourself_CB (SmcConn smcConn,
props[props_idx]->type = SmARRAY8;
props[props_idx]->num_vals = 1;
props[props_idx]->vals = &values[val_idx++];
- props[props_idx]->vals[0].length = strlen (SDATA (Vuser_login_name));
+ props[props_idx]->vals[0].length = strlen (SSDATA (Vuser_login_name));
props[props_idx]->vals[0].value = SDATA (Vuser_login_name);
++props_idx;
@@ -388,6 +391,7 @@ ice_conn_watch_CB (IceConn iceConn, IcePointer clientData, int opening, IcePoint
/* Create the client leader window. */
+#ifndef USE_GTK
static void
create_client_leader_window (struct x_display_info *dpyinfo, char *client_id)
{
@@ -407,10 +411,12 @@ create_client_leader_window (struct x_display_info *dpyinfo, char *client_id)
sm_id = XInternAtom (dpyinfo->display, "SM_CLIENT_ID", False);
XChangeProperty (dpyinfo->display, w, sm_id, XA_STRING, 8, PropModeReplace,
- client_id, strlen (client_id));
+ (unsigned char *)client_id, strlen (client_id));
dpyinfo->client_leader_window = w;
}
+#endif /* ! USE_GTK */
+
/* Try to open a connection to the session manager. */
@@ -429,12 +435,12 @@ x_session_initialize (struct x_display_info *dpyinfo)
/* Check if we where started by the session manager. If so, we will
have a previous id. */
if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id))
- previous_id = SDATA (Vx_session_previous_id);
+ previous_id = SSDATA (Vx_session_previous_id);
/* Construct the path to the Emacs program. */
if (! EQ (Vinvocation_directory, Qnil))
- name_len += strlen (SDATA (Vinvocation_directory));
- name_len += strlen (SDATA (Vinvocation_name));
+ name_len += strlen (SSDATA (Vinvocation_directory));
+ name_len += strlen (SSDATA (Vinvocation_name));
/* This malloc will not be freed, but it is only done once, and hopefully
not very large */
@@ -442,8 +448,8 @@ x_session_initialize (struct x_display_info *dpyinfo)
emacs_program[0] = '\0';
if (! EQ (Vinvocation_directory, Qnil))
- strcpy (emacs_program, SDATA (Vinvocation_directory));
- strcat (emacs_program, SDATA (Vinvocation_name));
+ strcpy (emacs_program, SSDATA (Vinvocation_directory));
+ strcat (emacs_program, SSDATA (Vinvocation_name));
/* The SM protocol says all callbacks are mandatory, so set up all
here and in the mask passed to SmcOpenConnection. */