Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix warnings, fix crash when ctrl+click opening a save
  • Loading branch information
jacob1 committed Apr 3, 2016
1 parent 0b1ffbc commit 1171c30
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
20 changes: 10 additions & 10 deletions src/client/Client.cpp
Expand Up @@ -1964,7 +1964,7 @@ Json::Value Client::GetPref(Json::Value root, std::string prop, Json::Value defa
{
try
{
int dot = prop.find('.');
size_t dot = prop.find('.');
if (dot == prop.npos)
return root.get(prop, defaultValue);
else
Expand Down Expand Up @@ -2042,7 +2042,7 @@ std::vector<std::string> Client::GetPrefStringArray(std::string prop)
{
std::vector<std::string> ret;
Json::Value arr = GetPref(preferences, prop);
for (int i = 0; i < arr.size(); i++)
for (int i = 0; i < (int)arr.size(); i++)
ret.push_back(arr[i].asString());
return ret;
}
Expand All @@ -2059,7 +2059,7 @@ std::vector<double> Client::GetPrefNumberArray(std::string prop)
{
std::vector<double> ret;
Json::Value arr = GetPref(preferences, prop);
for (int i = 0; i < arr.size(); i++)
for (int i = 0; i < (int)arr.size(); i++)
ret.push_back(arr[i].asDouble());
return ret;
}
Expand All @@ -2076,7 +2076,7 @@ std::vector<int> Client::GetPrefIntegerArray(std::string prop)
{
std::vector<int> ret;
Json::Value arr = GetPref(preferences, prop);
for (int i = 0; i < arr.size(); i++)
for (int i = 0; i < (int)arr.size(); i++)
ret.push_back(arr[i].asInt());
return ret;
}
Expand All @@ -2093,7 +2093,7 @@ std::vector<unsigned int> Client::GetPrefUIntegerArray(std::string prop)
{
std::vector<unsigned int> ret;
Json::Value arr = GetPref(preferences, prop);
for (int i = 0; i < arr.size(); i++)
for (int i = 0; i < (int)arr.size(); i++)
ret.push_back(arr[i].asUInt());
return ret;
}
Expand All @@ -2110,7 +2110,7 @@ std::vector<bool> Client::GetPrefBoolArray(std::string prop)
{
std::vector<bool> ret;
Json::Value arr = GetPref(preferences, prop);
for (int i = 0; i < arr.size(); i++)
for (int i = 0; i < (int)arr.size(); i++)
ret.push_back(arr[i].asBool());
return ret;
}
Expand All @@ -2128,7 +2128,7 @@ std::vector<bool> Client::GetPrefBoolArray(std::string prop)
// and return it to SetPref to do the actual setting
Json::Value Client::SetPrefHelper(Json::Value root, std::string prop, Json::Value value)
{
int dot = prop.find(".");
size_t dot = prop.find(".");
if (dot == prop.npos)
root[prop] = value;
else
Expand All @@ -2144,7 +2144,7 @@ void Client::SetPref(std::string prop, Json::Value value)
{
try
{
int dot = prop.find(".");
size_t dot = prop.find(".");
if (dot == prop.npos)
preferences[prop] = value;
else
Expand All @@ -2163,7 +2163,7 @@ void Client::SetPref(std::string prop, std::vector<Json::Value> value)
try
{
Json::Value arr;
for (int i = 0; i < value.size(); i++)
for (int i = 0; i < (int)value.size(); i++)
{
arr.append(value[i]);
}
Expand All @@ -2173,4 +2173,4 @@ void Client::SetPref(std::string prop, std::vector<Json::Value> value)
{

}
}
}
8 changes: 4 additions & 4 deletions src/client/Download.cpp
Expand Up @@ -9,13 +9,13 @@ Download::Download(std::string uri_, bool keepAlive):
downloadData(NULL),
downloadSize(0),
downloadStatus(0),
downloadFinished(false),
downloadCanceled(false),
downloadStarted(false),
postData(""),
postDataBoundary(""),
userID(""),
userSession("")
userSession(""),
downloadFinished(false),
downloadCanceled(false),
downloadStarted(false)
{
uri = std::string(uri_);
DownloadManager::Ref().AddDownload(this);
Expand Down
6 changes: 3 additions & 3 deletions src/client/DownloadManager.cpp
Expand Up @@ -9,8 +9,8 @@ DownloadManager::DownloadManager():
lastUsed(time(NULL)),
managerRunning(false),
managerShutdown(false),
downloads(NULL),
downloadsAddQueue(NULL)
downloads(std::vector<Download*>()),
downloadsAddQueue(std::vector<Download*>())
{
pthread_mutex_init(&downloadLock, NULL);
pthread_mutex_init(&downloadAddLock, NULL);
Expand Down Expand Up @@ -142,4 +142,4 @@ void DownloadManager::Lock()
void DownloadManager::Unlock()
{
pthread_mutex_unlock(&downloadAddLock);
}
}
2 changes: 1 addition & 1 deletion src/client/HTTP.h
Expand Up @@ -24,7 +24,7 @@
#include <string>

static const char hexChars[] = "0123456789abcdef";
static long http_timeout = 15;
static const long http_timeout = 15;

void http_init(char *proxy);
void http_done(void);
Expand Down
2 changes: 2 additions & 0 deletions src/gui/preview/PreviewModel.cpp
Expand Up @@ -12,6 +12,8 @@ PreviewModel::PreviewModel():
saveInfo(NULL),
saveData(NULL),
saveComments(NULL),
saveDataDownload(NULL),
commentsDownload(NULL),
commentBoxEnabled(false),
commentsLoaded(false),
commentsTotal(0),
Expand Down

0 comments on commit 1171c30

Please sign in to comment.