Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Warnings #168

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

option(BUILD_BOTH_STATIC_SHARED_LIB OFF)

if (MSVC)
add_definitions(/D_CRT_SECURE_NO_WARNINGS=1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to fix sprintf usage so as to catch cases where using sprintf would be dangerous?

endif()

if (MSVC)
# Add the "lib" prefix for generated .lib outputs.
set(LIB_PREFIX lib)
Expand Down
4 changes: 2 additions & 2 deletions src/omath.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ void oquatf_slerp (float fT, const quatf* rkP, const quatf* rkQ, bool shortestPa
float fSin = sqrtf(1 - (fCos*fCos));
float fAngle = atan2f(fSin, fCos);
float fInvSin = 1.0f / fSin;
float fCoeff0 = sin((1.0f - fT) * fAngle) * fInvSin;
float fCoeff1 = sin(fT * fAngle) * fInvSin;
float fCoeff0 = sinf((1.0f - fT) * fAngle) * fInvSin;
float fCoeff1 = sinf(fT * fAngle) * fInvSin;

out_q->x = fCoeff0 * rkP->x + fCoeff1 * rkT.x;
out_q->y = fCoeff0 * rkP->y + fCoeff1 * rkT.y;
Expand Down
2 changes: 1 addition & 1 deletion src/openhmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ void ohmd_calc_default_proj_matrices(ohmd_device_properties* props)
// XXX: on CV1, props->hsize > props->lens_sep / 2.0,
// I am not sure about the implications, but just taking the absolute
// value of the offset seems to work.
float proj_offset = fabs(4.0f * lens_shift / props->hsize);
float proj_offset = fabsf(4.0f * lens_shift / props->hsize);

// Setup the base projection matrix. Each eye mostly have the
// same projection matrix with the exception of the offset.
Expand Down
2 changes: 1 addition & 1 deletion src/platform-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void ohmd_toggle_ovr_service(int state) //State is 0 for Disable, 1 for Enable
else if (state == 1 && _enable_ovr_service)
{
// Start it
BOOL b = StartService(serviceHandle, NULL, NULL);
BOOL b = StartService(serviceHandle, 0, NULL);
if (b)
printf("OVRService started\n");
else
Expand Down