comparison src/objects-x.c @ 647:b39c14581166

[xemacs-hg @ 2001-08-13 04:45:47 by ben] removal of unsigned, size_t, etc.
author ben
date Mon, 13 Aug 2001 04:46:48 +0000
parents 190b164ddcac
children fdefd0186b75
comparison
equal deleted inserted replaced
646:00c54252fe4f 647:b39c14581166
397 f->ascent = xf->ascent; 397 f->ascent = xf->ascent;
398 f->descent = xf->descent; 398 f->descent = xf->descent;
399 f->height = xf->ascent + xf->descent; 399 f->height = xf->ascent + xf->descent;
400 { 400 {
401 /* following change suggested by Ted Phelps <phelps@dstc.edu.au> */ 401 /* following change suggested by Ted Phelps <phelps@dstc.edu.au> */
402 unsigned int def_char = 'n'; /*xf->default_char;*/ 402 int def_char = 'n'; /*xf->default_char;*/
403 unsigned int byte1, byte2; 403 int byte1, byte2;
404 404
405 once_more: 405 once_more:
406 byte1 = def_char >> 8; 406 byte1 = def_char >> 8;
407 byte2 = def_char & 0xFF; 407 byte2 = def_char & 0xFF;
408 408
409 if (xf->per_char) 409 if (xf->per_char)
410 { 410 {
411 /* Old versions of the R5 font server have garbage (>63k) as 411 /* Old versions of the R5 font server have garbage (>63k) as
412 def_char. 'n' might not be a valid character. */ 412 def_char. 'n' might not be a valid character. */
413 if (byte1 < xf->min_byte1 || 413 if (byte1 < (int) xf->min_byte1 ||
414 byte1 > xf->max_byte1 || 414 byte1 > (int) xf->max_byte1 ||
415 byte2 < xf->min_char_or_byte2 || 415 byte2 < (int) xf->min_char_or_byte2 ||
416 byte2 > xf->max_char_or_byte2) 416 byte2 > (int) xf->max_char_or_byte2)
417 f->width = 0; 417 f->width = 0;
418 else 418 else
419 f->width = xf->per_char[(byte1 - xf->min_byte1) * 419 f->width = xf->per_char[(byte1 - xf->min_byte1) *
420 (xf->max_char_or_byte2 - 420 (xf->max_char_or_byte2 -
421 xf->min_char_or_byte2 + 1) + 421 xf->min_char_or_byte2 + 1) +
427 /* Some fonts have a default char whose width is 0. This is no good. 427 /* Some fonts have a default char whose width is 0. This is no good.
428 If that's the case, first try 'n' as the default char, and if n has 428 If that's the case, first try 'n' as the default char, and if n has
429 0 width too (unlikely) then just use the max width. */ 429 0 width too (unlikely) then just use the max width. */
430 if (f->width == 0) 430 if (f->width == 0)
431 { 431 {
432 if (def_char == xf->default_char) 432 if (def_char == (int) xf->default_char)
433 f->width = xf->max_bounds.width; 433 f->width = xf->max_bounds.width;
434 else 434 else
435 { 435 {
436 def_char = xf->default_char; 436 def_char = xf->default_char;
437 goto once_more; 437 goto once_more;
596 result = XGetAtomName (dpy, value); 596 result = XGetAtomName (dpy, value);
597 /* result is now 0, or the string value of the FONT property. */ 597 /* result is now 0, or the string value of the FONT property. */
598 if (result) 598 if (result)
599 { 599 {
600 /* Verify that result is an XLFD name (roughly...) */ 600 /* Verify that result is an XLFD name (roughly...) */
601 if (result [0] != '-' || strlen (result) < (unsigned int) 30) 601 if (result [0] != '-' || strlen (result) < 30)
602 { 602 {
603 XFree (result); 603 XFree (result);
604 result = 0; 604 result = 0;
605 } 605 }
606 } 606 }
815 for (i = FONT_INSTANCE_X_FONT (f)->n_properties - 1; i >= 0; i--) 815 for (i = FONT_INSTANCE_X_FONT (f)->n_properties - 1; i >= 0; i--)
816 { 816 {
817 Lisp_Object name, value; 817 Lisp_Object name, value;
818 Atom atom = props [i].name; 818 Atom atom = props [i].name;
819 Bufbyte *name_str = 0; 819 Bufbyte *name_str = 0;
820 size_t name_len; 820 Bytecount name_len;
821 Extbyte *namestrext = XGetAtomName (dpy, atom); 821 Extbyte *namestrext = XGetAtomName (dpy, atom);
822 822
823 if (namestrext) 823 if (namestrext)
824 TO_INTERNAL_FORMAT (C_STRING, namestrext, 824 TO_INTERNAL_FORMAT (C_STRING, namestrext,
825 ALLOCA, (name_str, name_len), 825 ALLOCA, (name_str, name_len),