MCPcopy Create free account
hub / github.com/boostorg/build / expand_modifiers

Function expand_modifiers

src/engine/function.c:806–843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804 */
805
806static int expand_modifiers( STACK * s, int n )
807{
808 int i;
809 int total = 1;
810 LIST * * args = stack_get( s );
811 for ( i = 0; i < n; ++i )
812 total *= list_length( args[ i ] );
813
814 if ( total != 0 )
815 {
816 VAR_EDITS * out = stack_allocate( s, total * sizeof( VAR_EDITS ) );
817 LISTITER * iter = stack_allocate( s, n * sizeof( LIST * ) );
818 for ( i = 0; i < n; ++i )
819 iter[ i ] = list_begin( args[ i ] );
820 i = 0;
821 {
822 int havezeroed;
823 loop:
824 memset( out, 0, sizeof( *out ) );
825 havezeroed = 0;
826 for ( i = 0; i < n; ++i )
827 havezeroed = var_edit_parse( object_str( list_item( iter[ i ] )
828 ), out, havezeroed );
829 ++out;
830 while ( --i >= 0 )
831 {
832 if ( list_next( iter[ i ] ) != list_end( args[ i ] ) )
833 {
834 iter[ i ] = list_next( iter[ i ] );
835 goto loop;
836 }
837 iter[ i ] = list_begin( args[ i ] );
838 }
839 }
840 stack_deallocate( s, n * sizeof( LIST * ) );
841 }
842 return total;
843}
844
845static LIST * apply_modifiers( STACK * s, int n )
846{

Callers 1

function_runFunction · 0.85

Calls 8

stack_getFunction · 0.85
list_lengthFunction · 0.85
stack_allocateFunction · 0.85
list_beginFunction · 0.85
var_edit_parseFunction · 0.85
object_strFunction · 0.85
list_endFunction · 0.85
stack_deallocateFunction · 0.85

Tested by

no test coverage detected