Project

General

Profile

Bug #10158 » win32.c.patch

whiteleaf (whiteleaf _), 08/20/2014 08:19 PM

View differences:

C:/Application/DevKit/home/sasa/ruby/win32/win32.c Thu Aug 21 04:10:32 2014
p->vt100.state = constat_init;
}
#define FOREGROUND_MASK (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY)
#define BACKGROUND_MASK (BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY)
#define constat_attr_color_reverse(attr) \
(attr) & ~(FOREGROUND_MASK | BACKGROUND_MASK) | \
(((attr) & FOREGROUND_MASK) << 4) | \
(((attr) & BACKGROUND_MASK) >> 4);
/* License: Ruby's */
static WORD
constat_attr(int count, const int *seq, WORD attr, WORD default_attr)
{
#define FOREGROUND_MASK (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)
#define BACKGROUND_MASK (BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED)
WORD bold = attr & (FOREGROUND_INTENSITY | BACKGROUND_INTENSITY);
int rev = 0;
static WORD bold = 0;
static int rev = 0;
if (!count) return attr;
attr &= ~(FOREGROUND_INTENSITY | BACKGROUND_INTENSITY);
if (rev) attr = constat_attr_color_reverse(attr);
while (count-- > 0) {
switch (*seq++) {
case 0:
......
bold = 0;
break;
case 1:
bold |= rev ? BACKGROUND_INTENSITY : FOREGROUND_INTENSITY;
bold = FOREGROUND_INTENSITY;
break;
case 4:
#ifndef COMMON_LVB_UNDERSCORE
......
break;
}
}
if (rev) {
attr = attr & ~(FOREGROUND_MASK | BACKGROUND_MASK) |
((attr & FOREGROUND_MASK) << 4) |
((attr & BACKGROUND_MASK) >> 4);
}
return attr | bold;
attr |= bold;
if (rev) attr = constat_attr_color_reverse(attr);
return attr;
}
/* License: Ruby's */
    (1-1/1)