mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Move over a few more objects to the new array_list functions
darcs-hash:20060731165511-ac50b-7858829e6a612e0c737d82d3d71d6833dc97f078.gz
This commit is contained in:
parent
bd0c1573df
commit
d1bbb89389
4 changed files with 19 additions and 21 deletions
4
expand.c
4
expand.c
|
@ -874,7 +874,7 @@ static int expand_variables( wchar_t *in, array_list_t *out, int last_idx )
|
|||
is_ok = 0;
|
||||
break;
|
||||
}
|
||||
al_push( var_idx_list, (void *)tmp );
|
||||
al_push_long( var_idx_list, tmp );
|
||||
stop_pos = end-in;
|
||||
}
|
||||
}
|
||||
|
@ -887,7 +887,7 @@ static int expand_variables( wchar_t *in, array_list_t *out, int last_idx )
|
|||
int j;
|
||||
for( j=0; j<al_get_count( var_idx_list ); j++)
|
||||
{
|
||||
long tmp = (long)al_get( var_idx_list, j );
|
||||
long tmp = al_get_long( var_idx_list, j );
|
||||
if( tmp < 0 )
|
||||
{
|
||||
tmp = al_get_count( &var_item_list)+tmp+1;
|
||||
|
|
26
fish_tests.c
26
fish_tests.c
|
@ -152,7 +152,7 @@ static void pq_test( int elements )
|
|||
*/
|
||||
static int stack_test( int elements )
|
||||
{
|
||||
int i;
|
||||
long i;
|
||||
|
||||
int res=1;
|
||||
|
||||
|
@ -162,12 +162,12 @@ static int stack_test( int elements )
|
|||
|
||||
for( i=0; i<elements; i++ )
|
||||
{
|
||||
int foo;
|
||||
long foo;
|
||||
|
||||
al_push( &s, (void*)i);
|
||||
al_push( &s, (void*)i);
|
||||
al_push_long( &s, i);
|
||||
al_push_long( &s, i);
|
||||
|
||||
if( (foo=(int)al_pop( &s )) != i )
|
||||
if( (foo=al_pop_long( &s )) != i )
|
||||
{
|
||||
err( L"Unexpected data" );
|
||||
res = 0;
|
||||
|
@ -177,16 +177,14 @@ static int stack_test( int elements )
|
|||
|
||||
for( i=0; i<elements; i++ )
|
||||
{
|
||||
int foo;
|
||||
long foo;
|
||||
|
||||
if( (foo=(int)al_pop( &s )) != (elements-i-1) )
|
||||
if( (foo=al_pop_long( &s )) != (elements-i-1) )
|
||||
{
|
||||
err( L"Unexpected data" );
|
||||
res = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -297,22 +295,22 @@ static int hash_test( int elements )
|
|||
*/
|
||||
static void al_test( int sz)
|
||||
{
|
||||
int i;
|
||||
long i;
|
||||
array_list_t l;
|
||||
|
||||
|
||||
|
||||
al_init( &l );
|
||||
|
||||
al_set( &l, 1, (void *)7 );
|
||||
al_set( &l, sz, (void *)7 );
|
||||
al_set_long( &l, 1, 7L );
|
||||
al_set_long( &l, sz, 7L );
|
||||
|
||||
if( al_get_count( &l ) != maxi( sz+1, 2 ) )
|
||||
err( L"Wrong number of elements in array list" );
|
||||
|
||||
for( i=0; i<al_get_count( &l ); i++ )
|
||||
{
|
||||
int val = (int)((long) al_get( &l, i ));
|
||||
long val = al_get_long( &l, i );
|
||||
if( (i == 1) || (i==sz))
|
||||
{
|
||||
if( val != 7 )
|
||||
|
|
|
@ -960,7 +960,7 @@ static void highlight_universal_internal( wchar_t * buff,
|
|||
if( level == 0 )
|
||||
{
|
||||
level++;
|
||||
al_push( &l, (void *)(str-buff) );
|
||||
al_push_long( &l, (long)(str-buff) );
|
||||
prev_q = *str;
|
||||
}
|
||||
else
|
||||
|
@ -970,7 +970,7 @@ static void highlight_universal_internal( wchar_t * buff,
|
|||
long pos1, pos2;
|
||||
|
||||
level--;
|
||||
pos1 = (long)al_pop( &l );
|
||||
pos1 = al_pop_long( &l );
|
||||
pos2 = str-buff;
|
||||
if( pos1==pos || pos2==pos )
|
||||
{
|
||||
|
@ -984,7 +984,7 @@ static void highlight_universal_internal( wchar_t * buff,
|
|||
else
|
||||
{
|
||||
level++;
|
||||
al_push( &l, (void *)(str-buff) );
|
||||
al_push_long( &l, (long)(str-buff) );
|
||||
prev_q = *str;
|
||||
}
|
||||
}
|
||||
|
|
4
proc.c
4
proc.c
|
@ -1092,7 +1092,7 @@ void proc_sanity_check()
|
|||
void proc_push_interactive( int value )
|
||||
{
|
||||
int old = is_interactive;
|
||||
al_push( interactive_stack, (void *)(long)is_interactive );
|
||||
al_push_long( interactive_stack, (long)is_interactive );
|
||||
is_interactive = value;
|
||||
if( old != value )
|
||||
signal_set_handlers();
|
||||
|
@ -1101,7 +1101,7 @@ void proc_push_interactive( int value )
|
|||
void proc_pop_interactive()
|
||||
{
|
||||
int old = is_interactive;
|
||||
is_interactive= (int)(long)al_pop(interactive_stack);
|
||||
is_interactive= (int)al_pop_long(interactive_stack);
|
||||
if( is_interactive != old )
|
||||
signal_set_handlers();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue