static void throwBasePtrCnv( // CONVERSION TO A PTR. TO BASE CLASS SCOPE base, // - scope for base class void *dat ) // - control area { THROW_CNV_CTL *ctl; // - control area ctl = dat; if( validateBase( base, ctl ) ) { makeThrowCnv( ctl, MakePointerTo( ScopeClass( base ) ), ctl->offset ); } }
static void throwBaseCnv( // CONVERSION TO A BASE CLASS SCOPE base, // - scope for base class void* dat ) // - control area { THROW_CNV_CTL *ctl; // - control area ctl = dat; if( validateBase( base, ctl ) ) { SCOPE curr_scope = GetCurrScope(); if( base->owner.type != ctl->src_type ) { SetCurrScope(base); } makeThrowCnv( ctl, ScopeClass( base ), ctl->offset ); SetCurrScope(curr_scope); } }
main (int argc, char *argv[]) { if (argv[1] == NULL || argv[2] == NULL || argv[3] == NULL) { printf("Usage convert <number> <from_base> <to_base>\n"); exit(0); } int frombase, tobase; frombase = atoi(argv[2]); tobase = atoi(argv[3]); validateBase(argv[1], frombase, tobase); int tmp; tmp = convertToBase10(argv[1], frombase); convertFromBase10(tmp, tobase); }