init_editfns (void)
{
char *user_name;
- register unsigned char *p;
+ register char *p;
struct passwd *pw; /* password entry for the current user */
Lisp_Object tem;
Vuser_full_name = Fuser_full_name (NILP (tem)? make_number (geteuid())
: Vuser_login_name);
- p = (unsigned char *) getenv ("NAME");
+ p = getenv ("NAME");
if (p)
Vuser_full_name = build_string (p);
else if (NILP (Vuser_full_name))
CHECK_CHARACTER (character);
len = CHAR_STRING (XFASTINT (character), str);
- return make_string_from_bytes (str, 1, len);
+ return make_string_from_bytes ((char *) str, 1, len);
}
DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
if (XINT (byte) < 0 || XINT (byte) > 255)
error ("Invalid byte");
b = XINT (byte);
- return make_string_from_bytes (&b, 1, 1);
+ return make_string_from_bytes ((char *) &b, 1, 1);
}
DEFUN ("string-to-char", Fstring_to_char, Sstring_to_char, 1, 1, 0,
(Lisp_Object uid)
{
struct passwd *pw;
- register unsigned char *p, *q;
+ register char *p, *q;
Lisp_Object full;
if (NILP (uid))
if (!pw)
return Qnil;
- p = (unsigned char *) USER_FULL_NAME;
+ p = USER_FULL_NAME;
/* Chop off everything after the first comma. */
- q = (unsigned char *) strchr (p, ',');
+ q = strchr (p, ',');
full = make_string (p, q ? q - p : strlen (p));
#ifdef AMPERSAND_FULL_NAME
- p = SDATA (full);
- q = (unsigned char *) strchr (p, '&');
+ p = SSDATA (full);
+ q = strchr (p, '&');
/* Substitute the login name for the &, upcasing the first character. */
if (q)
{
- register unsigned char *r;
+ register char *r;
Lisp_Object login;
login = Fuser_login_name (make_number (pw->pw_uid));
- r = (unsigned char *) alloca (strlen (p) + SCHARS (login) + 1);
+ r = (char *) alloca (strlen (p) + SCHARS (login) + 1);
memcpy (r, p, q - p);
r[q - p] = 0;
strcat (r, SSDATA (login));
- r[q - p] = UPCASE (r[q - p]);
+ r[q - p] = UPCASE ((unsigned char) r[q - p]);
strcat (r, q + 1);
full = build_string (r);
}
GCPRO1 (tem);
/* Make a multibyte string containing this single character. */
- string = make_multibyte_string (tostr, 1, len);
+ string = make_multibyte_string ((char *) tostr, 1, len);
/* replace_range is less efficient, because it moves the gap,
but it handles combining correctly. */
replace_range (pos, pos + 1, string,
/* This is less efficient, because it moves the gap,
but it should handle multibyte characters correctly. */
- string = make_multibyte_string (str, 1, str_len);
+ string = make_multibyte_string ((char *) str, 1, str_len);
replace_range (pos, pos + 1, string, 1, 0, 1);
len = str_len;
}
register int n; /* The number of the next arg to substitute */
register EMACS_INT total; /* An estimate of the final length */
char *buf, *p;
- register unsigned char *format, *end, *format_start;
+ register char *format, *end, *format_start;
int nchars;
/* Nonzero if the output should be a multibyte string,
which is true if any of the inputs is one. */
multibyte character of the previous string. This flag tells if we
must consider such a situation or not. */
int maybe_combine_byte;
- unsigned char *this_format;
+ char *this_format;
/* Precision for each spec, or -1, a flag value meaning no precision
was given in that spec. Element 0, corresonding to the format
string itself, will not be used. Element NARGS, corresponding to
That can only happen from the first large while loop below. */
retry:
- format = SDATA (args[0]);
+ format = SSDATA (args[0]);
format_start = format;
end = format + SBYTES (args[0]);
longest_format = 0;
{
EMACS_INT thissize = 0;
EMACS_INT actual_width = 0;
- unsigned char *this_format_start = format - 1;
+ char *this_format_start = format - 1;
int field_width = 0;
/* General format specifications look like
/* Now we can no longer jump to retry.
TOTAL and LONGEST_FORMAT are known for certain. */
- this_format = (unsigned char *) alloca (longest_format + 1);
+ this_format = (char *) alloca (longest_format + 1);
/* Allocate the space for the result.
Note that TOTAL is an overestimate. */
n = 0;
/* Scan the format and store result in BUF. */
- format = SDATA (args[0]);
+ format = SSDATA (args[0]);
format_start = format;
end = format + SBYTES (args[0]);
maybe_combine_byte = 0;
{
int minlen;
int negative = 0;
- unsigned char *this_format_start = format;
+ char *this_format_start = format;
discarded[format - format_start] = 1;
format++;
&& !CHAR_HEAD_P (SREF (args[n], 0)))
maybe_combine_byte = 1;
- p += copy_text (SDATA (args[n]), p,
+ p += copy_text (SDATA (args[n]), (unsigned char *) p,
nbytes,
STRING_MULTIBYTE (args[n]), multibyte);
maybe_combine_byte = 1;
this_nchars = strlen (p);
if (multibyte)
- p += str_to_multibyte (p, buf + total - 1 - p, this_nchars);
+ p += str_to_multibyte ((unsigned char *) p,
+ buf + total - 1 - p, this_nchars);
else
p += this_nchars;
nchars += this_nchars;
else if (multibyte)
{
/* Convert a single-byte character to multibyte. */
- int len = copy_text (format, p, 1, 0, 1);
+ int len = copy_text ((unsigned char *) format, (unsigned char *) p,
+ 1, 0, 1);
p += len;
format++;
abort ();
if (maybe_combine_byte)
- nchars = multibyte_chars_in_text (buf, p - buf);
+ nchars = multibyte_chars_in_text ((unsigned char *) buf, p - buf);
val = make_specified_string (buf, nchars, p - buf, multibyte);
/* If we allocated BUF with malloc, free it too. */