diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-03-02 00:24:47 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-03-02 00:24:47 +0100 |
commit | debb40b910e54b2d92a2f0c24920b2c4c9d0eb37 (patch) | |
tree | d756f2661feb210365d416e207ca482214dec03a | |
parent | 7b0e9feee71bf739331d5bd6a4d7a73d163c7370 (diff) | |
download | sciteco-debb40b910e54b2d92a2f0c24920b2c4c9d0eb37.tar.gz |
removed last remaining "throw" specifications
* They are harmful. I removed most of them a long time ago
but kept some for their documenting character.
However, they will always result in additional checks (runtime
penalty) when the corresponding functions get called and cannot ensure that
only the declared exceptions are thrown at compile time.
-rw-r--r-- | src/main.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp index 126e360..ea192db 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,12 +71,9 @@ static gchar *mung_file = NULL; sig_atomic_t sigint_occurred = FALSE; extern "C" { -static gpointer g_malloc_exception(gsize n_bytes) - throw (std::bad_alloc); -static gpointer g_calloc_exception(gsize n_blocks, gsize n_block_bytes) - throw (std::bad_alloc); -static gpointer g_realloc_exception(gpointer mem, gsize n_bytes) - throw (std::bad_alloc); +static gpointer g_malloc_exception(gsize n_bytes); +static gpointer g_calloc_exception(gsize n_blocks, gsize n_block_bytes); +static gpointer g_realloc_exception(gpointer mem, gsize n_bytes); static void sigint_handler(int signal); } @@ -203,7 +200,7 @@ public: }; static gpointer -g_malloc_exception(gsize n_bytes) throw (std::bad_alloc) +g_malloc_exception(gsize n_bytes) { gpointer p = malloc(n_bytes); @@ -213,7 +210,7 @@ g_malloc_exception(gsize n_bytes) throw (std::bad_alloc) } static gpointer -g_calloc_exception(gsize n_blocks, gsize n_block_bytes) throw (std::bad_alloc) +g_calloc_exception(gsize n_blocks, gsize n_block_bytes) { gpointer p = calloc(n_blocks, n_block_bytes); @@ -223,7 +220,7 @@ g_calloc_exception(gsize n_blocks, gsize n_block_bytes) throw (std::bad_alloc) } static gpointer -g_realloc_exception(gpointer mem, gsize n_bytes) throw (std::bad_alloc) +g_realloc_exception(gpointer mem, gsize n_bytes) { gpointer p = realloc(mem, n_bytes); |