diff options
| author | Eli Zaretskii | 2012-10-08 13:19:35 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-10-08 13:19:35 +0200 |
| commit | b6f4e30044100e223954a31eb7753d024d6413f6 (patch) | |
| tree | 52ca70a9a5e7bc6a8fc0bfcd81160d972162323f | |
| parent | 303cc1d110b98ef0186126a07436234d0950b8ea (diff) | |
| download | emacs-b6f4e30044100e223954a31eb7753d024d6413f6.tar.gz emacs-b6f4e30044100e223954a31eb7753d024d6413f6.zip | |
Avoid compiler warnings on w32, caused by cygw32 changes.
src/w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
'const char *'.
(x_to_w32_color): Don't modify the argument, modify a copy instead.
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/w32fns.c | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f9a47ebb4b6..7d2509b88cf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-10-08 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now | ||
| 4 | 'const char *'. | ||
| 5 | (x_to_w32_color): Don't modify the argument, modify a copy instead. | ||
| 6 | |||
| 1 | 2012-10-08 Daniel Colascione <dancol@dancol.org> | 7 | 2012-10-08 Daniel Colascione <dancol@dancol.org> |
| 2 | 8 | ||
| 3 | * image.c: Permanent fix for JPEG compilation issue --- limit | 9 | * image.c: Permanent fix for JPEG compilation issue --- limit |
diff --git a/src/w32fns.c b/src/w32fns.c index 996c37f57f9..8620fa8b1e8 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -697,7 +697,7 @@ DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map, | |||
| 697 | } | 697 | } |
| 698 | 698 | ||
| 699 | static Lisp_Object | 699 | static Lisp_Object |
| 700 | w32_color_map_lookup (char *colorname) | 700 | w32_color_map_lookup (const char *colorname) |
| 701 | { | 701 | { |
| 702 | Lisp_Object tail, ret = Qnil; | 702 | Lisp_Object tail, ret = Qnil; |
| 703 | 703 | ||
| @@ -776,7 +776,7 @@ add_system_logical_colors_to_map (Lisp_Object *system_colors) | |||
| 776 | 776 | ||
| 777 | 777 | ||
| 778 | static Lisp_Object | 778 | static Lisp_Object |
| 779 | x_to_w32_color (char * colorname) | 779 | x_to_w32_color (const char * colorname) |
| 780 | { | 780 | { |
| 781 | register Lisp_Object ret = Qnil; | 781 | register Lisp_Object ret = Qnil; |
| 782 | 782 | ||
| @@ -785,11 +785,10 @@ x_to_w32_color (char * colorname) | |||
| 785 | if (colorname[0] == '#') | 785 | if (colorname[0] == '#') |
| 786 | { | 786 | { |
| 787 | /* Could be an old-style RGB Device specification. */ | 787 | /* Could be an old-style RGB Device specification. */ |
| 788 | char *color; | 788 | int size = strlen (colorname + 1); |
| 789 | int size; | 789 | char *color = alloca (size + 1); |
| 790 | color = colorname + 1; | ||
| 791 | 790 | ||
| 792 | size = strlen (color); | 791 | strcpy (color, colorname + 1); |
| 793 | if (size == 3 || size == 6 || size == 9 || size == 12) | 792 | if (size == 3 || size == 6 || size == 9 || size == 12) |
| 794 | { | 793 | { |
| 795 | UINT colorval; | 794 | UINT colorval; |
| @@ -843,7 +842,7 @@ x_to_w32_color (char * colorname) | |||
| 843 | } | 842 | } |
| 844 | else if (strnicmp (colorname, "rgb:", 4) == 0) | 843 | else if (strnicmp (colorname, "rgb:", 4) == 0) |
| 845 | { | 844 | { |
| 846 | char *color; | 845 | const char *color; |
| 847 | UINT colorval; | 846 | UINT colorval; |
| 848 | int i, pos; | 847 | int i, pos; |
| 849 | pos = 0; | 848 | pos = 0; |
| @@ -899,7 +898,7 @@ x_to_w32_color (char * colorname) | |||
| 899 | else if (strnicmp (colorname, "rgbi:", 5) == 0) | 898 | else if (strnicmp (colorname, "rgbi:", 5) == 0) |
| 900 | { | 899 | { |
| 901 | /* This is an RGB Intensity specification. */ | 900 | /* This is an RGB Intensity specification. */ |
| 902 | char *color; | 901 | const char *color; |
| 903 | UINT colorval; | 902 | UINT colorval; |
| 904 | int i, pos; | 903 | int i, pos; |
| 905 | pos = 0; | 904 | pos = 0; |