diff --git a/fmpz/get_d_2exp.c b/fmpz/get_d_2exp.c
index 7aa9aa8..235f29d 100644
--- a/fmpz/get_d_2exp.c
+++ b/fmpz/get_d_2exp.c
@@ -52,9 +52,14 @@ fmpz_get_d_2exp(slong *exp, const fmpz_t f)
return __gmpn_get_d((mp_limb_t *) &d, WORD(1), WORD(1), -*exp);
}
else
+ {
#if defined(__MPIR_VERSION)
return mpz_get_d_2exp(exp, COEFF_TO_PTR(d));
#else
- return mpz_get_d_2exp((long *) exp, COEFF_TO_PTR(d));
+ long exp2;
+ double m = mpz_get_d_2exp(&exp2, COEFF_TO_PTR(d));
+ *exp = exp2;
+ return m;
#endif
+ }
}
diff --git a/fmpz_mod_poly_factor/inlines.c b/fmpz_mod_poly_factor/inlines.c
new file mode 100644
index 0000000..65e7926
--- /dev/null
+++ b/fmpz_mod_poly_factor/inlines.c
@@ -0,0 +1,41 @@
+/*=============================================================================
+
+ This file is part of FLINT.
+
+ FLINT is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ FLINT is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with FLINT; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+=============================================================================*/
+/******************************************************************************
+
+ Copyright (C) 2015 Tommy Hofmann
+
+******************************************************************************/
+
+#define FMPZ_MOD_POLY_FACTOR_INLINES_C
+
+#define ulong ulongxx /* interferes with system includes */
+#include <stdlib.h>
+#include <stdio.h>
+#undef ulong
+#include <gmp.h>
+#include "flint.h"
+#include "ulong_extras.h"
+#include "fmpz_mod_poly.h"
+
+void fmpz_mod_poly_factor_get_fmpz_mod_poly(fmpz_mod_poly_t z, fmpz_mod_poly_factor_t fac, slong i)
+{
+ fmpz_mod_poly_set(z, fac->poly + i);
+}
+
diff --git a/fmpz_poly/pseudo_divrem_basecase.c b/fmpz_poly/pseudo_divrem_basecase.c
index 7a91810..644e223 100644
--- a/fmpz_poly/pseudo_divrem_basecase.c
+++ b/fmpz_poly/pseudo_divrem_basecase.c
@@ -49,7 +49,7 @@ _fmpz_poly_pseudo_divrem_basecase(fmpz * Q, fmpz * R, ulong * d,
while (iR >= lenB - 1)
{
- if (inv)
+ if (inv != NULL)
fmpz_fdiv_qr_preinvn(Q + iQ, rem, R + iR, leadB, inv);
else
fmpz_fdiv_qr(Q + iQ, rem, R + iR, leadB);
diff --git a/fq_poly_templates/get_str_pretty.c b/fq_poly_templates/get_str_pretty.c
index 344a1b9..6a84f47 100644
--- a/fq_poly_templates/get_str_pretty.c
+++ b/fq_poly_templates/get_str_pretty.c
@@ -87,16 +87,16 @@ char *_TEMPLATE(T, poly_get_str_pretty) (const TEMPLATE(T, struct) * poly,
continue;
if (!TEMPLATE(T, is_one) (poly + i, ctx))
{
- off += flint_sprintf(str + off, "+(%s)", coeffstrs[i]);
+ off += flint_sprintf(str + off, "+(%s)*", coeffstrs[i]);
}
else
{
off += flint_sprintf(str + off, "+");
}
if (i > 1)
- off += flint_sprintf(str + off, "*%s^%wd", x, i);
+ off += flint_sprintf(str + off, "%s^%wd", x, i);
else
- off += flint_sprintf(str + off, "*%s", x);
+ off += flint_sprintf(str + off, "%s", x);
}
if (!TEMPLATE(T, is_zero) (poly + i, ctx))