Rename buffer->inplace to buffer->separate_out with the inverted meaning,

2007-10-11  Behdad Esfahbod  <behdad@gnome.org>

        * pango/opentype/harfbuzz-buffer.[ch]: Rename buffer->inplace to
        buffer->separate_out with the inverted meaning, such that buffer
        is initialization is memset(0).
This commit is contained in:
Behdad Esfahbod 2007-10-11 07:12:49 +00:00 committed by Behdad Esfahbod
parent 06003908cc
commit 986f4fd968
2 changed files with 18 additions and 18 deletions

View File

@ -34,8 +34,8 @@
* in_string and alt_string. alt_string is not allocated until its needed, * in_string and alt_string. alt_string is not allocated until its needed,
* but after that it's grown with in_string unconditionally. * but after that it's grown with in_string unconditionally.
* *
* The buffer->inplace boolean keeps status of whether out_string points to * The buffer->separate_out boolean keeps status of whether out_string points
* in_string or alt_string. * to in_string (FALSE) or alt_string (TRUE).
*/ */
static HB_Error static HB_Error
@ -60,7 +60,14 @@ hb_buffer_ensure( HB_Buffer buffer,
if ( REALLOC_ARRAY( buffer->in_string, new_allocated, HB_GlyphItemRec ) ) if ( REALLOC_ARRAY( buffer->in_string, new_allocated, HB_GlyphItemRec ) )
return error; return error;
if ( buffer->inplace ) if ( buffer->separate_out )
{
if ( REALLOC_ARRAY( buffer->alt_string, new_allocated, HB_GlyphItemRec ) )
return error;
buffer->out_string = buffer->alt_string;
}
else
{ {
buffer->out_string = buffer->in_string; buffer->out_string = buffer->in_string;
@ -70,13 +77,6 @@ hb_buffer_ensure( HB_Buffer buffer,
return error; return error;
} }
} }
else
{
if ( REALLOC_ARRAY( buffer->alt_string, new_allocated, HB_GlyphItemRec ) )
return error;
buffer->out_string = buffer->alt_string;
}
buffer->allocated = new_allocated; buffer->allocated = new_allocated;
} }
@ -97,7 +97,7 @@ hb_buffer_duplicate_out_buffer( HB_Buffer buffer )
buffer->out_string = buffer->alt_string; buffer->out_string = buffer->alt_string;
memcpy( buffer->out_string, buffer->in_string, buffer->out_length * sizeof (buffer->out_string[0]) ); memcpy( buffer->out_string, buffer->in_string, buffer->out_length * sizeof (buffer->out_string[0]) );
buffer->inplace = FALSE; buffer->separate_out = TRUE;
return HB_Err_Ok; return HB_Err_Ok;
} }
@ -121,7 +121,7 @@ hb_buffer_new( HB_Buffer *buffer )
(*buffer)->alt_string = NULL; (*buffer)->alt_string = NULL;
(*buffer)->positions = NULL; (*buffer)->positions = NULL;
(*buffer)->max_ligID = 0; (*buffer)->max_ligID = 0;
(*buffer)->inplace = TRUE; (*buffer)->separate_out = FALSE;
return HB_Err_Ok; return HB_Err_Ok;
} }
@ -148,7 +148,7 @@ hb_buffer_clear_output( HB_Buffer buffer )
buffer->out_length = 0; buffer->out_length = 0;
buffer->out_pos = 0; buffer->out_pos = 0;
buffer->out_string = buffer->in_string; buffer->out_string = buffer->in_string;
buffer->inplace = TRUE; buffer->separate_out = FALSE;
} }
void void
@ -158,7 +158,7 @@ hb_buffer_swap( HB_Buffer buffer )
int tmp_length; int tmp_length;
int tmp_pos; int tmp_pos;
if ( ! buffer->inplace ) if ( buffer->separate_out )
{ {
tmp_string = buffer->in_string; tmp_string = buffer->in_string;
buffer->in_string = buffer->out_string; buffer->in_string = buffer->out_string;
@ -193,7 +193,7 @@ hb_buffer_clear( HB_Buffer buffer )
buffer->in_pos = 0; buffer->in_pos = 0;
buffer->out_pos = 0; buffer->out_pos = 0;
buffer->out_string = buffer->in_string; buffer->out_string = buffer->in_string;
buffer->inplace = TRUE; buffer->separate_out = FALSE;
} }
HB_Error HB_Error
@ -258,7 +258,7 @@ hb_buffer_add_output_glyphs( HB_Buffer buffer,
if ( error ) if ( error )
return error; return error;
if ( buffer->inplace ) if ( !buffer->separate_out )
{ {
error = hb_buffer_duplicate_out_buffer( buffer ); error = hb_buffer_duplicate_out_buffer( buffer );
if ( error ) if ( error )
@ -313,7 +313,7 @@ hb_buffer_copy_output_glyph ( HB_Buffer buffer )
if ( error ) if ( error )
return error; return error;
if ( ! buffer->inplace ) if ( buffer->separate_out )
{ {
buffer->out_string[buffer->out_pos] = buffer->in_string[buffer->in_pos]; buffer->out_string[buffer->out_pos] = buffer->in_string[buffer->in_pos];
} }

View File

@ -55,7 +55,7 @@ typedef struct HB_BufferRec_{
FT_ULong in_pos; FT_ULong in_pos;
FT_ULong out_pos; FT_ULong out_pos;
FT_Bool inplace; FT_Bool separate_out;
HB_GlyphItem in_string; HB_GlyphItem in_string;
HB_GlyphItem out_string; HB_GlyphItem out_string;
HB_GlyphItem alt_string; HB_GlyphItem alt_string;