mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-13 04:36:59 +00:00
UI: fix Curl deprecation warnings (#1724)
This commit is contained in:
parent
5390f9338c
commit
f5b19278d1
2 changed files with 5 additions and 3 deletions
|
|
@ -28,7 +28,7 @@ size_t DownloadGraphicPacksWindow::curlDownloadFile_writeData(void *ptr, size_t
|
||||||
return writeSize;
|
return writeSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DownloadGraphicPacksWindow::progress_callback(curlDownloadFileState_t* downloadState, double dltotal, double dlnow, double ultotal, double ulnow)
|
int DownloadGraphicPacksWindow::progress_callback(curlDownloadFileState_t* downloadState, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)
|
||||||
{
|
{
|
||||||
if (dltotal > 1.0)
|
if (dltotal > 1.0)
|
||||||
downloadState->progress = dlnow / dltotal;
|
downloadState->progress = dlnow / dltotal;
|
||||||
|
|
@ -47,7 +47,7 @@ bool DownloadGraphicPacksWindow::curlDownloadFile(const char *url, curlDownloadF
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlDownloadFile_writeData);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlDownloadFile_writeData);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, downloadState);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, downloadState);
|
||||||
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
|
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback);
|
||||||
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, downloadState);
|
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, downloadState);
|
||||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
|
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
|
||||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true);
|
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true);
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <curl/system.h>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include <wx/dialog.h>
|
||||||
#include <wx/timer.h>
|
#include <wx/timer.h>
|
||||||
#include <wx/gauge.h>
|
#include <wx/gauge.h>
|
||||||
|
|
||||||
|
|
@ -55,6 +57,6 @@ private:
|
||||||
std::unique_ptr<curlDownloadFileState_t> m_downloadState;
|
std::unique_ptr<curlDownloadFileState_t> m_downloadState;
|
||||||
|
|
||||||
static size_t curlDownloadFile_writeData(void* ptr, size_t size, size_t nmemb, curlDownloadFileState_t* downloadState);
|
static size_t curlDownloadFile_writeData(void* ptr, size_t size, size_t nmemb, curlDownloadFileState_t* downloadState);
|
||||||
static int progress_callback(curlDownloadFileState_t* downloadState, double dltotal, double dlnow, double ultotal, double ulnow);
|
static int progress_callback(curlDownloadFileState_t* downloadState, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow);
|
||||||
static bool curlDownloadFile(const char* url, curlDownloadFileState_t* downloadState);
|
static bool curlDownloadFile(const char* url, curlDownloadFileState_t* downloadState);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue