/* * This function has to create static storage * initialized with const-list p. */ void gen_dc(FILE *f,int t,struct const_list *p){ #ifdef DEBUG_MARK printf("Called gen_dc(FILE *f,int t,struct const_list *p)\n"); #endif if(!p->tree){ if(ISFLOAT(t)){ emit(f,"\t.DAT \t "); emit(f,"0x%x", *(unsigned int*)&p->val); emit(f,"\n"); } else{ emit(f,"\t.DAT \t "); emitval(f,&p->val,t&NU); emit(f,"\n"); } } else{ emit(f,"\t.DAT \t "); struct const_list *p_next = p; for(;p_next;p_next=p_next->next){ emitval(f,&p_next->val,t&NU); emit(f, " "); } emit(f, "\n"); } }
double bpx_get_float(TERM t) { XDEREF(t); if (ISINT(t)) { return (double)(INTVAL(t)); } else if (ISFLOAT(t)) { return floatval(t); } else { bpx_raise("integer or floating number expected"); } return 0.0; /* should not be reached */ }