Ejemplo n.º 1
0
 void
introuble2_ASL(ASL *asl, const char *who, real a, real b, int jv)
{
	static const char fmt[] = "can't evaluate %s(%g,%g).\n";
#ifndef ASL_OLD_DERIV_CHECK /*{*/
	DerrRecord *R;

	if (jv > 1 && !(want_deriv & 2)) {
		if ((R = getDR(asl))) {
			R->errprint = derrprint2;
			R->a = a;
			R->u.b = b;
			R->jv = jv;
			R->fmt = fmt;
			R->who = who;
			}
		return;
		}
#endif /*}*/
	jmp_check(err_jmp, jv);
	report_where(asl);
	Errprint(fmt, who, a, b);
	jmp_check(err_jmp1, jv);
	exit(1);
	}
Ejemplo n.º 2
0
 void
deriv_errchk_ASL(ASL *asl, fint *nerror, int coi, int n)
{
	DerivErrInfo *D;
	DerrRecord *R, **Rp, **Rpe;
	int k;

	D = asl->i.Derrs;
	if ((k = coi) < 0) {
		k = -(k + 1);
		if (k >= nlo)
			return;
		}
	else if (k >= nlc)
		return;
	for(Rp = D->R + k, Rpe = Rp + n; Rp < Rpe; ++Rp, ++coi)
		if ((R = *Rp)) {
			jmp_check(err_jmp, R->jv);
			co_index = coi;
			report_where(asl);
			R->errprint(asl,R);
			fflush(Stderr);
			jmp_check(err_jmp1, R->jv);
			exit(1);
			}
	}
Ejemplo n.º 3
0
 void
zero_div_ASL(ASL *asl, real L, const char *op)
{
	errno_set(EDOM);
	jmp_check(err_jmp, 1);
	report_where(asl);
	fprintf(Stderr, "can't compute %g%s0.\n", L, op);
	fflush(Stderr);
	jmp_check(err_jmp1, 1);
	exit(1);
	}
Ejemplo n.º 4
0
introuble2(who, a, b, jv K_ASL) char *who; real a; real b; int jv; D_ASL
#else
introuble2(char *who, real a, real b, int jv A_ASL)
#endif
{
	char buf[96];
	jmp_check(err_jmp, jv);
	report_where(asl);
	snprintf(buf, sizeof(buf), "can't evaluate %s(%g,%g)", who, a, b);
	Errprint(buf);
	jmp_check(err_jmp1, jv);
	exit(1);
	}
Ejemplo n.º 5
0
 void
fintrouble_ASL(ASL *asl, func_info *fi, const char *s, TMInfo *T)
{
	TMInfo *T1, *T1prev;
	int jv;
	static const char fmt[] = "Error in function %s:\n\t%s\n";

	jv = 1;
	switch(*s) {
	 case '\'':
		jv = 2;
		goto inc_s;
	 case '"':
		jv = 3;
 inc_s:
		++s;
	 }
#ifndef ASL_OLD_DERIV_CHECK /*{*/
	if (jv > 1 && !(want_deriv & 2)) {
		DerivErrInfo *D;
		DerrRecord *R;
		size_t L;

		if ((R = getDR(asl))) {
			D = asl->i.Derrs;
			L = strlen(s) + 1;
			if (L > D->mblast - D->mbnext)
				D = new_DerrMblock(&asl->i, L);
			memcpy(D->mbnext, s, L);
			R->u.s = D->mbnext;
			D->mbnext += L;
			R->errprint = derrprintf;
			R->jv = jv;
			R->fmt = fmt;
			R->who = fi->name;
			}
		return;
		}
#endif /*}*/
	report_where(asl);
	fprintf(Stderr, fmt, fi->name, s);
	fflush(Stderr);
	for(T1 = T->u.prev; T1; T1 = T1prev) {
		T1prev = T1->u.prev;
		free(T1);
		}
	jmp_check(err_jmp, jv);
	jmp_check(err_jmp1,jv);
	exit(1);
	}
Ejemplo n.º 6
0
void report_unexpected_exception(const E& e, int severity, const char* file, int line, const char* function)
{
   report_where(file, line, function)  << " Unexpected exception of type " << typeid(e).name() << std::endl;
   BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Errot message was: " << e.what() << std::endl;
   BOOST_MP_REPORT_SEVERITY(severity);
}