Revision 1980
Fixed all compilation errors and warnings in traffic_navigation. If you committed these
abominations, I hope you're sorry. I only made things compile. If I fixed your code, it
might no longer do what you intended, but I can pretty much guarantee that it didn't do
what you intended anyway, so no complaining. Some undefined or implicitly defined
functions had no clear fix without writing new code, so I just added comments
recommending that the maintainers fix the problems. If that's you, I'd get on that.
mapping.h | ||
---|---|---|
1 |
#ifndef __INTERSECTION_MAPPING_H__ |
|
2 |
#define __INTERSECTION_MAPPING_H__ |
|
3 |
|
|
1 | 4 |
#include "intersectData.h" |
2 | 5 |
|
3 | 6 |
/* Data is sent in the following order |
... | ... | |
11 | 14 |
typedef struct { |
12 | 15 |
char to; /* Where does this edge lead to? */ |
13 | 16 |
char dist; /* Where does it come from? */ |
14 |
}edge
|
|
17 |
} edge;
|
|
15 | 18 |
|
16 | 19 |
/* Representation of an intersection on the graph */ |
17 | 20 |
typedef struct { |
... | ... | |
19 | 22 |
char intNum; /* What is the intersection number */ |
20 | 23 |
char numOut; /* Note that we can have no more than 4 outgoing edges */ |
21 | 24 |
char outSeen; /* The number of the outgoing edges that we have seen for this intersection */ |
22 |
edge[4] outgoingEdges;
|
|
23 |
}node
|
|
25 |
edge outgoingEdges[4];
|
|
26 |
} node;
|
|
24 | 27 |
|
25 | 28 |
/* A union that is used in wireless transmissions */ |
26 | 29 |
typedef union { |
27 | 30 |
node n; |
28 | 31 |
char array[12]; |
29 |
}node_union |
|
32 |
}node_union;
|
|
30 | 33 |
|
31 |
/* This array holds all of the intersections that are represented in the graph |
|
32 |
* after its creation, the graph is transmitted wirelessly */ |
|
33 |
node[NUM_FEATURES] intersections; |
|
34 |
int createEdge(edge* newEdge); |
|
35 |
int createMap(void); |
|
36 |
int getNumOut(int type); |
|
37 |
int insertEdge(void); |
|
38 |
int nextInt(void); |
|
39 |
int encodeNode(node n); |
|
40 |
void sendIntersectionGraph(void); |
|
34 | 41 |
|
35 |
int createEdge(edge* newEdge); |
|
42 |
extern node intersections[NUM_FEATURES]; |
|
43 |
|
|
44 |
#endif |
Also available in: Unified diff