summaryrefslogtreecommitdiff
path: root/src/base/exception.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/exception.cpp')
-rw-r--r--src/base/exception.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/base/exception.cpp b/src/base/exception.cpp
index 2a8dc8d10..cddef79fd 100644
--- a/src/base/exception.cpp
+++ b/src/base/exception.cpp
@@ -28,24 +28,24 @@ using namespace std;
namespace CVC4 {
-thread_local LastExceptionBuffer* LastExceptionBuffer::s_currentBuffer = NULL;
+thread_local LastExceptionBuffer* LastExceptionBuffer::s_currentBuffer = nullptr;
-LastExceptionBuffer::LastExceptionBuffer() : d_contents(NULL) {}
+LastExceptionBuffer::LastExceptionBuffer() : d_contents(nullptr) {}
LastExceptionBuffer::~LastExceptionBuffer() {
- if(d_contents != NULL){
+ if(d_contents != nullptr){
free(d_contents);
- d_contents = NULL;
+ d_contents = nullptr;
}
}
void LastExceptionBuffer::setContents(const char* string) {
- if(d_contents != NULL){
+ if(d_contents != nullptr){
free(d_contents);
- d_contents = NULL;
+ d_contents = nullptr;
}
- if(string != NULL){
+ if(string != nullptr){
d_contents = strdup(string);
}
}
@@ -61,7 +61,7 @@ std::string IllegalArgumentException::formatVariadic(const char* format, ...) {
va_start(args, format);
int n = 512;
- char* buf = NULL;
+ char* buf = nullptr;
for (int i = 0; i < 2; ++i){
Assert(n > 0);
@@ -80,9 +80,9 @@ std::string IllegalArgumentException::formatVariadic(const char* format, ...) {
break;
}
}
- // buf is not NULL is an invariant.
+ // buf is not nullptr is an invariant.
// buf is also 0 terminated.
- Assert(buf != NULL);
+ Assert(buf != nullptr);
std::string result(buf);
delete [] buf;
va_end(args);
@@ -107,7 +107,7 @@ void IllegalArgumentException::construct(const char* header, const char* extra,
buf = new char[n];
int size;
- if(extra == NULL) {
+ if(extra == nullptr) {
size = snprintf(buf, n, "%s\n%s\n%s",
header, function, tail);
} else {
@@ -129,8 +129,8 @@ void IllegalArgumentException::construct(const char* header, const char* extra,
#ifdef CVC4_DEBUG
LastExceptionBuffer* buffer = LastExceptionBuffer::getCurrent();
- if(buffer != NULL){
- if(buffer->getContents() == NULL) {
+ if(buffer != nullptr){
+ if(buffer->getContents() == nullptr) {
buffer->setContents(buf);
}
}
@@ -149,7 +149,7 @@ void IllegalArgumentException::construct(const char* header, const char* extra,
buf = new char[n];
int size;
- if(extra == NULL) {
+ if(extra == nullptr) {
size = snprintf(buf, n, "%s.\n%s\n",
header, function);
} else {
@@ -170,8 +170,8 @@ void IllegalArgumentException::construct(const char* header, const char* extra,
#ifdef CVC4_DEBUG
LastExceptionBuffer* buffer = LastExceptionBuffer::getCurrent();
- if(buffer != NULL){
- if(buffer->getContents() == NULL) {
+ if(buffer != nullptr){
+ if(buffer->getContents() == nullptr) {
buffer->setContents(buf);
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback