Fix code...
This commit is contained in:
parent
2f09e4a142
commit
16feb1fb2e
@ -1,9 +1,10 @@
|
|||||||
#include "control.h"
|
#include "control.h"
|
||||||
|
|
||||||
static void telemetry_free(gpointer te, gpointer x) {
|
static void telemetry_free(gpointer _te, gpointer x) {
|
||||||
|
telemetry *te = (telemetry*) _te;
|
||||||
UNUSED(x);
|
UNUSED(x);
|
||||||
g_array_free(te->objects, TRUE);
|
g_array_free(te->objects, TRUE);
|
||||||
g_slice_free(telemetry, (telemetry*) te);
|
g_slice_free(telemetry, te);
|
||||||
}
|
}
|
||||||
|
|
||||||
static telemetry* telemetry_new() {
|
static telemetry* telemetry_new() {
|
||||||
@ -14,14 +15,14 @@ static telemetry* telemetry_new() {
|
|||||||
|
|
||||||
trial *trial_new() {
|
trial *trial_new() {
|
||||||
trial *t = g_slice_new0(trial);
|
trial *t = g_slice_new0(trial);
|
||||||
g_queue_init(t->telemetry);
|
g_queue_init(&t->telemetry);
|
||||||
t->map.solid_objects = g_array_new(FALSE, FALSE, sizeof(object));
|
t->map.solid_objects = g_array_new(FALSE, FALSE, sizeof(object));
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
void trial_reset_run(trial *t) {
|
void trial_reset_run(trial *t) {
|
||||||
g_queue_foreach(t->telemetry, telemetry_free, NULL);
|
g_queue_foreach(&t->telemetry, telemetry_free, NULL);
|
||||||
g_queue_clear(t->telementry);
|
g_queue_clear(&t->telemetry);
|
||||||
t->last_ts = 0;
|
t->last_ts = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,8 +36,8 @@ void trial_wait_for_input(trial *t) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void trial_free(trial *t) {
|
void trial_free(trial *t) {
|
||||||
g_queue_foreach(t->telemetry, telemetry_free, NULL);
|
g_queue_foreach(&t->telemetry, telemetry_free, NULL);
|
||||||
g_queue_clear(t->telementry);
|
g_queue_clear(&t->telemetry);
|
||||||
g_array_free(t->map.solid_objects, TRUE);
|
g_array_free(t->map.solid_objects, TRUE);
|
||||||
g_slice_free(t);
|
g_slice_free(trial, t);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef _CONTROL_H
|
#ifndef _CONTROL_H
|
||||||
#define _CONTROL_H
|
#define _CONTROL_H
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#define INLINE static inline
|
#define INLINE static inline
|
||||||
@ -61,7 +62,7 @@ struct map {
|
|||||||
struct trial {
|
struct trial {
|
||||||
map map;
|
map map;
|
||||||
timestamp last_ts;
|
timestamp last_ts;
|
||||||
GQueue telemetry_data;
|
GQueue telemetry;
|
||||||
vehicle vehicle; /* our view */
|
vehicle vehicle; /* our view */
|
||||||
|
|
||||||
/* internal */
|
/* internal */
|
||||||
|
2
wscript
2
wscript
@ -62,7 +62,7 @@ def PKGCONFIG(conf, name, uselib = None, define = '', version = '', mandatory =
|
|||||||
|
|
||||||
def set_options(opt):
|
def set_options(opt):
|
||||||
opt.tool_options('compiler_cc')
|
opt.tool_options('compiler_cc')
|
||||||
opt.tool_options('ragel', tdir = '.')
|
opt.tool_options('ragel', tooldir = '.')
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
conf.check_tool('compiler_cc')
|
conf.check_tool('compiler_cc')
|
||||||
|
Loading…
Reference in New Issue
Block a user