summaryrefslogtreecommitdiff
path: root/src/doc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/doc.c b/src/doc.c
index 3832eb3708d..740bb26ff08 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -349,10 +349,10 @@ string is passed through `substitute-command-keys'. */)
return Qnil;
/* FIXME: This is not portable, as it assumes that string
pointers have the top bit clear. */
- else if ((EMACS_INT) XSUBR (fun)->doc >= 0)
+ else if ((EMACS_INTPTR) XSUBR (fun)->doc >= 0)
doc = build_string (XSUBR (fun)->doc);
else
- doc = make_number ((EMACS_INT) XSUBR (fun)->doc);
+ doc = make_number ((EMACS_INTPTR) XSUBR (fun)->doc);
}
else if (COMPILEDP (fun))
{
@@ -506,8 +506,11 @@ store_function_docstring (Lisp_Object fun, EMACS_INT offset)
/* The type determines where the docstring is stored. */
/* Lisp_Subrs have a slot for it. */
- if (SUBRP (fun))
- XSUBR (fun)->doc = (char *) - offset;
+ if (SUBRP (fun))
+ {
+ EMACS_INTPTR negative_offset = - offset;
+ XSUBR (fun)->doc = (char *) negative_offset;
+ }
/* If it's a lisp form, stick it in the form. */
else if (CONSP (fun))