some inits

This commit is contained in:
Jacek Jendrzej
2017-01-30 17:22:41 +01:00
parent 6a3778ba93
commit f4f351e9ba
6 changed files with 13 additions and 12 deletions

View File

@@ -386,6 +386,7 @@ CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_p
void CComponentsChannelLogo::init(const uint64_t& channelId, const std::string& channelName, bool allow_scale) void CComponentsChannelLogo::init(const uint64_t& channelId, const std::string& channelName, bool allow_scale)
{ {
channel_name = "";
alt_pic_name = ""; alt_pic_name = "";
setChannel(channelId, channelName); setChannel(channelId, channelName);
do_scale = allow_scale; do_scale = allow_scale;

View File

@@ -178,7 +178,7 @@ Example:
CLuaCurl *D = CurlCheckData(L, 1); CLuaCurl *D = CurlCheckData(L, 1);
if (!D) return 0; if (!D) return 0;
char errMsg[1024]; char errMsg[1024]={0};
CURL *curl_handle = curl_easy_init(); CURL *curl_handle = curl_easy_init();
if (!curl_handle) { if (!curl_handle) {
memset(errMsg, '\0', sizeof(errMsg)); memset(errMsg, '\0', sizeof(errMsg));
@@ -309,7 +309,7 @@ Example:
#endif #endif
} }
char cerror[CURL_ERROR_SIZE]; char cerror[CURL_ERROR_SIZE]={0};
curl_easy_setopt(curl_handle, CURLOPT_ERRORBUFFER, cerror); curl_easy_setopt(curl_handle, CURLOPT_ERRORBUFFER, cerror);
printf("\n[curl:download] download %s => %s\n", url.c_str(), (toFile)?outputfile.c_str():"return string"); printf("\n[curl:download] download %s => %s\n", url.c_str(), (toFile)?outputfile.c_str():"return string");
@@ -330,7 +330,7 @@ Example:
CURLcode res1 = curl_easy_getinfo(curl_handle, CURLINFO_EFFECTIVE_URL, &deffektive); CURLcode res1 = curl_easy_getinfo(curl_handle, CURLINFO_EFFECTIVE_URL, &deffektive);
CURLcode res2 = curl_easy_getinfo(curl_handle, CURLINFO_REDIRECT_URL, &dredirect); CURLcode res2 = curl_easy_getinfo(curl_handle, CURLINFO_REDIRECT_URL, &dredirect);
char msg1[1024]; char msg1[1024]={0};
memset(msg1, '\0', sizeof(msg1)); memset(msg1, '\0', sizeof(msg1));
snprintf(msg1, sizeof(msg1)-1, "\n[curl:download] O.K. size: %.0f bytes, time: %.02f sec.", dsize, dtime); snprintf(msg1, sizeof(msg1)-1, "\n[curl:download] O.K. size: %.0f bytes, time: %.02f sec.", dsize, dtime);
msg = msg1; msg = msg1;

View File

@@ -62,7 +62,7 @@ class CLuaMenuForwarder : public CMenuTarget
std::string luaId; std::string luaId;
CLuaMenuForwarder(lua_State *L, std::string _luaAction, std::string _luaId); CLuaMenuForwarder(lua_State *L, std::string _luaAction, std::string _luaId);
~CLuaMenuForwarder(); ~CLuaMenuForwarder();
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget* parent=NULL, const std::string & actionKey="");
}; };
class CLuaMenuFilebrowser : public CLuaMenuForwarder class CLuaMenuFilebrowser : public CLuaMenuForwarder
@@ -74,7 +74,7 @@ class CLuaMenuFilebrowser : public CLuaMenuForwarder
void Init(std::string *_value, bool _dirMode); void Init(std::string *_value, bool _dirMode);
public: public:
CLuaMenuFilebrowser(lua_State *_L, std::string _luaAction, std::string _luaId, std::string *_value, bool _dirMode); CLuaMenuFilebrowser(lua_State *_L, std::string _luaAction, std::string _luaId, std::string *_value, bool _dirMode);
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget* parent=NULL, const std::string & actionKey="");
void addFilter(std::string s) { filter.push_back(s); }; void addFilter(std::string s) { filter.push_back(s); };
}; };
@@ -91,7 +91,7 @@ class CLuaMenuStringinput : public CLuaMenuForwarder
void Init(const char *_name, std::string *_value, int _size, std::string _valid_chars, CChangeObserver *_observ, const char *_icon, bool _sms); void Init(const char *_name, std::string *_value, int _size, std::string _valid_chars, CChangeObserver *_observ, const char *_icon, bool _sms);
public: public:
CLuaMenuStringinput(lua_State *_L, std::string _luaAction, std::string _luaId, const char *_name, std::string *_value, int _size, std::string _valid_chars, CChangeObserver *_observ, const char *_icon, bool _sms); CLuaMenuStringinput(lua_State *_L, std::string _luaAction, std::string _luaId, const char *_name, std::string *_value, int _size, std::string _valid_chars, CChangeObserver *_observ, const char *_icon, bool _sms);
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget* parent=NULL, const std::string & actionKey="");
}; };
class CLuaMenuKeyboardinput : public CLuaMenuForwarder class CLuaMenuKeyboardinput : public CLuaMenuForwarder
@@ -106,7 +106,7 @@ class CLuaMenuKeyboardinput : public CLuaMenuForwarder
void Init(const char *_name, std::string *_value, int _size, CChangeObserver *_observ, const char *_icon, std::string _help, std::string _help2); void Init(const char *_name, std::string *_value, int _size, CChangeObserver *_observ, const char *_icon, std::string _help, std::string _help2);
public: public:
CLuaMenuKeyboardinput(lua_State *_L, std::string _luaAction, std::string _luaId, const char *_name, std::string *_value, int _size, CChangeObserver *_observ, const char *_icon, std::string _help, std::string _help2); CLuaMenuKeyboardinput(lua_State *_L, std::string _luaAction, std::string _luaId, const char *_name, std::string *_value, int _size, CChangeObserver *_observ, const char *_icon, std::string _help, std::string _help2);
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget* parent=NULL, const std::string & actionKey="");
}; };
class CLuaInstMenu class CLuaInstMenu

