slang-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] Error compiling slang2 on OS/2


Johannes Hromadka <dyane@xxxxxx> wrote:
>I can compile 1.4.9 without any problems. I get the same warnings for
>SLtt_set_color, but no error in write_attributes.
>
>I assume that the changes in SLsmg_Char_Type are the source of the error

Try replacing the OS/2 EMX_VIDEO version of write_attributes with this
version.  I have no idea if it will work since I have no access to an
OS/2 system.  Please let me know how you make out.  Thanks, --John

static void
write_attributes (SLsmg_Char_Type *src, unsigned int count)
{
   register unsigned char *p = Line_Buffer;
   int n = count;

   /* write into a character/attribute pair */
   while (n > 0)
     {
	/* UTF8 FIXME */
	if (src->nchars)
	  {
	     SLtt_reverse_video (src->color & SLSMG_COLOR_MASK);
	     *p++ = src->wchars[0];
	  }
	else *p++ = ' ';
	*p++ = Attribute_Byte;
	n--;
	src++;
     }
   v_putline (Line_Buffer, Cursor_Col, Cursor_Row, count);
}


And here is the same thing expressed as a patch:

--- ./slvideo.c~	Mon Feb 21 13:35:50 2005
+++ slvideo.c	Sat Feb 26 02:00:58 2005
@@ -1059,17 +1059,21 @@
 write_attributes (SLsmg_Char_Type *src, unsigned int count)
 {
    register unsigned char *p = Line_Buffer;
-   register unsigned short pair;
    int n = count;
 
    /* write into a character/attribute pair */
-   while (n-- > 0)
+   while (n > 0)
      {
-	pair = SLSMG_CHAR_TO_USHORT(*src);/* character/color pair */
+	/* UTF8 FIXME */
+	if (src->nchars)
+	  {
+	     SLtt_reverse_video (src->color & SLSMG_COLOR_MASK);
+	     *p++ = src->wchars[0];
+	  }
+	else *p++ = ' ';
+	*p++ = Attribute_Byte;
+	n--;
 	src++;
-	SLtt_reverse_video (pair >> 8);	/* color change */
-	*(p++) = pair & 0xff;		/* character byte */
-	*(p++) = Attribute_Byte;	/* attribute byte */
      }
    v_putline (Line_Buffer, Cursor_Col, Cursor_Row, count);
 }

_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]