fix warnings
This commit is contained in:
parent
824b5ff88e
commit
cd287280b3
@ -186,14 +186,14 @@ valueExpression(term_t t, Number r ARG_LD)
|
|||||||
#ifdef O_GMP
|
#ifdef O_GMP
|
||||||
if (YAP_IsBigNumTerm(t0)) {
|
if (YAP_IsBigNumTerm(t0)) {
|
||||||
r->type = V_MPZ;
|
r->type = V_MPZ;
|
||||||
mpz_init(&r->value.mpz);
|
mpz_init(r->value.mpz);
|
||||||
YAP_BigNumOfTerm(t0, &r->value.mpz);
|
YAP_BigNumOfTerm(t0, r->value.mpz);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (YAP_IsRationalTerm(t0)) {
|
if (YAP_IsRationalTerm(t0)) {
|
||||||
r->type = V_MPQ;
|
r->type = V_MPQ;
|
||||||
mpq_init(&r->value.mpq);
|
mpq_init(r->value.mpq);
|
||||||
YAP_RationalOfTerm(t0, &r->value.mpq);
|
YAP_RationalOfTerm(t0, r->value.mpq);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -344,13 +344,15 @@ typedef union
|
|||||||
|
|
||||||
int
|
int
|
||||||
get_atom_ptr_text(Atom a, PL_chars_t *text)
|
get_atom_ptr_text(Atom a, PL_chars_t *text)
|
||||||
{ if (YAP_IsWideAtom(a))
|
{
|
||||||
{ pl_wchar_t *name = (pl_wchar_t *)YAP_WideAtomName(a);
|
YAP_Atom ya = (YAP_Atom)a;
|
||||||
text->text.w = name;
|
if (YAP_IsWideAtom(ya)) {
|
||||||
text->length = wcslen(name);
|
pl_wchar_t *name = (pl_wchar_t *)YAP_WideAtomName(ya);
|
||||||
text->encoding = ENC_WCHAR;
|
text->text.w = name;
|
||||||
|
text->length = wcslen(name);
|
||||||
|
text->encoding = ENC_WCHAR;
|
||||||
} else
|
} else
|
||||||
{ char *name = (char *)YAP_AtomName(a);
|
{ char *name = (char *)YAP_AtomName(ya);
|
||||||
text->text.t = name;
|
text->text.t = name;
|
||||||
text->length = strlen(name);
|
text->length = strlen(name);
|
||||||
text->encoding = ENC_ISO_LATIN_1;
|
text->encoding = ENC_ISO_LATIN_1;
|
||||||
@ -364,7 +366,7 @@ get_atom_ptr_text(Atom a, PL_chars_t *text)
|
|||||||
|
|
||||||
int
|
int
|
||||||
get_atom_text(atom_t atom, PL_chars_t *text)
|
get_atom_text(atom_t atom, PL_chars_t *text)
|
||||||
{ Atom a = atomValue(atom);
|
{ Atom a = (Atom)atomValue(atom);
|
||||||
|
|
||||||
return get_atom_ptr_text(a, text);
|
return get_atom_ptr_text(a, text);
|
||||||
}
|
}
|
||||||
@ -383,11 +385,11 @@ PL_get_number(term_t l, number *n) {
|
|||||||
#ifdef O_GMP
|
#ifdef O_GMP
|
||||||
} else if (YAP_IsBigNumTerm(t)) {
|
} else if (YAP_IsBigNumTerm(t)) {
|
||||||
n->type = V_MPZ;
|
n->type = V_MPZ;
|
||||||
mpz_init(&n->value.mpq);
|
mpz_init(n->value.mpz);
|
||||||
YAP_BigNumOfTerm(t, &n->value.mpz);
|
YAP_BigNumOfTerm(t, n->value.mpz);
|
||||||
} else {
|
} else {
|
||||||
n->type = V_MPQ;
|
n->type = V_MPQ;
|
||||||
mpq_init(&n->value.mpq);
|
mpq_init(n->value.mpq);
|
||||||
YAP_RationalOfTerm(t, &n->value.mpq);
|
YAP_RationalOfTerm(t, &n->value.mpq);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user