From 85be3c923308222f701330d541bb359c07e6f1b0 Mon Sep 17 00:00:00 2001 From: "Martin R. Albrecht" Date: Fri, 4 Aug 2023 16:47:51 +0100 Subject: [PATCH] fix Cython complaints (#247) * fix Cython complaints * trigger tests again --- src/fpylll/fplll/enumeration.pyx | 2 +- src/fpylll/fplll/enumeration_callback_helper.h | 4 ++-- src/fpylll/fplll/fplll.pxd | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/fpylll/fplll/enumeration.pyx b/src/fpylll/fplll/enumeration.pyx index efa0a90c..c14c4d61 100644 --- a/src/fpylll/fplll/enumeration.pyx +++ b/src/fpylll/fplll/enumeration.pyx @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- include "fpylll/config.pxi" - + from cython.operator cimport dereference as deref, preincrement as inc from libcpp.vector cimport vector diff --git a/src/fpylll/fplll/enumeration_callback_helper.h b/src/fpylll/fplll/enumeration_callback_helper.h index c0994300..6fe7914e 100644 --- a/src/fpylll/fplll/enumeration_callback_helper.h +++ b/src/fpylll/fplll/enumeration_callback_helper.h @@ -5,9 +5,9 @@ #include #include -extern "C" { +//extern "C" { bool evaluator_callback_call_obj(PyObject *obj, int n, double *new_sol_coord); -} +//} class PyCallbackEvaluatorWrapper { public: diff --git a/src/fpylll/fplll/fplll.pxd b/src/fpylll/fplll/fplll.pxd index 4b5207ec..c5b7b1d7 100644 --- a/src/fpylll/fplll/fplll.pxd +++ b/src/fpylll/fplll/fplll.pxd @@ -844,7 +844,7 @@ cdef extern from "fplll/bkz_param.h" namespace "fplll": string dump_gso_filename - vector[Strategy] load_strategies_json(const string &filename) nogil except+ + vector[Strategy] load_strategies_json(const string &filename) except + nogil const string default_strategy_path() nogil const string default_strategy() nogil const string strategy_full_path(const string &strategy_path) nogil @@ -859,19 +859,19 @@ cdef extern from "fplll/bkz.h" namespace "fplll": int svp_preprocessing(int kappa, int block_size, const BKZParam ¶m) nogil int svp_postprocessing(int kappa, int block_size, const vector[FT] &solution) nogil - int svp_reduction(int kappa, int block_size, const BKZParam ¶m, int dual) nogil except + + int svp_reduction(int kappa, int block_size, const BKZParam ¶m, int dual) except + nogil - int tour(const int loop, int &kappa_max, const BKZParam ¶m, int min_row, int max_row) nogil except + - int sd_tour(const int loop, const BKZParam ¶m, int min_row, int max_row) nogil except + - int slide_tour(const int loop, const BKZParam ¶m, int min_row, int max_row) nogil except + + int tour(const int loop, int &kappa_max, const BKZParam ¶m, int min_row, int max_row) except + nogil + int sd_tour(const int loop, const BKZParam ¶m, int min_row, int max_row) except + nogil + int slide_tour(const int loop, const BKZParam ¶m, int min_row, int max_row) except + nogil - int hkz(int &kappaMax, const BKZParam ¶m, int min_row, int max_row) nogil except + + int hkz(int &kappaMax, const BKZParam ¶m, int min_row, int max_row) except + nogil int bkz() - void rerandomize_block(int min_row, int max_row, int density) nogil except + + void rerandomize_block(int min_row, int max_row, int density) except + nogil - void dump_gso(const string filename, const string prefix, int append) nogil except + + void dump_gso(const string filename, const string prefix, int append) except + nogil int status