diff options
Diffstat (limited to 'src/net/download.cpp')
-rw-r--r-- | src/net/download.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp index 969318b19..5141c022e 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -53,12 +53,12 @@ Download::Download(void *ptr, const std::string &url, mPtr(ptr), mUrl(url), mFileName(""), - mWriteFunction(NULL), + mWriteFunction(nullptr), mAdler(0), mUpdateFunction(updateFunction), - mThread(NULL), - mCurl(NULL), - mHeaders(NULL), + mThread(nullptr), + mCurl(nullptr), + mHeaders(nullptr), mIgnoreError(ignoreError) { mError = static_cast<char*>(calloc(CURL_ERROR_SIZE + 1, 1)); @@ -72,11 +72,11 @@ Download::~Download() if (mHeaders) curl_slist_free_all(mHeaders); - mHeaders = 0; + mHeaders = nullptr; int status; if (mThread && SDL_GetThreadID(mThread)) SDL_WaitThread(mThread, &status); - mThread = 0; + mThread = nullptr; free(mError); } @@ -158,9 +158,9 @@ void Download::cancel() mOptions.cancel = true; if (mThread && SDL_GetThreadID(mThread)) - SDL_WaitThread(mThread, NULL); + SDL_WaitThread(mThread, nullptr); - mThread = NULL; + mThread = nullptr; } char *Download::getError() @@ -204,14 +204,14 @@ int Download::downloadThread(void *ptr) while (attempts < 3 && !complete && !d->mOptions.cancel) { - FILE *file = NULL; + FILE *file = nullptr; d->mUpdateFunction(d->mPtr, DOWNLOAD_STATUS_STARTING, 0, 0); if (d->mOptions.cancel) { //need terminate thread? - d->mThread = NULL; + d->mThread = nullptr; return 0; } @@ -281,7 +281,7 @@ int Download::downloadThread(void *ptr) } curl_easy_cleanup(d->mCurl); - d->mCurl = 0; + d->mCurl = nullptr; if (!d->mOptions.memoryWrite) { @@ -329,13 +329,13 @@ int Download::downloadThread(void *ptr) if (d->mCurl) { curl_easy_cleanup(d->mCurl); - d->mCurl = 0; + d->mCurl = nullptr; } if (d->mOptions.cancel) { //need ternibate thread? - d->mThread = NULL; + d->mThread = nullptr; return 0; } attempts++; @@ -354,7 +354,7 @@ int Download::downloadThread(void *ptr) d->mUpdateFunction(d->mPtr, DOWNLOAD_STATUS_COMPLETE, 0, 0); } - d->mThread = NULL; + d->mThread = nullptr; return 0; } |