Address Linux build warnings and errors

This commit is contained in:
David Rowe 2020-05-23 17:18:03 +12:00
parent 74f50ce079
commit f2232b89f0
3 changed files with 16 additions and 3 deletions

View file

@ -407,6 +407,14 @@ void showMinSpecWarning() {
}
// Needed here for PathUtils
#ifdef Q_OS_LINUX
char cmdline[4096];
FILE* fp = fopen("/proc/self/cmdline", "r");
fgets(cmdline, sizeof cmdline, fp);
fclose(fp);
int __argc = 1;
char* __argv[1] = { cmdline };
#endif
QCoreApplication miniApp(__argc, __argv);
vrSystem->ResetSeatedZeroPose();
@ -486,7 +494,12 @@ bool checkMinSpecImpl() {
}
extern "C" {
#if defined(Q_OS_WIN32)
__declspec(dllexport) int __stdcall CheckMinSpec() {
#else
__attribute__((visibility("default"))) int CheckMinSpec() {
#endif
return checkMinSpecImpl() ? 1 : 0;
}
}

View file

@ -76,7 +76,7 @@ struct PoseData {
}
void update(const glm::mat4& resetMat) {
for (int i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) {
for (uint32_t i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) {
if (!vrPoses[i].bPoseIsValid) {
continue;
}
@ -87,7 +87,7 @@ struct PoseData {
}
void resetToInvalid() {
for (int i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) {
for (uint32_t i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) {
vrPoses[i].bPoseIsValid = false;
}
}

View file

@ -52,7 +52,7 @@ public:
bool activate() override;
void deactivate() override;
QString getDeviceName() { return QString::fromStdString(_inputDevice->_headsetName); }
QString getDeviceName() override { return QString::fromStdString(_inputDevice->_headsetName); }
void pluginFocusOutEvent() override { _inputDevice->focusOutEvent(); }
void pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override;