aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Turvey <mturvey6@gmail.com>2018-01-15 21:50:10 -0700
committerMike Turvey <mturvey6@gmail.com>2018-01-15 21:50:10 -0700
commit7817da63526f35d10d6d4f6b3d9c02280719e023 (patch)
treeca30ac55445f1355615464688ac2e012faea2e04 /src
parent8be34f04a100defc9d1958aa4ce63ef02d19db69 (diff)
downloadlibsurvive-7817da63526f35d10d6d4f6b3d9c02280719e023.tar.gz
libsurvive-7817da63526f35d10d6d4f6b3d9c02280719e023.tar.bz2
Fix compiler warnings
Diffstat (limited to 'src')
-rw-r--r--src/poser_octavioradii.c2
-rw-r--r--src/poser_turveytori.c5
-rwxr-xr-xsrc/survive.c10
-rw-r--r--src/survive_config.c2
4 files changed, 10 insertions, 9 deletions
diff --git a/src/poser_octavioradii.c b/src/poser_octavioradii.c
index be1e9f7..5805e1a 100644
--- a/src/poser_octavioradii.c
+++ b/src/poser_octavioradii.c
@@ -591,7 +591,7 @@ int PoserOctavioRadii( SurviveObject * so, PoserData * pd )
}
else
{
- dd->hitCount[i][l->lh][axis] *= 0.5;
+ dd->hitCount[i][l->lh][axis] = (int)((double)dd->hitCount[i][l->lh][axis] * 0.5);
}
}
//if (0 == l->lh)
diff --git a/src/poser_turveytori.c b/src/poser_turveytori.c
index 59ff25e..de1516a 100644
--- a/src/poser_turveytori.c
+++ b/src/poser_turveytori.c
@@ -1,5 +1,5 @@
#include <survive.h>
-#include <src/survive_config.h>
+#include "survive_config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -785,7 +785,6 @@ FLT RotationEstimateFitnessQuaternion(Point lhPoint, FLT *quaternion, TrackedObj
FLT throwaway = RotationEstimateFitnessAxisAngle(lhPoint, axisAngle, obj);
- int a = throwaway;
return throwaway;
}
@@ -1397,7 +1396,7 @@ static Point SolveForLighthouse(FLT posOut[3], FLT quatOut[4], TrackedObject *ob
SolveForRotationQuat(rotQuat, obj, refinedEstimateGd);
SolveForRotation(rot, obj, refinedEstimateGd);
FLT objPos[3];
- FLT objPos2[3];
+ //FLT objPos2[3];
//{
// toriData->lastLhRotQuat[lh][0] = rotQuat[0];
diff --git a/src/survive.c b/src/survive.c
index a5ca68f..0386275 100755
--- a/src/survive.c
+++ b/src/survive.c
@@ -8,6 +8,7 @@
#include <string.h>
#include "survive_config.h"
+#include "os_generic.h"
#ifdef __APPLE__
#define z_const const
@@ -40,7 +41,7 @@ static void survivenote( struct SurviveContext * ctx, const char * fault )
fprintf( stderr, "Info: %s\n", fault );
}
-static void button_servicer(void * context)
+static void *button_servicer(void * context)
{
SurviveContext *ctx = (SurviveContext*)context;
@@ -51,7 +52,7 @@ static void button_servicer(void * context)
if (ctx->isClosing)
{
// we're shutting down. Close.
- return;
+ return NULL;
}
ButtonQueueEntry *entry = &(ctx->buttonQueue.entry[ctx->buttonQueue.nextReadIndex]);
@@ -61,7 +62,7 @@ static void button_servicer(void * context)
// the buttonQueue
// if it does happen, it will kill all future button input
printf("ERROR: Unpopulated ButtonQueueEntry! NextReadIndex=%d\n", ctx->buttonQueue.nextReadIndex);
- return;
+ return NULL;
}
//printf("ButtonEntry: eventType:%x, buttonId:%d, axis1:%d, axis1Val:%8.8x, axis2:%d, axis2Val:%8.8x\n",
@@ -90,6 +91,7 @@ static void button_servicer(void * context)
ctx->buttonQueue.nextReadIndex = 0;
}
};
+ return NULL;
}
SurviveContext * survive_init( int headless )
@@ -182,7 +184,7 @@ SurviveContext * survive_init( int headless )
ctx->buttonQueue.buttonservicesem = OGCreateSema();
// start the thread to process button data
- ctx->buttonservicethread = OGCreateThread(&button_servicer, ctx);
+ ctx->buttonservicethread = OGCreateThread(button_servicer, ctx);
survive_install_button_fn(ctx, NULL);
survive_install_raw_pose_fn(ctx, NULL);
diff --git a/src/survive_config.c b/src/survive_config.c
index 0961651..46c6658 100644
--- a/src/survive_config.c
+++ b/src/survive_config.c
@@ -187,7 +187,7 @@ uint16_t config_read_float_array(config_group *cg, const char *tag, FLT* values,
config_entry *cv = find_config_entry(cg, tag);
if (cv != NULL) {
- for (int i=0; i < CFG_MIN(count, cv->elements); i++)
+ for (unsigned int i=0; i < CFG_MIN(count, cv->elements); i++)
{
values[i] = ((double*)cv->data)[i];
}