* include/freetype/internal/ftobjs.h, src/autohint/ahglyph.c, src/base/ftobjs.c, src/objs/fttype1.c, src/sfnt/ttcmap0.c, src/smooth/ftgrays.c: changed uses of "setjmp" and "longjmp" to "ft_setjmp" and "ft_lonjmp". Removed direct references to <stdio.h> and <setjmp.h> when appropriate, to eventually replace them with a FT_CONFIG_STANDARD_LIBRARY_H. Useful for the XFree86 Font Server backend based on FT2.
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
diff --git a/ChangeLog b/ChangeLog
index 483fc0a..9909e19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-06-08 Juliusz Chroboczek <jch@pps.jussieu.fr>
+
+ * include/freetype/internal/ftobjs.h, src/autohint/ahglyph.c,
+ src/base/ftobjs.c, src/objs/fttype1.c, src/sfnt/ttcmap0.c,
+ src/smooth/ftgrays.c: changed uses of "setjmp" and "longjmp"
+ to "ft_setjmp" and "ft_lonjmp". Removed direct references to
+ <stdio.h> and <setjmp.h> when appropriate, to eventually replace
+ them with a FT_CONFIG_STANDARD_LIBRARY_H. Useful for the XFree86
+ Font Server backend based on FT2.
+
2002-06-08 David Turner <david@freetype.org>
* src/pcf/pcfdriver.c (pcf_cmap_char_next): fixed a bug that caused
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index 66b42da..f92115c 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -26,8 +26,8 @@
#ifndef __FTOBJS_H__
#define __FTOBJS_H__
-#include <setjmp.h>
#include <ft2build.h>
+#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */
#include FT_RENDER_H
#include FT_SIZES_H
#include FT_INTERNAL_MEMORY_H
diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c
index ea6ecc2..2fd219e 100644
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -26,11 +26,11 @@
#include "ahglobal.h"
#include "aherrors.h"
-#include <stdio.h>
-
#ifdef AH_DEBUG
+#include <stdio.h>
+
void
ah_dump_edges( AH_Outline* outline )
{
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 6d8dca0..8b20c16 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -37,15 +37,15 @@
valid->level = level;
valid->error = 0;
}
-
+
FT_BASE_DEF( FT_Int )
ft_validator_run( FT_Validator valid )
{
int result;
-
- result = setjmp( valid->jump_buffer );
+
+ result = ft_setjmp( valid->jump_buffer );
return result;
}
@@ -55,8 +55,8 @@
FT_Error error )
{
valid->error = error;
- longjmp( valid->jump_buffer, 1 );
- }
+ ft_longjmp( valid->jump_buffer, 1 );
+ }
/*************************************************************************/
@@ -619,18 +619,18 @@
/* discard charmaps */
{
FT_Int n;
-
+
for ( n = 0; n < face->num_charmaps; n++ )
{
FT_CMap cmap = FT_CMAP( face->charmaps[n] );
-
+
FT_CMap_Done( cmap );
-
+
face->charmaps[n] = NULL;
}
-
+
FT_FREE( face->charmaps );
face->num_charmaps = 0;
}
@@ -1515,7 +1515,7 @@
if ( face && face->charmap )
{
FT_CMap cmap = FT_CMAP( face->charmap );
-
+
result = cmap->clazz->char_index( cmap, charcode );
}
@@ -2403,7 +2403,7 @@
/* documentation is in freetype.h */
-
+
FT_EXPORT_DEF( void )
FT_Library_Version( FT_Library library,
FT_Int *amajor,
@@ -2414,23 +2414,23 @@
FT_Int minor = 0;
FT_Int patch = 0;
-
+
if ( library )
{
major = library->version_major;
minor = library->version_minor;
patch = library->version_patch;
}
-
+
if ( *amajor )
*amajor = major;
-
+
if ( *aminor )
*aminor = minor;
-
+
if ( *apatch )
*apatch = patch;
- }
+ }
/* documentation is in ftmodule.h */
diff --git a/src/base/fttype1.c b/src/base/fttype1.c
index 14176a8..ea9970b 100644
--- a/src/base/fttype1.c
+++ b/src/base/fttype1.c
@@ -89,8 +89,8 @@
/* this will probably happen later... */
driver_name = face->driver->root.clazz->module_name;
- result = ( ft_strcmp( driver_name, "type1" ) ||
- ft_strcmp( driver_name, "cff" ) );
+ result = ( ft_strcmp( driver_name, "type1" ) == 0 ||
+ ft_strcmp( driver_name, "cff" ) == 0 );
}
return result;
diff --git a/src/sfnt/ttcmap0.c b/src/sfnt/ttcmap0.c
index 9094ef0..17bb776 100644
--- a/src/sfnt/ttcmap0.c
+++ b/src/sfnt/ttcmap0.c
@@ -742,42 +742,42 @@
FT_UInt min = 0;
FT_UInt max = num_segs2 >> 1;
FT_UInt mid, start, end, offset;
-
+
while ( min < max )
{
mid = ( min + max ) >> 1;
p = table + 14 + mid * 2;
- end = TT_NEXT_USHORT( p );
+ end = TT_NEXT_USHORT( p );
p += num_segs2;
start = TT_PEEK_USHORT( p);
-
+
if ( code < start )
max = mid;
-
+
else if ( code > end )
min = mid + 1;
-
+
else
{
/* we found the segment */
idx = code;
-
+
p += num_segs2;
delta = TT_PEEK_SHORT( p );
-
+
p += num_segs2;
offset = TT_PEEK_USHORT( p );
-
+
if ( offset != 0 )
{
p += offset + 2 * ( idx - start );
idx = TT_PEEK_USHORT( p );
}
-
+
if ( idx != 0 )
result = (FT_UInt)( idx + delta ) & 0xFFFFU;
-
+
goto Exit;
}
}
@@ -793,32 +793,32 @@
p = table + 14; /* ends table */
q = table + 16 + num_segs2; /* starts table */
-
+
for ( n = 0; n < num_segs2; n += 2 )
{
FT_UInt end = TT_NEXT_USHORT( p );
FT_UInt start = TT_NEXT_USHORT( q );
FT_UInt offset;
-
-
+
+
if ( code < start )
break;
-
+
if ( code <= end )
{
idx = code;
-
+
p = q + num_segs2 - 2;
delta = TT_PEEK_SHORT( p );
p += num_segs2;
offset = TT_PEEK_USHORT( p );
-
+
if ( offset != 0 )
{
p += offset + 2 * ( idx - start );
idx = TT_PEEK_USHORT( p );
}
-
+
if ( idx != 0 )
result = (FT_UInt)( idx + delta ) & 0xFFFFU;
}
@@ -828,7 +828,7 @@
#endif /* 0 */
}
-
+
Exit:
return result;
}
@@ -1032,7 +1032,7 @@
FT_UInt32 result = 0;
FT_UInt32 char_code = *pchar_code + 1;
FT_UInt gindex = 0;
-
+
FT_Byte* p = table + 6;
FT_UInt start = TT_NEXT_USHORT( p );
FT_UInt count = TT_NEXT_USHORT( p );
@@ -1716,14 +1716,14 @@
if ( clazz->format == format )
{
volatile TT_ValidatorRec valid;
-
+
ft_validator_init( FT_VALIDATOR( &valid ), cmap, limit,
FT_VALIDATE_DEFAULT );
-
+
valid.num_glyphs = face->root.num_glyphs;
- if ( setjmp( FT_VALIDATOR( &valid )->jump_buffer ) == 0 )
+ if ( ft_setjmp( FT_VALIDATOR( &valid )->jump_buffer ) == 0 )
{
/* validate this cmap sub-table */
clazz->validate( cmap, FT_VALIDATOR( &valid ) );
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 749ff6d..cafcd2a 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -106,6 +106,11 @@
#include <limits.h>
#define FT_UINT_MAX UINT_MAX
+#define ft_setjmp setjmp
+#define ft_longjmp longjmp
+#define ft_jmp_buf jmp_buf
+
+
#define ErrRaster_Invalid_Mode -2
#define ErrRaster_Invalid_Outline -1
@@ -391,7 +396,7 @@
if ( !ras.invalid && ( ras.area | ras.cover ) )
{
if ( ras.num_cells >= ras.max_cells )
- longjmp( ras.jump_buffer, 1 );
+ ft_longjmp( ras.jump_buffer, 1 );
cell = ras.cells + ras.num_cells++;
cell->x = ras.ex - ras.min_ex;
@@ -1355,7 +1360,7 @@
if ( ras.outline.flags & ft_outline_even_odd_fill )
{
coverage &= 511;
-
+
if ( coverage > 256 )
coverage = 512 - coverage;
else if ( coverage == 256 )
@@ -1791,7 +1796,7 @@
volatile int error = 0;
- if ( setjmp( ras.jump_buffer ) == 0 )
+ if ( ft_setjmp( ras.jump_buffer ) == 0 )
{
error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras );
gray_record_cell( RAS_VAR );