changeset 9019:2e3c6071db97 v7.4.1795

commit https://github.com/vim/vim/commit/5487544fa5d46af9f8f98aa4f5c59074a6e0639a Author: Bram Moolenaar <Bram@vim.org> Date: Tue Apr 26 22:33:17 2016 +0200 patch 7.4.1795 Problem: Compiler warning for redefining RGB. (John Marriott) Solution: Rename it to TORGB.
author Christian Brabandt <cb@256bit.org>
date Tue, 26 Apr 2016 22:45:07 +0200
parents 00d7bc0601b9
children 5c619b19ca35
files src/term.c src/version.c
diffstat 2 files changed, 55 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/src/term.c
+++ b/src/term.c
@@ -6068,7 +6068,7 @@ hex_digit(int c)
     guicolor_T
 gui_get_color_cmn(char_u *name)
 {
-#define RGB(r, g, b) ((r<<16) | (g<<8) | (b))
+#define TORGB(r, g, b) ((r<<16) | (g<<8) | (b))
 #define LINE_LEN 100
     FILE	*fd;
     char	line[LINE_LEN];
@@ -6082,63 +6082,63 @@ gui_get_color_cmn(char_u *name)
     };
 
     static struct rgbcolor_table_S rgb_table[] = {
-	    {(char_u *)"black",		RGB(0x00, 0x00, 0x00)},
-	    {(char_u *)"blue",		RGB(0x00, 0x00, 0xFF)},
-	    {(char_u *)"brown",		RGB(0xA5, 0x2A, 0x2A)},
-	    {(char_u *)"cyan",		RGB(0x00, 0xFF, 0xFF)},
-	    {(char_u *)"darkblue",	RGB(0x00, 0x00, 0x8B)},
-	    {(char_u *)"darkcyan",	RGB(0x00, 0x8B, 0x8B)},
-	    {(char_u *)"darkgray",	RGB(0xA9, 0xA9, 0xA9)},
-	    {(char_u *)"darkgreen",	RGB(0x00, 0x64, 0x00)},
-	    {(char_u *)"darkgrey",	RGB(0xA9, 0xA9, 0xA9)},
-	    {(char_u *)"darkmagenta",	RGB(0x8B, 0x00, 0x8B)},
-	    {(char_u *)"darkred",	RGB(0x8B, 0x00, 0x00)},
-	    {(char_u *)"darkyellow",	RGB(0x8B, 0x8B, 0x00)},	/* No X11 */
-	    {(char_u *)"gray",		RGB(0xBE, 0xBE, 0xBE)},
-	    {(char_u *)"gray10",	RGB(0x1A, 0x1A, 0x1A)},
-	    {(char_u *)"gray20",	RGB(0x33, 0x33, 0x33)},
-	    {(char_u *)"gray30",	RGB(0x4D, 0x4D, 0x4D)},
-	    {(char_u *)"gray40",	RGB(0x66, 0x66, 0x66)},
-	    {(char_u *)"gray50",	RGB(0x7F, 0x7F, 0x7F)},
-	    {(char_u *)"gray60",	RGB(0x99, 0x99, 0x99)},
-	    {(char_u *)"gray70",	RGB(0xB3, 0xB3, 0xB3)},
-	    {(char_u *)"gray80",	RGB(0xCC, 0xCC, 0xCC)},
-	    {(char_u *)"gray90",	RGB(0xE5, 0xE5, 0xE5)},
-	    {(char_u *)"green",		RGB(0x00, 0xFF, 0x00)},
-	    {(char_u *)"grey",		RGB(0xBE, 0xBE, 0xBE)},
-	    {(char_u *)"grey10",	RGB(0x1A, 0x1A, 0x1A)},
-	    {(char_u *)"grey20",	RGB(0x33, 0x33, 0x33)},
-	    {(char_u *)"grey30",	RGB(0x4D, 0x4D, 0x4D)},
-	    {(char_u *)"grey40",	RGB(0x66, 0x66, 0x66)},
-	    {(char_u *)"grey50",	RGB(0x7F, 0x7F, 0x7F)},
-	    {(char_u *)"grey60",	RGB(0x99, 0x99, 0x99)},
-	    {(char_u *)"grey70",	RGB(0xB3, 0xB3, 0xB3)},
-	    {(char_u *)"grey80",	RGB(0xCC, 0xCC, 0xCC)},
-	    {(char_u *)"grey90",	RGB(0xE5, 0xE5, 0xE5)},
-	    {(char_u *)"lightblue",	RGB(0xAD, 0xD8, 0xE6)},
-	    {(char_u *)"lightcyan",	RGB(0xE0, 0xFF, 0xFF)},
-	    {(char_u *)"lightgray",	RGB(0xD3, 0xD3, 0xD3)},
-	    {(char_u *)"lightgreen",	RGB(0x90, 0xEE, 0x90)},
-	    {(char_u *)"lightgrey",	RGB(0xD3, 0xD3, 0xD3)},
-	    {(char_u *)"lightmagenta",	RGB(0xFF, 0x8B, 0xFF)},	/* No X11 */
-	    {(char_u *)"lightred",	RGB(0xFF, 0x8B, 0x8B)},	/* No X11 */
-	    {(char_u *)"lightyellow",	RGB(0xFF, 0xFF, 0xE0)},
-	    {(char_u *)"magenta",	RGB(0xFF, 0x00, 0xFF)},
-	    {(char_u *)"orange",	RGB(0xFF, 0xA5, 0x00)},
-	    {(char_u *)"purple",	RGB(0xA0, 0x20, 0xF0)},
-	    {(char_u *)"red",		RGB(0xFF, 0x00, 0x00)},
-	    {(char_u *)"seagreen",	RGB(0x2E, 0x8B, 0x57)},
-	    {(char_u *)"slateblue",	RGB(0x6A, 0x5A, 0xCD)},
-	    {(char_u *)"violet",	RGB(0xEE, 0x82, 0xEE)},
-	    {(char_u *)"white",		RGB(0xFF, 0xFF, 0xFF)},
-	    {(char_u *)"yellow",	RGB(0xFF, 0xFF, 0x00)},
+	    {(char_u *)"black",		TORGB(0x00, 0x00, 0x00)},
+	    {(char_u *)"blue",		TORGB(0x00, 0x00, 0xFF)},
+	    {(char_u *)"brown",		TORGB(0xA5, 0x2A, 0x2A)},
+	    {(char_u *)"cyan",		TORGB(0x00, 0xFF, 0xFF)},
+	    {(char_u *)"darkblue",	TORGB(0x00, 0x00, 0x8B)},
+	    {(char_u *)"darkcyan",	TORGB(0x00, 0x8B, 0x8B)},
+	    {(char_u *)"darkgray",	TORGB(0xA9, 0xA9, 0xA9)},
+	    {(char_u *)"darkgreen",	TORGB(0x00, 0x64, 0x00)},
+	    {(char_u *)"darkgrey",	TORGB(0xA9, 0xA9, 0xA9)},
+	    {(char_u *)"darkmagenta",	TORGB(0x8B, 0x00, 0x8B)},
+	    {(char_u *)"darkred",	TORGB(0x8B, 0x00, 0x00)},
+	    {(char_u *)"darkyellow",	TORGB(0x8B, 0x8B, 0x00)}, /* No X11 */
+	    {(char_u *)"gray",		TORGB(0xBE, 0xBE, 0xBE)},
+	    {(char_u *)"gray10",	TORGB(0x1A, 0x1A, 0x1A)},
+	    {(char_u *)"gray20",	TORGB(0x33, 0x33, 0x33)},
+	    {(char_u *)"gray30",	TORGB(0x4D, 0x4D, 0x4D)},
+	    {(char_u *)"gray40",	TORGB(0x66, 0x66, 0x66)},
+	    {(char_u *)"gray50",	TORGB(0x7F, 0x7F, 0x7F)},
+	    {(char_u *)"gray60",	TORGB(0x99, 0x99, 0x99)},
+	    {(char_u *)"gray70",	TORGB(0xB3, 0xB3, 0xB3)},
+	    {(char_u *)"gray80",	TORGB(0xCC, 0xCC, 0xCC)},
+	    {(char_u *)"gray90",	TORGB(0xE5, 0xE5, 0xE5)},
+	    {(char_u *)"green",		TORGB(0x00, 0xFF, 0x00)},
+	    {(char_u *)"grey",		TORGB(0xBE, 0xBE, 0xBE)},
+	    {(char_u *)"grey10",	TORGB(0x1A, 0x1A, 0x1A)},
+	    {(char_u *)"grey20",	TORGB(0x33, 0x33, 0x33)},
+	    {(char_u *)"grey30",	TORGB(0x4D, 0x4D, 0x4D)},
+	    {(char_u *)"grey40",	TORGB(0x66, 0x66, 0x66)},
+	    {(char_u *)"grey50",	TORGB(0x7F, 0x7F, 0x7F)},
+	    {(char_u *)"grey60",	TORGB(0x99, 0x99, 0x99)},
+	    {(char_u *)"grey70",	TORGB(0xB3, 0xB3, 0xB3)},
+	    {(char_u *)"grey80",	TORGB(0xCC, 0xCC, 0xCC)},
+	    {(char_u *)"grey90",	TORGB(0xE5, 0xE5, 0xE5)},
+	    {(char_u *)"lightblue",	TORGB(0xAD, 0xD8, 0xE6)},
+	    {(char_u *)"lightcyan",	TORGB(0xE0, 0xFF, 0xFF)},
+	    {(char_u *)"lightgray",	TORGB(0xD3, 0xD3, 0xD3)},
+	    {(char_u *)"lightgreen",	TORGB(0x90, 0xEE, 0x90)},
+	    {(char_u *)"lightgrey",	TORGB(0xD3, 0xD3, 0xD3)},
+	    {(char_u *)"lightmagenta",	TORGB(0xFF, 0x8B, 0xFF)}, /* No X11 */
+	    {(char_u *)"lightred",	TORGB(0xFF, 0x8B, 0x8B)}, /* No X11 */
+	    {(char_u *)"lightyellow",	TORGB(0xFF, 0xFF, 0xE0)},
+	    {(char_u *)"magenta",	TORGB(0xFF, 0x00, 0xFF)},
+	    {(char_u *)"orange",	TORGB(0xFF, 0xA5, 0x00)},
+	    {(char_u *)"purple",	TORGB(0xA0, 0x20, 0xF0)},
+	    {(char_u *)"red",		TORGB(0xFF, 0x00, 0x00)},
+	    {(char_u *)"seagreen",	TORGB(0x2E, 0x8B, 0x57)},
+	    {(char_u *)"slateblue",	TORGB(0x6A, 0x5A, 0xCD)},
+	    {(char_u *)"violet",	TORGB(0xEE, 0x82, 0xEE)},
+	    {(char_u *)"white",		TORGB(0xFF, 0xFF, 0xFF)},
+	    {(char_u *)"yellow",	TORGB(0xFF, 0xFF, 0x00)},
     };
 
 
     if (name[0] == '#' && STRLEN(name) == 7)
     {
 	/* Name is in "#rrggbb" format */
-	color = RGB(((hex_digit(name[1]) << 4) + hex_digit(name[2])),
+	color = TORGB(((hex_digit(name[1]) << 4) + hex_digit(name[2])),
 		    ((hex_digit(name[3]) << 4) + hex_digit(name[4])),
 		    ((hex_digit(name[5]) << 4) + hex_digit(name[6])));
 	if (color > 0xffffff)
@@ -6188,7 +6188,7 @@ gui_get_color_cmn(char_u *name)
 	if (STRICMP(line + pos, name) == 0)
 	{
 	    fclose(fd);
-	    return (guicolor_T) RGB(r, g, b);
+	    return (guicolor_T) TORGB(r, g, b);
 	}
     }
     fclose(fd);
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1795,
+/**/
     1794,
 /**/
     1793,