d/steamvr_lh: Fix warnings

This commit is contained in:
Ryan Pavlik 2023-06-16 16:48:46 -05:00 committed by Jakob Bornecrantz
parent bc9624617a
commit c7fcf59866
3 changed files with 6 additions and 3 deletions

View file

@ -18,6 +18,7 @@
#include "util/u_device.h"
#include "util/u_logging.h"
#include "util/u_json.hpp"
#include "xrt/xrt_device.h"
#define DEV_ERR(...) U_LOG_IFL_E(ctx->log_level, __VA_ARGS__)
#define DEV_WARN(...) U_LOG_IFL_W(ctx->log_level, __VA_ARGS__)
@ -95,7 +96,8 @@ ControllerDevice::ControllerDevice(vr::PropertyContainerHandle_t handle, const D
Device::Device(const DeviceBuilder &builder) : xrt_device({}), ctx(builder.ctx), driver(builder.driver)
{
std::strncpy(this->serial, builder.serial, XRT_DEVICE_NAME_LEN);
std::strncpy(this->serial, builder.serial, XRT_DEVICE_NAME_LEN - 1);
this->serial[XRT_DEVICE_NAME_LEN - 1] = 0;
this->tracking_origin = ctx.get();
this->orientation_tracking_supported = true;
this->position_tracking_supported = true;

View file

@ -14,7 +14,7 @@
namespace vr {
inline const char *IVRPaths_Version = "IVRPaths_001";
typedef uint64_t PathHandle_t;
}; // namespace vr
} // namespace vr
/** This interface is missing in the C++ header but present in the C one, and the lighthouse driver requires it. */
class Paths

View file

@ -24,7 +24,8 @@
#include "util/u_device.h"
namespace {
DEBUG_GET_ONCE_LOG_OPTION(lh_log, "LIGHTHOUSE_LOG", U_LOGGING_INFO);
DEBUG_GET_ONCE_LOG_OPTION(lh_log, "LIGHTHOUSE_LOG", U_LOGGING_INFO)
// ~/.steam/root is a symlink to where the Steam root is
const std::string STEAM_INSTALL_DIR = std::string(getenv("HOME")) + "/.steam/root";