m_progress_overall = static_cast<double>(m_overall_decompressed + m_files_extracted) /
static_cast<double>(m_expected_decompressed_size + m_files_to_extract);
- LoggerD("%s of %s - %f%% (%d/%d files)", bytesToReadableString(m_overall_decompressed).c_str(),
+ LoggerD("%s of %s - %f%% (%lu/%lu files)", bytesToReadableString(m_overall_decompressed).c_str(),
bytesToReadableString(m_expected_decompressed_size).c_str(), m_progress_overall * 100.0,
m_files_extracted, m_files_to_extract);
}
std::string fm_str;
PlatformResult result = fileModeToString(archive_file->getFileMode(), &fm_str);
if (result.error_code() != ErrorCode::NO_ERROR) {
- LoggerE("%s (%d)", result.message().c_str(), result.error_code());
+ LoggerE("%s (%d)", result.message().c_str(), static_cast<int>(result.error_code()));
delete callback;
callback = NULL;
return false;
delete callback;
callback = NULL;
} else if (ErrorCode::NO_ERROR != result.error_code()) {
- LoggerE("taskManagerThread fails, %d: %s", result.error_code(), result.message().c_str());
+ LoggerE("taskManagerThread fails, %d: %s", static_cast<int>(result.error_code()), result.message().c_str());
callback->setError(result.error_code(), result.message().c_str());
if (!g_idle_add(callErrorCallback, static_cast<void*>(callback))) {
LoggerE("g_idle_add fails");
void ArchiveInstance::PostError(const PlatformResult& e, double callback_id) {
LoggerD("Entered");
- LoggerE("Posting an error: %d, message: %s", e.error_code(), e.message().c_str());
+ LoggerE("Posting an error: %d, message: %s", static_cast<int>(e.error_code()), e.message().c_str());
picojson::value val = picojson::value(picojson::object());
picojson::object& obj = val.get<picojson::object>();
}
}
- if ((!S_ISDIR(info.st_mode)) & (!S_ISREG(info.st_mode)) && !S_ISLNK(info.st_mode)) {
+ if ((!S_ISDIR(info.st_mode)) && (!S_ISREG(info.st_mode)) && !S_ISLNK(info.st_mode)) {
SLoggerE("File: [%s]", path->getFullPath().c_str());
return LogAndCreateResult(ErrorCode::IO_ERR, "Platform node is of unsupported type.");
}
platform_result = removeAsFile(subPath);
}
if (platform_result.error_code() != ErrorCode::NO_ERROR) {
- LoggerE("Fail: getFullPath() (%d)", platform_result.error_code());
+ LoggerE("Fail: getFullPath() (%d)", static_cast<int>(platform_result.error_code()));
closedir(dir);
return platform_result;
}
("ret: %d", err));
}
- LoggerD("file: %s | unc size: %d | comp size: %d", filename_inzip, file_info.uncompressed_size,
+ LoggerD("file: %s | unc size: %lu | comp size: %lu", filename_inzip, file_info.uncompressed_size,
file_info.compressed_size);
ArchiveFileEntryPtr entry = ArchiveFileEntryPtr(new ArchiveFileEntry());
bytesToReadableString(astats.uncompressed_size).c_str());
callback->setNumberOfFilesToExtract(astats.number_of_files);
- LoggerD("Number entries to extract: files: %d folders: %d", astats.number_of_files,
+ LoggerD("Number entries to extract: files: %lu folders: %lu", astats.number_of_files,
astats.number_of_folders);
return PlatformResult(ErrorCode::NO_ERROR);
m_output_filepath = removeDuplicatedSlashesFromPath(m_extract_path + "/" + file_path);
- LoggerD("Packed: [%s], uncompressed_size: %d, will extract to: [%s]", m_filename_inzip,
+ LoggerD("Packed: [%s], uncompressed_size: %lu, will extract to: [%s]", m_filename_inzip,
m_file_info.uncompressed_size, m_output_filepath.c_str());
std::string path, name;
bool marked_as_finished = false;
- LoggerD("Started extracting: [%s] uncompressed size: %d - %s", m_filename_inzip,
+ LoggerD("Started extracting: [%s] uncompressed size: %lu - %s", m_filename_inzip,
m_file_info.uncompressed_size,
bytesToReadableString(m_file_info.uncompressed_size).c_str());
bytesToReadableString(size).c_str());
}
- LoggerD("m_files_to_compress: %d", m_files_to_compress);
+ LoggerD("m_files_to_compress: %lu", m_files_to_compress);
LoggerD("m_bytes_to_compress: %llu (%s)", m_bytes_to_compress,
bytesToReadableString(m_bytes_to_compress).c_str());
LoggerD("m_bytes_compressed:%llu / m_bytes_to_compress: %llu", m_bytes_compressed,
m_bytes_to_compress);
- LoggerD("m_files_compressed:%d / m_files_to_compress: %d", m_files_compressed,
+ LoggerD("m_files_compressed: %lu / m_files_to_compress: %lu", m_files_compressed,
m_files_to_compress);
if (src_file_node->getType() == filesystem::NT_FILE) {
LoggerD(
"Callculatting overall progress: %llu/%llu bytes; "
- "%d/%d files; current file: [%s] progress: %d/%d bytes; ",
+ "%lu/%lu files; current file: [%s] progress: %d/%d bytes; ",
m_bytes_compressed, m_bytes_to_compress, m_files_compressed, m_files_to_compress,
src_file_path.c_str(), total_bytes_read, in_file_size);
static_cast<double>(m_bytes_to_compress + m_files_to_compress);
}
- LoggerD("Wrote: %s total progress: %.2f%% %d/%d files",
+ LoggerD("Wrote: %s total progress: %.2f%% %lu/%lu files",
bytesToReadableString(size_read).c_str(), progress * 100.0, m_files_compressed,
m_files_to_compress);
m_signal_iface.c_str());
const gchar* unique_name = g_dbus_connection_get_unique_name(m_conn.getDBus());
- LoggerD("Generated unique name: %d", unique_name);
+ LoggerD("Generated unique name: %s", unique_name);
// path and interface are not obligatory to receive, but
// they should be set to send the signals.
}
void ParsedInstance::HandleError(const PlatformResult& e) {
- LoggerE("Error: %s", static_cast<int>(e.error_code()));
+ LoggerE("Error: %d", static_cast<int>(e.error_code()));
picojson::value result = picojson::value(picojson::object());
ReportError(e, &result.get<picojson::object>());
SendSyncReply(result.serialize().c_str());
break;
default:
name_ = "unknown";
- LoggerE("Unknown storage type: %d", type);
+ LoggerE("Unknown storage type: %d", static_cast<int>(type));
break;
}
name_ += std::to_string(id);
case StorageType::kMmc:
return "EXTERNAL";
default:
- LoggerE("Unknown storage type: %d", type);
+ LoggerE("Unknown storage type: %d", static_cast<int>(type));
return "UNKNOWN";
}
}
case StorageState::kMounted:
return "MOUNTED";
default:
- LoggerE("Unknown storage state: %d", state);
+ LoggerE("Unknown storage state: %d", static_cast<int>(state));
return "UNKNOWN";
}
}
} else if (str == "EXISTS") {
*filter_match_flag = AttributeMatchFlag::kExists;
} else {
- LoggerE("Invalid attribute match string: %i", str.c_str());
+ LoggerE("Invalid attribute match string: %s", str.c_str());
return PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid attribute match string!");
}
} else if (str == "INTERSECTION") {
*comp_filter_type = CompositeFilterType::kIntersection;
} else {
- LoggerE("Invalid composite type string: %i", str.c_str());
+ LoggerE("Invalid composite type string: %s", str.c_str());
return PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid composite type string!");
}
LoggerD("Enter");
if (ErrorCode::NO_ERROR != error_code) {
- LoggerE("PlatformResult: %d, message: %s", error_code, message.c_str());
+ LoggerE("PlatformResult: %d, message: %s", static_cast<int>(error_code), message.c_str());
}
}
}
void ReportError(const PlatformResult& error, picojson::object* out) {
- LoggerE("PlatformResult: %d, message: %s", error.error_code(), error.message().c_str());
+ LoggerE("PlatformResult: %d, message: %s", static_cast<int>(error.error_code()), error.message().c_str());
out->insert(std::make_pair("status", picojson::value("error")));
out->insert(std::make_pair("error", error.ToJSON()));
}
break;
}
default: {
- LoggerE("%th column is undefined column type", columnIndex);
+ LoggerE("%d column is undefined column type", columnIndex);
return false;
}
}
out["receivedSize"] = picojson::value(static_cast<double>(downCbPtr->received));
out["totalSize"] = picojson::value(static_cast<double>(diPtr->file_size));
- LoggerD("OnProgressChanged for callbackId %d Called: Received: %ld", downCbPtr->callbackId,
+ LoggerD("OnProgressChanged for callbackId %d Called: Received: %llu", downCbPtr->callbackId,
downCbPtr->received);
picojson::value v = picojson::value(out);
}
GCSPosition GCSPosition::createFromDouble(double value) {
- LoggerD("Entered value:%f");
+ LoggerD("Entered value:%f", value);
if (value < 0) {
LoggerW("Trying to create GCSPosition with double < 0: %f", value);
return GCSPosition();
AssertMsg(exif_data, "exif_data is NULL");
if (isSet(EXIF_INFORMATION_ATTRIBUTE_WIDTH)) {
- LoggerD("Saving width: %d", getWidth());
+ LoggerD("Saving width: %lu", getWidth());
ret = ExifTagSaver::saveToExif(getWidth(), EXIF_TAG_IMAGE_WIDTH, exif_data);
if (!ret) {
return ret;
}
}
if (isSet(EXIF_INFORMATION_ATTRIBUTE_HEIGHT)) {
- LoggerD("Saving height: %d", getHeight());
+ LoggerD("Saving height: %lu", getHeight());
ret = ExifTagSaver::saveToExif(getHeight(), EXIF_TAG_IMAGE_LENGTH, exif_data);
if (!ret) {
return ret;
break;
default:
- LoggerE("output ExifFormat: %d is not supported!");
+ LoggerE("output ExifFormat: %d is not supported!", format);
return 0;
}
if (read_bytes != m_in_data_size) {
return LogAndCreateResult(
ErrorCode::UNKNOWN_ERR, "Could not read JPEG file",
- ("Couldn't read all: %d bytes. Read only: %d bytes!", m_in_data_size, read_bytes));
+ ("Couldn't read all: %d bytes. Read only: %u bytes!", m_in_data_size, read_bytes));
}
if (fclose(m_in_file) == EOF) {
m_padding_data_size = 0;
for (size_t offset = 0, iterration = 0; offset < m_in_data_size; ++iterration) {
- LoggerD("offset:%d | Starting iteration: %d", offset, iterration);
+ LoggerD("offset:%u | Starting iteration: %u", offset, iterration);
const std::size_t search_len = 10;
std::size_t search_offset = 0;
for (search_offset = 0; search_offset < search_len; ++search_offset) {
if (search_len == search_offset) {
return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
- ("offset:%d | Couldn't find marker! RAW DATA:{%s}", offset,
+ ("offset:%u | Couldn't find marker! RAW DATA:{%s}", offset,
getPartOfFile(offset, 0, 10).c_str()));
}
unsigned char* section_begin = m_in_data + section_offset;
offset = section_offset; // Move to section begin
- LoggerD("offset:%d | Moved to section begin", offset);
+ LoggerD("offset:%u | Moved to section begin", offset);
if (!isJpegMarker(section_begin[1])) {
return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
- ("offset:%d | Is not valid marker: 0x%x RAW DATA:{%s}", offset,
+ ("offset:%u | Is not valid marker: 0x%x RAW DATA:{%s}", offset,
section_begin[1], getPartOfFile(section_offset, 0, 4).c_str()));
}
const JpegMarker cur_marker = castToJpegMarker(section_begin[1]);
- LoggerD("offset:%d | Found valid marker: 0x%x RAW DATA:{%s}", offset, cur_marker,
+ LoggerD("offset:%u | Found valid marker: 0x%x RAW DATA:{%s}", offset, cur_marker,
getPartOfFile(section_offset, 0, 4).c_str());
offset += 2; // Read 0xffxx marker tag - 2 bytes
section->type = cur_marker;
m_sections.push_back(section);
if (cur_marker == JPEG_MARKER_SOI || cur_marker == JPEG_MARKER_EOI) {
- LoggerD("offset:%d | Found: %s marker, moving to next marker at:%d", section_offset,
+ LoggerD("offset:%u | Found: %s marker, moving to next marker at:%u", section_offset,
((cur_marker == JPEG_MARKER_SOI) ? "SOI" : "EOI"), offset);
if (cur_marker == JPEG_MARKER_EOI && m_padding_data != NULL) {
// size 2 bytes
const long section_data_len = total_section_len - 2;
- LoggerD("offset:%d tag:0x%x | Read total_section_len:%d (data len:%d)", section_offset,
+ LoggerD("offset:%u tag:0x%x | Read total_section_len:%ld (data len:%ld)", section_offset,
cur_marker, total_section_len, section_data_len);
offset += 2; // Read data size - 2 bytes
if (total_section_len < 0) {
return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
- ("offset:%d tag:0x%x | Error: total_section_len is: %d < 0",
+ ("offset:%u tag:0x%x | Error: total_section_len is: %ld < 0",
offset, cur_marker, total_section_len));
}
if (section_offset + 2 + total_section_len > m_in_data_size) {
return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
- ("offset:%d tag:0x%x | Error: current section offset:%d"
- " + 2 + total_section_len:%d = %d is greater then file size:%d",
+ ("offset:%u tag:0x%x | Error: current section offset:%u"
+ " + 2 + total_section_len:%ld = %lu is greater then file size:%u",
offset, cur_marker, section_offset, total_section_len,
section_offset + total_section_len, m_in_data_size));
}
section->exif_data = exif_data_new_from_data(section_begin, exif_data_size);
LoggerD(
- "offset:%d tag:0x%x | Loading exif from offset:%d"
- " len:%d exif_data_new_from_data returned: %p",
+ "offset:%u tag:0x%x | Loading exif from offset:%u"
+ " len:%u exif_data_new_from_data returned: %p",
offset, cur_marker, section_offset, exif_data_size, section->exif_data);
if (!section->exif_data) {
std::size_t image_size = m_in_data_size - image_data_offset - 2;
LoggerW(
"offset:%d tag:0x%x"
- " | Image data offset:%d Estimated image size:%d",
+ " | Image data offset:%u Estimated image size:%u",
offset, cur_marker, image_data_offset, image_size);
m_image_data = m_in_data + image_data_offset;
" delta:%d",
image_size, eoi_tag_index, image_size - eoi_tag_index);
- LoggerW("Setting image_size to EOI tag: %d", eoi_tag_index);
+ LoggerW("Setting image_size to EOI tag: %u", eoi_tag_index);
image_size = eoi_tag_index;
m_padding_data = m_image_data + image_size + 2; // (skip EOI tag)
m_image_size = image_size;
offset = image_data_offset + image_size;
- LoggerD("offset:%d tag:0x%x | SOS Offset moved to next marker", offset, cur_marker);
+ LoggerD("offset:%u tag:0x%x | SOS Offset moved to next marker", offset, cur_marker);
} else {
offset += section_data_len;
- LoggerD("offset:%d tag:0x%x | Offset moved to next marker", offset, cur_marker);
+ LoggerD("offset:%u tag:0x%x | Offset moved to next marker", offset, cur_marker);
}
}
}
LoggerE(
"Exception occured during saveToFilePriv "
- "original file: [%] new: [%s]",
+ "original file: [%s] new: [%s]",
m_source_file_path.c_str(), out_path.c_str());
if (out_path == m_source_file_path) {
}
if (m_padding_data && m_padding_data_size > 0) {
- LoggerD("Padding data exists and contains:%d bytes saving to JPEG file");
+ LoggerD("Padding data exists and contains:%d bytes saving to JPEG file", m_padding_data_size);
const std::size_t bytes_wrote = fwrite(m_image_data, 1, m_padding_data_size, m_out_file);
if (bytes_wrote != m_padding_data_size) {
} else {
LoggerW(
"Warning: found %d APP1/Exif sections -"
- " only first is currently supported!");
+ " only first is currently supported!", num_exif_sections);
}
}
}
}
Rational Rational::createFromDouble(const double value, const long precision) {
- LoggerD("Entered value:%f precision:%d", value, precision);
+ LoggerD("Entered value:%f precision:%lu", value, precision);
if (value < 0.0) {
LoggerW("Trying to create negative Rational: %f!", value);
return Rational();
result_denominator *= -1;
}
- LoggerD("Rational(%d, %d) error0 < error1m:%d", result_numerator, result_denominator,
+ LoggerD("Rational(%ld, %ld) error0 < error1m:%d", result_numerator, result_denominator,
error0 < error1m);
return Rational(numerator0, denominator0);
}
nominator += denominator * integer_value;
- LoggerD("%d/%d -> %f", nominator, denominator, static_cast<float>(nominator) / denominator);
+ LoggerD("%ld/%ld -> %f", nominator, denominator, static_cast<float>(nominator) / denominator);
if (0 == nominator) {
// Exposure time = 0 is invalid value
data_p += part;
data_size -= part;
- LoggerD("Readed part %li bytes", readed);
+ LoggerD("Readed part %u bytes", readed);
if (ferror(file)) {
LoggerE("Error during file write!");
break;
}
}
- LoggerD("Readed %li bytes", readed);
+ LoggerD("Readed %u bytes", readed);
data->resize(readed);
return true;
}
int status;
status = fseek(file, offset, SEEK_SET);
- LoggerD("Offset is %li, writing %i bytes", offset, data.size());
+ LoggerD("Offset is %u, writing %i bytes", offset, data.size());
if (status) {
LoggerE("Cannot perform seek!");
return false;
LoggerE("Cannot sync file!");
return false;
}
- LoggerD("Written %li bytes", written);
+ LoggerD("Written %u bytes", written);
return true;
}
return ret;
}
LoggerD("property name: %s", property.c_str());
- LoggerD("available property count: %d", property_count);
+ LoggerD("available property count: %lu", property_count);
for (std::size_t i = 0; i < property_count; i++) {
picojson::value result = picojson::value(picojson::object());
break;
default:
return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Received unexpected data",
- ("Received unexpected data: %u", rotation));
+ ("Received unexpected data: %d", rotation));
}
*result = status;
return PlatformResult(ErrorCode::NO_ERROR);
PlatformResult SysteminfoPropertiesManager::ReportNetwork(picojson::object* out,
unsigned long count) {
- LoggerD("Entered with index property %d", count);
+ LoggerD("Entered with index property %lu", count);
connection_h connection_handle = nullptr;
connection_type_e connection_type = CONNECTION_TYPE_DISCONNECTED;
int networkType = 0;
PlatformResult SysteminfoPropertiesManager::ReportCellularNetwork(picojson::object* out,
unsigned long count) {
- LoggerD("Entered with index property %d", count);
+ LoggerD("Entered with index property %lu", count);
PlatformResult ret = SysteminfoUtils::CheckTelephonySupport();
if (ret.IsError()) {
return ret;