]> www.ginac.de Git - ginac.git/blobdiff - ginac/excompiler.cpp
Fix some apparent typos and misindentations.
[ginac.git] / ginac / excompiler.cpp
index bc076945e77122aa499279324f2e2db533d3609e..d7897c014e92827374ebcc70d0ff11f86dc01e45 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 /*
- *  GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2015 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
 
 #include "excompiler.h"
 
-#include <stdexcept>
-#include <ios>
-#include <fstream>
-#include <sstream>
-#include <string>
-#include <vector>
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#ifdef HAVE_LIBDL
-#include <dlfcn.h>
-#endif // def HAVE_LIBDL
-
 #include "ex.h"
 #include "lst.h"
 #include "operators.h"
 #include "relational.h"
 #include "symbol.h"
 
+#ifdef HAVE_LIBDL
+#include <dlfcn.h>
+#endif // def HAVE_LIBDL
+#include <fstream>
+#include <ios>
+#include <sstream>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
 namespace GiNaC {
 
 #ifdef HAVE_LIBDL
@@ -73,7 +72,7 @@ class excompiler
        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()
        {
@@ -114,12 +113,12 @@ public:
                        char* new_filename = new char[strlen(filename_pattern)+1];
                        strcpy(new_filename, filename_pattern);
                        if (!mktemp(new_filename)) {
-                               delete new_filename;
+                               delete[] new_filename;
                                throw std::runtime_error("mktemp failed");
                        }
                        filename = std::string(new_filename);
                        ofs.open(new_filename, std::ios::out);
-                       delete new_filename;
+                       delete[] new_filename;
                } else {
                        // use parameter as filename
                        ofs.open(filename.c_str(), std::ios::out);
@@ -173,7 +172,7 @@ public:
                for (std::vector<filedesc>::iterator it = filelist.begin(); it != filelist.end();) {
                        if (it->name == filename) {
                                clean_up(it);
-                               filelist.erase(it);
+                               it = filelist.erase(it);
                        } else {
                                ++it;
                        }
@@ -182,7 +181,7 @@ public:
 };
 
 /**
- * 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.