mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-30 17:58:37 +08:00
frontend: Use static_cast when casting from void pointers
Using static_cast is preferred here, as it is safer to use than reinterpret_cast.
This commit is contained in:
@@ -331,7 +331,7 @@ void OBSStudioAPI::obs_frontend_add_tools_menu_item(const char *name, obs_fronte
|
||||
|
||||
void *OBSStudioAPI::obs_frontend_add_dock(void *dock)
|
||||
{
|
||||
QDockWidget *d = reinterpret_cast<QDockWidget *>(dock);
|
||||
QDockWidget *d = static_cast<QDockWidget *>(dock);
|
||||
|
||||
QString name = d->objectName();
|
||||
if (name.isEmpty() || main->IsDockObjectNameUsed(name)) {
|
||||
@@ -387,7 +387,7 @@ bool OBSStudioAPI::obs_frontend_add_custom_qdock(const char *id, void *dock)
|
||||
return false;
|
||||
}
|
||||
|
||||
QDockWidget *d = reinterpret_cast<QDockWidget *>(dock);
|
||||
QDockWidget *d = static_cast<QDockWidget *>(dock);
|
||||
d->setObjectName(QT_UTF8(id));
|
||||
|
||||
main->AddCustomDockWidget(d);
|
||||
|
||||
Reference in New Issue
Block a user