X-Git-Url: https://git.wh0rd.org/?p=fontconfig.git;a=blobdiff_plain;f=src%2Fftglue.c;h=1eca304cf88e4b9f8bf2011a7becc8985c54d258;hp=b337751a975715627bd723053a95ba4670941594;hb=55e202a62d95e25cf2c4897afd66eab5711195c3;hpb=52742ff86b60b1d244c1e87611aff5ceee46e596 diff --git a/src/ftglue.c b/src/ftglue.c index b337751..1eca304 100644 --- a/src/ftglue.c +++ b/src/ftglue.c @@ -60,64 +60,7 @@ ftglue_qalloc( FT_Memory memory, } while (0) -FTGLUE_APIDEF( FT_Pointer ) -ftglue_alloc( FT_Memory memory, - FT_ULong size, - FT_Error *perror ) -{ - FT_Error error = 0; - FT_Pointer block = NULL; - - if ( size > 0 ) - { - block = memory->alloc( memory, size ); - if ( !block ) - error = FT_Err_Out_Of_Memory; - else - memset( (char*)block, 0, (size_t)size ); - } - - *perror = error; - return block; -} - - -FTGLUE_APIDEF( FT_Pointer ) -ftglue_realloc( FT_Memory memory, - FT_Pointer block, - FT_ULong old_size, - FT_ULong new_size, - FT_Error *perror ) -{ - FT_Pointer block2 = NULL; - FT_Error error = 0; - - if ( old_size == 0 || block == NULL ) - { - block2 = ftglue_alloc( memory, new_size, &error ); - } - else if ( new_size == 0 ) - { - ftglue_free( memory, block ); - } - else - { - block2 = memory->realloc( memory, old_size, new_size, block ); - if ( block2 == NULL ) - error = FT_Err_Out_Of_Memory; - else if ( new_size > old_size ) - memset( (char*)block2 + old_size, 0, (size_t)(new_size - old_size) ); - } - - if ( !error ) - block = block2; - - *perror = error; - return block; -} - - -FTGLUE_APIDEF( void ) +static void ftglue_free( FT_Memory memory, FT_Pointer block ) { @@ -125,7 +68,6 @@ ftglue_free( FT_Memory memory, memory->free( memory, block ); } - FTGLUE_APIDEF( FT_Long ) ftglue_stream_pos( FT_Stream stream ) { @@ -301,7 +243,7 @@ ftglue_face_goto_table( FT_Face face, goto FoundIt; } } - error = TT_Err_Table_Missing; + error = FT_Err_Table_Missing; FoundIt: FORGET_Frame();