*/
/*
- * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2016 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
std::vector<filedesc> filelist; /**< List of all opened modules */
public:
/**
- * Complete clean-up of opend modules is done on destruction.
+ * Complete clean-up of opened modules is done on destruction.
*/
~excompiler()
{
- for (std::vector<filedesc>::const_iterator it = filelist.begin(); it != filelist.end(); ++it) {
+ for (auto it = filelist.begin(); it != filelist.end(); ++it) {
clean_up(it);
}
}
*/
void* link_so_file(const std::string filename, bool clean_up)
{
- void* module = NULL;
+ void* module = nullptr;
module = dlopen(filename.c_str(), RTLD_NOW);
- if (module == NULL) {
+ if (module == nullptr) {
throw std::runtime_error("excompiler::link_so_file: could not open compiled module!");
}
*/
void unlink(const std::string filename)
{
- for (std::vector<filedesc>::iterator it = filelist.begin(); it != filelist.end();) {
+ for (auto it = filelist.begin(); it != filelist.end();) {
if (it->name == filename) {
clean_up(it);
it = filelist.erase(it);
};
/**
- * This static object manages the modules opened by the complile_ex and link_ex
+ * This static object manages the modules opened by the compile_ex and link_ex
* functions. On program termination its dtor is called and all open modules
* are closed. The associated source and so-files are eventually deleted then
* as well.
void compile_ex(const ex& expr, const symbol& sym, FUNCP_1P& fp, const std::string filename)
{
symbol x("x");
- ex expr_with_x = expr.subs(lst(sym==x));
+ ex expr_with_x = expr.subs(lst{sym==x});
std::ofstream ofs;
std::string unique_filename = filename;
void compile_ex(const ex& expr, const symbol& sym1, const symbol& sym2, FUNCP_2P& fp, const std::string filename)
{
symbol x("x"), y("y");
- ex expr_with_xy = expr.subs(lst(sym1==x, sym2==y));
+ ex expr_with_xy = expr.subs(lst{sym1==x, sym2==y});
std::ofstream ofs;
std::string unique_filename = filename;