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

Function expand_modifiers

v2/engine/function.c:847–884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

845 */
846
847static int expand_modifiers( STACK * s, int n )
848{
849 int i;
850 int total = 1;
851 LIST * * args = stack_get( s );
852 for ( i = 0; i < n; ++i )
853 total *= list_length( args[ i ] );
854
855 if ( total != 0 )
856 {
857 VAR_EDITS * out = stack_allocate( s, total * sizeof( VAR_EDITS ) );
858 LISTITER * iter = stack_allocate( s, n * sizeof( LIST * ) );
859 for ( i = 0; i < n; ++i )
860 iter[ i ] = list_begin( args[ i ] );
861 i = 0;
862 {
863 int havezeroed;
864 loop:
865 memset( out, 0, sizeof( *out ) );
866 havezeroed = 0;
867 for ( i = 0; i < n; ++i )
868 havezeroed = var_edit_parse( object_str( list_item( iter[ i ] )
869 ), out, havezeroed );
870 ++out;
871 while ( --i >= 0 )
872 {
873 if ( list_next( iter[ i ] ) != list_end( args[ i ] ) )
874 {
875 iter[ i ] = list_next( iter[ i ] );
876 goto loop;
877 }
878 iter[ i ] = list_begin( args[ i ] );
879 }
880 }
881 stack_deallocate( s, n * sizeof( LIST * ) );
882 }
883 return total;
884}
885
886static LIST * apply_modifiers( STACK * s, int n )
887{

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