summaryrefslogtreecommitdiff
path: root/src/net/download.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-11-13 04:57:16 +0300
committerAndrei Karas <akaras@inbox.ru>2011-11-13 04:57:16 +0300
commit4d453108f45f9fb2ff4f5715cc1b3ddd63d36a80 (patch)
treec1edb8d8b368fdd43cd8639e6044b0f4e8dde70a /src/net/download.cpp
parentece00592ecd93f7a96db0ca82589d00846e2f938 (diff)
parentd471e99fd38ac589a8a9e8e8677b9f577f0cc5c6 (diff)
downloadmanaverse-stripped1.1.11.12.tar.gz
manaverse-stripped1.1.11.12.tar.bz2
manaverse-stripped1.1.11.12.tar.xz
manaverse-stripped1.1.11.12.zip
Merge branch 'master' into strippedstripped1.1.11.12
Conflicts: data/fonts/mplus-1p-bold.ttf data/fonts/mplus-1p-regular.ttf src/guichan/basiccontainer.cpp src/guichan/focushandler.cpp src/guichan/graphics.cpp src/guichan/gui.cpp src/guichan/image.cpp src/guichan/include/guichan/widgets/checkbox.hpp src/guichan/include/guichan/widgets/dropdown.hpp src/guichan/sdl/sdlgraphics.cpp src/guichan/sdl/sdlimage.cpp src/guichan/widget.cpp src/guichan/widgets/dropdown.cpp src/guichan/widgets/icon.cpp src/guichan/widgets/imagebutton.cpp src/guichan/widgets/listbox.cpp src/guichan/widgets/scrollarea.cpp src/guichan/widgets/tab.cpp src/guichan/widgets/tabbedarea.cpp src/guichan/widgets/textbox.cpp src/guichan/widgets/window.cpp
Diffstat (limited to 'src/net/download.cpp')
-rw-r--r--src/net/download.cpp28
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;
}