View File

@@ -128,7 +128,7 @@ bool cTmdb::getUrl(std::string &url, std::string &answer, CURL *_curl_handle)
} }
} }
char cerror[CURL_ERROR_SIZE]; char cerror[CURL_ERROR_SIZE] = {0};
curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror); curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror);
printf("try to get [%s] ...\n", url.c_str()); printf("try to get [%s] ...\n", url.c_str());
@@ -169,7 +169,7 @@ bool cTmdb::DownloadUrl(std::string url, std::string file, CURL *_curl_handle)
} }
} }
char cerror[CURL_ERROR_SIZE]; char cerror[CURL_ERROR_SIZE] = {0};
curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror); curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror);
printf("try to get [%s] ...\n", url.c_str()); printf("try to get [%s] ...\n", url.c_str());

View File

@@ -148,7 +148,7 @@ bool cYTCache::download(MI_MOVIE_INFO *mi)
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, (long)0); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, (long)0);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
char cerror[CURL_ERROR_SIZE]; char cerror[CURL_ERROR_SIZE] = {0};
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, cerror); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, cerror);
if(!g_settings.softupdate_proxyserver.empty()) { if(!g_settings.softupdate_proxyserver.empty()) {

View File

@@ -151,7 +151,7 @@ bool cYTFeedParser::getUrl(std::string &url, std::string &answer, CURL *_curl_ha
} }
} }
char cerror[CURL_ERROR_SIZE]; char cerror[CURL_ERROR_SIZE] = {0};
curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror); curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror);
printf("try to get [%s] ...\n", url.c_str()); printf("try to get [%s] ...\n", url.c_str());
@@ -192,7 +192,7 @@ bool cYTFeedParser::DownloadUrl(std::string &url, std::string &file, CURL *_curl
} }
} }
char cerror[CURL_ERROR_SIZE]; char cerror[CURL_ERROR_SIZE] = {0};
curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror); curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror);
printf("try to get [%s] ...\n", url.c_str()); printf("try to get [%s] ...\n", url.c_str());