JSValueRef Converter::toJSValueRef(const time_t arg)
{
- struct tm *tminfo = localtime(&arg);
+ struct tm *tminfo = NULL;
+ tminfo = localtime_r(&arg, tminfo);
return toJSValueRef(*tminfo);
}
found = false;
for (std::list<JSStringRef>::const_iterator it = allowedJS.begin();
it != allowedJS.end();
- it++)
+ ++it)
{
if (JSStringIsEqual(*it,
JSPropertyNameArrayGetNameAtIndex(jsProps,
namespace WrtDeviceApis {
namespace TizenServiceEvent {
namespace Api {
-TizenServiceEvent::TizenServiceEvent()
+TizenServiceEvent::TizenServiceEvent() :
+ m_scale(0)
{}
TizenServiceEvent::~TizenServiceEvent()
"Node does not exist or access denied.");
}
- if (!S_ISDIR(info.st_mode) & !S_ISREG(info.st_mode)) {
+ if (!S_ISDIR(info.st_mode) && !S_ISREG(info.st_mode)) {
ThrowMsg(Commons::PlatformException,
"Platform node is of unsupported type.");
}
NameList result;
errno = 0;
- struct dirent *entry = NULL;
- while ((entry = readdir(dir))) {
- if (!strncmp(entry->d_name, ".",
- 1) || !strncmp(entry->d_name, "..", 2))
+ int return_code;
+ struct dirent entry;
+ struct dirent *entry_result;
+ for (return_code = readdir_r(dir, &entry, &entry_result);
+ entry_result != NULL && return_code != 0;
+ return_code = readdir_r(dir, &entry, &entry_result)) {
+ if (!strncmp(entry.d_name, ".", 1) ||
+ !strncmp(entry.d_name, "..", 2))
{
continue;
}
- result.push_back(entry->d_name);
+ result.push_back(entry.d_name);
}
- if (errno != 0) {
+ if (return_code != 0 || errno != 0) {
ThrowMsg(Commons::PlatformException, "Error while reading directory.");
}
errno = 0;
NodeList result;
- struct dirent *entry = NULL;
- while ((entry = readdir(dir))) {
- if (!strncmp(entry->d_name, ".",
- 1) || !strncmp(entry->d_name, "..", 2))
+ int return_code;
+ struct dirent entry;
+ struct dirent *entry_result;
+ for (return_code = readdir_r(dir, &entry, &entry_result);
+ entry_result != NULL && return_code != 0;
+ return_code = readdir_r(dir, &entry, &entry_result)) {
+ if (!strncmp(entry.d_name, ".", 1) ||
+ !strncmp(entry.d_name, "..", 2))
{
continue;
}
Try {
Assert(m_path);
- INodePtr node = Node::resolve(*m_path + entry->d_name);
+ INodePtr node = Node::resolve(*m_path + entry.d_name);
node->setPermissions(getPermissions()); // inherit access rights
if (NodeFilterMatcher::match(node, filter)) {
result.push_back(node);
Catch(Commons::PlatformException) {}
}
- if (errno != 0) {
+ if (return_code != 0 || errno != 0) {
ThrowMsg(Commons::PlatformException, "Error while reading directory.");
}
Equals<Properties::key>(DPL::FromUTF8String(key)));
std::list<Properties::Row> rows = select.GetRowList();
- if (rows.size() == 0) {
+ if (rows.empty()) {
Properties::Insert insert(&m_databaseInterface);
Properties::Row row;
row.Set_key(DPL::FromUTF8String(key));
Properties::Select select(&m_databaseInterface);
select.Where(Equals<Properties::key>(DPL::FromUTF8String(key)));
std::list<DPL::String> value = select.GetValueList<Properties::value>();
- if (value.size() == 0) {
+ if (value.empty()) {
return DPL::Optional<std::string>();
}
return DPL::Optional<std::string>(DPL::ToUTF8String(value.front()));
};
JSPageSession::Impl::Impl(const PluginContainerSupportPtr& support) :
- m_sessionStarted(false)
+ m_widgetHandle(0),
+ m_context(NULL),
+ m_sessionStarted(false),
+ m_objectExplorer(NULL)
{
// DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
LogDebug("Initializing Page Session");
return;
}
- struct dirent* libdir;
+ int return_code;
+ struct dirent libdir;
+ struct dirent* result;
std::list<std::string> jsFiles;
// make file list from DIR_PATH
- while ((libdir = readdir(dir)) != 0) {
- if (strncmp(libdir->d_name, ".", 2) == 0 ||
- strncmp(libdir->d_name, "..", 3) == 0)
+ for (return_code = readdir_r(dir, &libdir, &result);
+ result != NULL && return_code != 0;
+ return_code = readdir_r(dir, &libdir, &result)) {
+ if (strncmp(libdir.d_name, ".", 2) == 0 ||
+ strncmp(libdir.d_name, "..", 3) == 0)
{
continue;
}
std::string filepath = DIR_PATH;
filepath += "/";
- filepath += libdir->d_name;
+ filepath += libdir.d_name;
std::string lowercase = filepath;
std::transform(lowercase.begin(), lowercase.end(), lowercase.begin(),
LogInfo("Added : " << filepath);
jsFiles.push_back(filepath);
}
+ if (0 != return_code)
+ LogError("Error while reading directory.");
closedir(dir);
}
LogInfo("Plugin DIRECTORY IS" << PLUGIN_PATH);
- struct dirent* libdir;
+ int return_code;
+ struct dirent libdir;
+ struct dirent* result;
errno = 0;
std::list<std::string> pluginsPaths;
- while ((libdir = readdir(dir)) != 0) {
- if (strcmp(libdir->d_name, ".") == 0 ||
- strcmp(libdir->d_name, "..") == 0)
+ for (return_code = readdir_r(dir, &libdir, &result);
+ result != NULL && return_code != 0;
+ return_code = readdir_r(dir, &libdir, &result)) {
+ if (strcmp(libdir.d_name, ".") == 0 ||
+ strcmp(libdir.d_name, "..") == 0)
{
continue;
}
std::string path = PLUGIN_PATH;
path += "/";
- path += libdir->d_name;
+ path += libdir.d_name;
struct stat tmp;
pluginsPaths.push_back(path);
}
+ if (0 != return_code)
+ LogError("Error while reading directory.");
+
if (-1 == TEMP_FAILURE_RETRY(closedir(dir))) {
LogError("Failed to close dir: " << PLUGIN_PATH);
}
Widget::Api::IWidgetPtr iwidget;
JSObjectRef preferencesObject;
//TEMP
- int widgetId;
+ //int widgetId // TODO: check is it necessary (g.rynkowski)
JSObjectRef widgetObject;
};
typedef std::shared_ptr<WidgetPrivateObject> WidgetPrivateObjectPtr;
const char *resource_type = static_cast <char *>(pdp->resource_name);
Evas_Object *win = NULL;
- Evas_Object *cb_session = NULL;
- Evas_Object *cb_always = NULL;
Evas_Object *box = NULL;
Evas_Object *label = NULL;
Evas_Object *grant_button = NULL;
LogDebug("popup_type == " << pdp->popup_type);
if (pdp->popup_type == ACE_SESSION || pdp->popup_type == ACE_BLANKET) {
LogDebug("popup_type == ACE_SESSION || ACE_BLANKET");
- cb_session = elm_check_add(pdp->popup);
+ Evas_Object *cb_session = elm_check_add(pdp->popup);
elm_object_text_set(cb_session, "Remember choice for this session");
elm_check_state_pointer_set(cb_session, &(pdp->per_session));
evas_object_smart_callback_add(cb_session, "changed", NULL, NULL);
if (pdp->popup_type == ACE_BLANKET) {
LogDebug("popup_type == ACE_BLANKET");
- cb_always = elm_check_add(pdp->popup);
+ Evas_Object *cb_always = elm_check_add(pdp->popup);
elm_object_text_set(cb_always, "Remember choice forever");
elm_check_state_pointer_set(cb_always, &(pdp->always));
evas_object_smart_callback_add(cb_always, "changed", NULL, NULL);
int pipe_in;
int pipe_out;
+ std::stringstream parsing_stream;
// Parsing args (pipe_in, pipe_out)
- if (0 == sscanf(argv[1], "%d", &pipe_in) ) {
+ parsing_stream.str(argv[1]);
+ parsing_stream >> pipe_in;
+ if ( parsing_stream.fail() ) {
LogError("Error while parsing pipe_in; return ACE_INTERNAL_ERROR");
return ACE_INTERNAL_ERROR;
}
- if (0 == sscanf(argv[2], "%d", &pipe_out) ) {
+ parsing_stream.clear();
+ parsing_stream.str(argv[2]);
+ parsing_stream >> pipe_out;
+ if ( parsing_stream.fail() ) {
LogError("Error while parsing pipe_out; return ACE_INTERNAL_ERROR");
return ACE_INTERNAL_ERROR;
}
+ parsing_stream.clear();
LogDebug("Parsed pipes: IN: " << pipe_in << ", OUT: " << pipe_out);
int buff_size = 1024;
int count;
count = TEMP_FAILURE_RETRY(read(fd_send_to_parent[0], result, buff_size));
close(fd_send_to_parent[0]); // cleanup
- int validation_result_int;
+
if (0 < count) {
BinaryStream stream_in;
+ int validation_result_int;
stream_in.Write(count, result);
LogDebug("RESULT FROM POPUP (CHILD) : [ " << count << " ]");
DPL::Deserialization::Deserialize(stream_in, validation_result_int);
namespace Wrt {
namespace Popup {
+InfoPopup::InfoPopup() :
+ m_parent(NULL)
+{}
+
void InfoPopup::show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent)
{
LogDebug("Entered");
class InfoPopup : public IPopup
{
public:
+ InfoPopup();
virtual void show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent);
private:
Impl() :
m_popupsToRender(),
m_current(),
- m_initialized(false)
+ m_initialized(false),
+ m_checkState(false),
+ m_themeIndexV(0),
+ m_externalCanvas(NULL)
{}
~Impl()
namespace Wrt {
namespace Popup {
PopupInvoker::PopupInvoker() :
- m_inputName(tmpnam(NULL)),
- m_outputName(tmpnam(NULL))
+ m_inputName(tmpnam_r(NULL)),
+ m_outputName(tmpnam_r(NULL))
{
Try
{
{
try {
IWidgetDBPtr widget = getWidgetDB(2005);
- std::string tmp = widget->getConfigValue(ConfigAttribute::ID);
+ widget->getConfigValue(ConfigAttribute::ID);
//exception should be thrown
RUNNER_ASSERT(false);