Merge branch 'master' of git+ssh://gitosis@stbuehler.de:522/icfp11

Conflicts:

	src/path.c
This commit is contained in:
Johannes Reinhardt 2008-07-12 10:51:31 +02:00
commit 70ee5f69a6
3 changed files with 6 additions and 3 deletions

View File

@ -6,6 +6,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
#include <glib.h> #include <glib.h>
#include <stdio.h>
#define INLINE static inline #define INLINE static inline
#define UNUSED(x) ((void)(x)) #define UNUSED(x) ((void)(x))
@ -192,7 +193,9 @@ INLINE void vehicle_hard_right(trial *t) {
INLINE timestamp getcurts(trial *t) { INLINE timestamp getcurts(trial *t) {
struct timeval tv; struct timeval tv;
gettimeofday(&tv, NULL); gettimeofday(&tv, NULL);
return (tv.tv_sec - t->started.tv_sec) * 1000 + (tv.tv_usec - t->started.tv_sec) / 1000; timestamp ts = (tv.tv_sec - t->started.tv_sec) * 1000 + (tv.tv_usec - t->started.tv_usec) / 1000;
printf("Timestamp: %u\n", ts);
return ts;
} }
#endif #endif

View File

@ -387,9 +387,9 @@ _match:
if (!t->alive) { if (!t->alive) {
t->vehicle.accel = ctx->tm->vehicle.accel; t->vehicle.accel = ctx->tm->vehicle.accel;
t->vehicle.turn = ctx->tm->vehicle.turn; t->vehicle.turn = ctx->tm->vehicle.turn;
gettimeofday(&t->started, NULL);
} }
t->last_ts = ctx->tm->ts; t->last_ts = ctx->tm->ts;
gettimeofday(&t->started, NULL);
ctx->tm = NULL; ctx->tm = NULL;
t->alive = 1; t->alive = 1;
} }

View File

@ -39,9 +39,9 @@ static timestamp extract_ts(context *ctx, char *fpc) {
if (!t->alive) { if (!t->alive) {
t->vehicle.accel = ctx->tm->vehicle.accel; t->vehicle.accel = ctx->tm->vehicle.accel;
t->vehicle.turn = ctx->tm->vehicle.turn; t->vehicle.turn = ctx->tm->vehicle.turn;
gettimeofday(&t->started, NULL);
} }
t->last_ts = ctx->tm->ts; t->last_ts = ctx->tm->ts;
gettimeofday(&t->started, NULL);
ctx->tm = NULL; ctx->tm = NULL;
t->alive = 1; t->alive = 1;
} }