*** empty log message ***
authorroot <root>
Tue, 30 Mar 2010 22:46:25 +0000 (22:46 +0000)
committerroot <root>
Tue, 30 Mar 2010 22:46:25 +0000 (22:46 +0000)
src/rxvt.h
src/rxvtfont.h

index 63a7f05..bd205be 100644 (file)
@@ -338,7 +338,7 @@ enum {
 #define RS_baseattrMask         (RS_Italic | RS_Bold | RS_Blink | RS_RVid | RS_Uline)
 #define RS_attrMask             (RS_baseattrMask | RS_fontMask)
 
-#define RS_fontCount           127             // not 128 or 256, see rxvtfont.h
+#define RS_fontCount           rxvt_fontset::fontCount
 #define RS_fontMask             0xff000000UL    // plenty(?) of fonts, includes RS_Careful
 #define RS_fontShift            24
 
index 79f1373..ed20a2e 100644 (file)
@@ -68,6 +68,8 @@ struct rxvt_fontset
 {
   char *fontdesc;
 
+  enum { fontCount = 127 }; // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h
+
   rxvt_fontset (rxvt_term *term);
   ~rxvt_fontset ();
 
@@ -80,7 +82,7 @@ struct rxvt_fontset
   // font-id's MUST fit into a signed 16 bit integer, and within 0..255
   rxvt_font *operator [] (int id) const
   {
-    return fonts[id & 0x7f];
+    return fonts[id & fontCount];
   }
 
 private: