* src/bdf/bdflic.c: removed compiler warning, and changed all tables to the "static const" storage specifier (instead of simply 'static') * src/type42/t32drivr.c, src/bdf/bdfdrivr.c: removing compiler warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419
diff --git a/ChangeLog b/ChangeLog
index 8908dae..d17c79e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
2002-05-21 David Turner <david@freetype.org>
- * src/type42/t32drivr.c: removing compiler warnings
+ * src/bdf/bdflic.c: removed compiler warning, and changed all tables
+ to the "static const" storage specifier (instead of simply 'static')
+
+ * src/type42/t32drivr.c, src/bdf/bdfdrivr.c:
+ removing compiler warnings
* include/freetype/internal/ftbdf.h, src/base/ftbdf.c,
src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk:
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index 9f508a4..3c89850 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -194,17 +194,18 @@ THE SOFTWARE.
xres->value.int32,
yres->value.int32 ));
root->available_sizes->width =
- prop->value.int32 * 75 / xres->value.int32;
+ (FT_Short)( prop->value.int32 * 75 / xres->value.int32 );
+
root->available_sizes->height =
- prop->value.int32 * 75 / yres->value.int32;
+ (FT_Short)( prop->value.int32 * 75 / yres->value.int32 );
}
}
else
{
/* some fonts have broken SIZE declaration (jiskan24.bdf) */
FT_ERROR(( "BDF_Face_Init: reading size\n" ));
- root->available_sizes->width = font->point_size ;
- root->available_sizes->height = font->point_size ;
+ root->available_sizes->width = (FT_Short) font->point_size ;
+ root->available_sizes->height = (FT_Short) font->point_size ;
}
/* encoding table */
@@ -220,7 +221,7 @@ THE SOFTWARE.
{
(face->en_table[n]).enc = cur[n].encoding;
FT_TRACE4(( "idx %d, val 0x%lX\n", n, cur[n].encoding ));
- (face->en_table[n]).glyph = n;
+ (face->en_table[n]).glyph = (FT_Short) n;
}
}
@@ -366,10 +367,10 @@ THE SOFTWARE.
/* get the full bytes */
for ( j = 0; j < ( bitmap->width >> 2 ); j++ )
{
- bitmap->buffer[count++] = ( *pp & 0xC0 ) >> 6;
- bitmap->buffer[count++] = ( *pp & 0x30 ) >> 4;
- bitmap->buffer[count++] = ( *pp & 0x0C ) >> 2;
- bitmap->buffer[count++] = *pp & 0x03;
+ bitmap->buffer[count++] = (FT_Byte)(( *pp & 0xC0 ) >> 6);
+ bitmap->buffer[count++] = (FT_Byte)(( *pp & 0x30 ) >> 4);
+ bitmap->buffer[count++] = (FT_Byte)(( *pp & 0x0C ) >> 2);
+ bitmap->buffer[count++] = (FT_Byte)( *pp & 0x03 );
pp++;
}
@@ -378,13 +379,13 @@ THE SOFTWARE.
switch ( bitmap->width & 3 )
{
case 3:
- bitmap->buffer[count++] = ( *pp & 0xC0 ) >> 6;
+ bitmap->buffer[count++] = (FT_Byte)(( *pp & 0xC0 ) >> 6);
/* fall through */
case 2:
- bitmap->buffer[count++] = ( *pp & 0x30 ) >> 4;
+ bitmap->buffer[count++] = (FT_Byte)(( *pp & 0x30 ) >> 4);
/* fall through */
case 1:
- bitmap->buffer[count++] = ( *pp & 0x0C ) >> 2;
+ bitmap->buffer[count++] = (FT_Byte)(( *pp & 0x0C ) >> 2);
/* fall through */
case 0:
break;
@@ -407,8 +408,8 @@ THE SOFTWARE.
/* get the full bytes */
for ( j = 0; j < ( bitmap->width >> 1 ); j++ )
{
- bitmap->buffer[count++] = ( *pp & 0xF0 ) >> 4;
- bitmap->buffer[count++] = *pp & 0x0F;
+ bitmap->buffer[count++] = (FT_Byte)(( *pp & 0xF0 ) >> 4);
+ bitmap->buffer[count++] = (FT_Byte)( *pp & 0x0F );
pp++;
}
@@ -417,7 +418,7 @@ THE SOFTWARE.
switch ( bitmap->width & 1 )
{
case 1:
- bitmap->buffer[count++] = ( *pp & 0xF0 ) >> 4;
+ bitmap->buffer[count++] = (FT_Byte)(( *pp & 0xF0 ) >> 4);
/* fall through */
case 0:
break;
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index ce00313..0429f7d 100644
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -57,7 +57,7 @@
/*************************************************************************/
- static bdf_options_t _bdf_opts =
+ static const bdf_options_t _bdf_opts =
{
1, /* Correct metrics. */
1, /* Preserve unencoded glyphs. */
@@ -75,7 +75,7 @@
/* List of most properties that might appear in a font. Doesn't include */
/* the RAW_* and AXIS_* properties in X11R6 polymorphic fonts. */
- static bdf_property_t _bdf_properties[] =
+ static const bdf_property_t _bdf_properties[] =
{
{ (char *)"ADD_STYLE_NAME", BDF_ATOM, 1, { 0 } },
{ (char *)"AVERAGE_WIDTH", BDF_INTEGER, 1, { 0 } },
@@ -384,7 +384,7 @@
} _bdf_parse_t;
-#define setsbit( m, cc ) ( m[(cc) >> 3] |= ( 1 << ( (cc) & 7 ) ) )
+#define setsbit( m, cc ) ( m[(cc) >> 3] |= (FT_Byte)( 1 << ( (cc) & 7 ) ) )
#define sbitset( m, cc ) ( m[(cc) >> 3] & ( 1 << ( (cc) & 7 ) ) )
@@ -581,7 +581,7 @@
dp[j++] = *fp++;
if ( i + 1 < list->used )
- dp[j++] = c;
+ dp[j++] = (char)c;
}
dp[j] = 0;
@@ -723,8 +723,8 @@
lineno++;
/* Restore the character at the end of the line. */
- *hp = hold;
- }
+ *hp = (char)hold;
+ }
}
}
@@ -737,7 +737,7 @@
/* XXX: make this work with EBCDIC also */
- static unsigned char a2i[128] =
+ static const unsigned char a2i[128] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -752,7 +752,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
- static unsigned char odigits[32] =
+ static const unsigned char odigits[32] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -760,7 +760,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
- static unsigned char ddigits[32] =
+ static const unsigned char ddigits[32] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -768,7 +768,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
- static unsigned char hdigits[32] =
+ static const unsigned char hdigits[32] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03,
0x7e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
@@ -786,8 +786,8 @@
char** end,
int base )
{
- unsigned long v;
- unsigned char* dmap;
+ unsigned long v;
+ const unsigned char* dmap;
if ( s == 0 || *s == 0 )
@@ -833,8 +833,8 @@
char** end,
int base )
{
- long v, neg;
- unsigned char* dmap;
+ long v, neg;
+ const unsigned char* dmap;
if ( s == 0 || *s == 0 )
@@ -888,8 +888,8 @@
char** end,
int base )
{
- short v, neg;
- unsigned char* dmap;
+ short v, neg;
+ const unsigned char* dmap;
if ( s == 0 || *s == 0 )
@@ -928,12 +928,12 @@
}
for ( v = 0; isdigok( dmap, *s ); s++ )
- v = v * base + a2i[(int)*s];
+ v = (short)(v * base + a2i[(int)*s]);
if ( end != 0 )
*end = s;
- return ( !neg ) ? v : -v;
+ return (short)(( !neg ) ? v : -v );
}
@@ -1030,7 +1030,7 @@
if ( propid >= _num_bdf_properties )
return font->user_props + ( propid - _num_bdf_properties );
- return _bdf_properties + propid;
+ return (bdf_property_t*) _bdf_properties + propid;
}
@@ -1217,7 +1217,7 @@
/* Restore the character that was saved before any return can happen. */
if ( hold != -1 )
- *ep = hold;
+ *ep = (char) hold;
/* If the property exists and is not an atom, just return here. */
if ( p && p->format != BDF_ATOM )
@@ -1272,7 +1272,7 @@
/* the value of the property with the current value. */
fp = font->props + (unsigned long)hn->data;
- switch ( prop->format )
+ switch ( fp->format )
{
case BDF_ATOM:
/* Delete the current atom if it exists. */
@@ -1300,8 +1300,11 @@
case BDF_CARDINAL:
fp->value.card32 = _bdf_atoul( value, 0, 10 );
break;
+
+ default:
+ ;
}
-
+
goto Exit;
}
@@ -1341,7 +1344,7 @@
if ( propid >= _num_bdf_properties )
prop = font->user_props + ( propid - _num_bdf_properties );
else
- prop = _bdf_properties + propid;
+ prop = (bdf_property_t*)_bdf_properties + propid;
fp = font->props + font->props_used;
@@ -1416,7 +1419,7 @@
}
- static unsigned char nibble_mask[8] =
+ static const unsigned char nibble_mask[8] =
{
0xFF, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE
};
@@ -1661,7 +1664,7 @@
{
/* If there are more rows than are specified in the glyph metrics, */
/* ignore the remaining lines. */
- if ( p->row >= glyph->bbx.height )
+ if ( p->row >= (unsigned long)glyph->bbx.height )
{
if ( !( p->flags & _BDF_GLYPH_HEIGHT_CHECK ) )
{
@@ -1681,7 +1684,7 @@
for ( i = 0, *bp = 0; i < nibbles; i++ )
{
c = line[i];
- *bp = ( *bp << 4 ) + a2i[c];
+ *bp = (FT_Byte)(( *bp << 4 ) + a2i[c]);
if ( i + 1 < nibbles && ( i & 1 ) )
*++bp = 0;
}
@@ -1717,7 +1720,7 @@
error = _bdf_split( (char *)" +", line, linelen, &p->list, memory );
if ( error )
goto Exit;
- glyph->swidth = _bdf_atoul( p->list.field[1], 0, 10 );
+ glyph->swidth = (unsigned short)_bdf_atoul( p->list.field[1], 0, 10 );
p->flags |= _BDF_SWIDTH;
goto Exit;
@@ -1729,7 +1732,7 @@
error = _bdf_split( (char *)" +", line, linelen, &p->list,memory );
if ( error )
goto Exit;
- glyph->dwidth = _bdf_atoul( p->list.field[1], 0, 10 );
+ glyph->dwidth = (unsigned short)_bdf_atoul( p->list.field[1], 0, 10 );
if ( !( p->flags & _BDF_SWIDTH ) )
{
@@ -1761,15 +1764,15 @@
glyph->bbx.y_offset = _bdf_atos( p->list.field[4], 0, 10 );
/* Generate the ascent and descent of the character. */
- glyph->bbx.ascent = glyph->bbx.height + glyph->bbx.y_offset;
- glyph->bbx.descent = -glyph->bbx.y_offset;
+ glyph->bbx.ascent = (short)(glyph->bbx.height + glyph->bbx.y_offset);
+ glyph->bbx.descent = (short)(-glyph->bbx.y_offset);
/* Determine the overall font bounding box as the characters are */
/* loaded so corrections can be done later if indicated. */
p->maxas = MAX( glyph->bbx.ascent, p->maxas );
p->maxds = MAX( glyph->bbx.descent, p->maxds );
- p->rbearing = glyph->bbx.width + glyph->bbx.x_offset;
+ p->rbearing = (short)( glyph->bbx.width + glyph->bbx.x_offset );
p->maxrb = MAX( p->rbearing, p->maxrb );
p->minlb = MIN( glyph->bbx.x_offset, p->minlb );
@@ -1826,7 +1829,7 @@
/* Allocate enough space for the bitmap. */
glyph->bpr = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3;
- glyph->bytes = glyph->bpr * glyph->bbx.height;
+ glyph->bytes = (unsigned short)(glyph->bpr * glyph->bbx.height);
if ( FT_NEW_ARRAY( glyph->bitmap, glyph->bytes ) )
goto Exit;
@@ -2029,7 +2032,7 @@
error = hash_init( &(font->proptbl), memory );
if ( error )
goto Exit;
- for ( i = 0, prop = _bdf_properties;
+ for ( i = 0, prop = (bdf_property_t*) _bdf_properties;
i < _num_bdf_properties; i++, prop++ )
{
error = hash_insert( prop->name, (void *)i,
@@ -2088,8 +2091,10 @@
p->font->bbx.x_offset = _bdf_atos( p->list.field[3], 0, 10 );
p->font->bbx.y_offset = _bdf_atos( p->list.field[4], 0, 10 );
- p->font->bbx.ascent = p->font->bbx.height + p->font->bbx.y_offset;
- p->font->bbx.descent = -p->font->bbx.y_offset;
+ p->font->bbx.ascent = (short)( p->font->bbx.height +
+ p->font->bbx.y_offset );
+
+ p->font->bbx.descent = (short)( -p->font->bbx.y_offset );
p->flags |= _BDF_FONT_BBX;
@@ -2195,7 +2200,7 @@
FT_MEM_SET( &p, 0, sizeof ( _bdf_parse_t ) );
- p.opts = ( opts != 0 ) ? opts : &_bdf_opts;
+ p.opts = (bdf_options_t*)(( opts != 0 ) ? opts : &_bdf_opts);
p.minlb = 32767;
p.memory = extmemory; /* only during font creation */
@@ -2231,7 +2236,7 @@
{
FT_TRACE2(( "bdf_load_font: " ACMSG3,
p.font->bbx.width, p.maxrb - p.minlb ));
- p.font->bbx.width = p.maxrb - p.minlb;
+ p.font->bbx.width = (unsigned short)(p.maxrb - p.minlb);
p.font->modified = 1;
}
@@ -2256,7 +2261,7 @@
FT_TRACE2(( "bdf_load_font: " ACMSG6,
p.font->bbx.descent, p.maxds ));
p.font->bbx.descent = p.maxds;
- p.font->bbx.y_offset = -p.maxds;
+ p.font->bbx.y_offset = (short)(-p.maxds);
p.font->modified = 1;
}
@@ -2264,7 +2269,7 @@
{
FT_TRACE2(( "bdf_load_font: " ACMSG7,
p.font->bbx.height, p.maxas + p.maxds ));
- p.font->bbx.height = p.maxas + p.maxds;
+ p.font->bbx.height = (unsigned short)(p.maxas + p.maxds);
}
if ( p.flags & _BDF_SWIDTH_ADJ )