Replace use of C style casts
This commit is contained in:
@@ -152,7 +152,7 @@ void CddaSongLoader::LoadSongs() {
|
||||
GstMessage *msg = nullptr;
|
||||
GstMessage *msg_toc = nullptr;
|
||||
GstMessage *msg_tag = nullptr;
|
||||
while ((msg = gst_bus_timed_pop_filtered(GST_ELEMENT_BUS(pipeline), GST_SECOND, (GstMessageType)(GST_MESSAGE_TOC | GST_MESSAGE_TAG)))) {
|
||||
while ((msg = gst_bus_timed_pop_filtered(GST_ELEMENT_BUS(pipeline), GST_SECOND, static_cast<GstMessageType>(GST_MESSAGE_TOC | GST_MESSAGE_TAG)))) {
|
||||
if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_TOC) {
|
||||
if (msg_toc) gst_message_unref(msg_toc); // Shouldn't happen, but just in case
|
||||
msg_toc = msg;
|
||||
@@ -169,7 +169,7 @@ void CddaSongLoader::LoadSongs() {
|
||||
gst_message_parse_toc (msg_toc, &toc, nullptr);
|
||||
if (toc) {
|
||||
GList *entries = gst_toc_get_entries(toc);
|
||||
if (entries && (guint)songs.size() <= g_list_length(entries)) {
|
||||
if (entries && static_cast<guint>(songs.size()) <= g_list_length(entries)) {
|
||||
int i = 0;
|
||||
for (GList *node = entries; node != nullptr; node = node->next) {
|
||||
GstTocEntry *entry = static_cast<GstTocEntry*>(node->data);
|
||||
|
||||
@@ -52,7 +52,7 @@ QString GioLister::DeviceInfo::unique_id() const {
|
||||
if (mount_ptr)
|
||||
return QString("Gio/%1/%2/%3").arg(mount_uuid, filesystem_type).arg(filesystem_size);
|
||||
else
|
||||
return QString("Gio/unmounted/%1").arg((qulonglong)volume_ptr.get());
|
||||
return QString("Gio/unmounted/%1").arg(reinterpret_cast<qulonglong>(volume_ptr.get()));
|
||||
|
||||
}
|
||||
|
||||
@@ -609,7 +609,7 @@ void GioLister::UnmountDevice(const QString &id) {
|
||||
|
||||
if (info.volume_ptr) {
|
||||
if (g_volume_can_eject(info.volume_ptr)) {
|
||||
g_volume_eject_with_operation(info.volume_ptr, G_MOUNT_UNMOUNT_NONE, nullptr, nullptr, (GAsyncReadyCallback)VolumeEjectFinished, nullptr);
|
||||
g_volume_eject_with_operation(info.volume_ptr, G_MOUNT_UNMOUNT_NONE, nullptr, nullptr, reinterpret_cast<GAsyncReadyCallback>(VolumeEjectFinished), nullptr);
|
||||
g_object_unref(info.volume_ptr);
|
||||
return;
|
||||
}
|
||||
@@ -617,10 +617,10 @@ void GioLister::UnmountDevice(const QString &id) {
|
||||
else return;
|
||||
|
||||
if (g_mount_can_eject(info.mount_ptr)) {
|
||||
g_mount_eject_with_operation(info.mount_ptr, G_MOUNT_UNMOUNT_NONE, nullptr, nullptr, (GAsyncReadyCallback)MountEjectFinished, nullptr);
|
||||
g_mount_eject_with_operation(info.mount_ptr, G_MOUNT_UNMOUNT_NONE, nullptr, nullptr, reinterpret_cast<GAsyncReadyCallback>(MountEjectFinished), nullptr);
|
||||
}
|
||||
else if (g_mount_can_unmount(info.mount_ptr)) {
|
||||
g_mount_unmount_with_operation(info.mount_ptr, G_MOUNT_UNMOUNT_NONE, nullptr, nullptr, (GAsyncReadyCallback)MountUnmountFinished, nullptr);
|
||||
g_mount_unmount_with_operation(info.mount_ptr, G_MOUNT_UNMOUNT_NONE, nullptr, nullptr, reinterpret_cast<GAsyncReadyCallback>(MountUnmountFinished), nullptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ MtpConnection::MtpConnection(const QUrl &url) : device_(nullptr) {
|
||||
}
|
||||
|
||||
if (url_query.hasQueryItem("vendor")) {
|
||||
LIBMTP_raw_device_t *raw_device = (LIBMTP_raw_device_t*)malloc(sizeof(LIBMTP_raw_device_t));
|
||||
LIBMTP_raw_device_t *raw_device = static_cast<LIBMTP_raw_device_t*>(malloc(sizeof(LIBMTP_raw_device_t)));
|
||||
raw_device->device_entry.vendor = url_query.queryItemValue("vendor").toLatin1().data();
|
||||
raw_device->device_entry.product = url_query.queryItemValue("product").toLatin1().data();
|
||||
raw_device->device_entry.vendor_id = url_query.queryItemValue("vendor_id").toUShort();
|
||||
|
||||
Reference in New Issue
Block a user