comparison src/objects-msw.c @ 272:c5d627a313b1 r21-0b34

Import from CVS: tag r21-0b34
author cvs
date Mon, 13 Aug 2007 10:28:48 +0200
parents 966663fcf606
children 6330739388db
comparison
equal deleted inserted replaced
271:c7b7086b0a39 272:c5d627a313b1
26 /* Synched up with: Not in FSF. */ 26 /* Synched up with: Not in FSF. */
27 27
28 /* Authorship: 28 /* Authorship:
29 29
30 Jamie Zawinski, Chuck Thompson, Ben Wing 30 Jamie Zawinski, Chuck Thompson, Ben Wing
31 Rewritten for mswindows by Jonathan Harris, November 1997 for 20.4. 31 Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0.
32 */ 32 */
33 33
34 34
35 /* TODO: palette handling */ 35 /* TODO: palette handling */
36 36
37 #include <config.h> 37 #include <config.h>
38 #include "lisp.h" 38 #include "lisp.h"
39 #include "hash.h"
39 40
40 #include "console-msw.h" 41 #include "console-msw.h"
41 #include "objects-msw.h" 42 #include "objects-msw.h"
42 43
43 #ifdef MULE 44 #ifdef MULE
742 /* numeric names look like "#RRGGBB", "#RRRGGGBBB" or "#RRRRGGGGBBBB" */ 743 /* numeric names look like "#RRGGBB", "#RRRGGGBBB" or "#RRRRGGGGBBBB" */
743 unsigned int r, g, b; 744 unsigned int r, g, b;
744 745
745 for (i=1; i<strlen(name); i++) 746 for (i=1; i<strlen(name); i++)
746 { 747 {
747 if (!isxdigit (name[i])) 748 if (!isxdigit ((int)name[i]))
748 return(-1); 749 return(-1);
749 } 750 }
750 if (strlen(name)==7) 751 if (strlen(name)==7)
751 { 752 {
752 r = hexval (name[1]) * 16 + hexval (name[2]); 753 r = hexval (name[1]) * 16 + hexval (name[2]);
778 *(c++) = *(name++); 779 *(c++) = *(name++);
779 else 780 else
780 name++; 781 name++;
781 *c = '\0'; 782 *c = '\0';
782 783
783 for(i=0; i<(sizeof (mswindows_X_color_map) / sizeof (colormap_t)); i++) 784 for (i=0; i< countof (mswindows_X_color_map); i++)
784 if (!stricmp (nospaces, mswindows_X_color_map[i].name)) 785 if (!stricmp (nospaces, mswindows_X_color_map[i].name))
785 return (mswindows_X_color_map[i].colorref); 786 return (mswindows_X_color_map[i].colorref);
786 } 787 }
787 return(-1); 788 return(-1);
788 } 789 }