Project

General

Profile

Revision 162

Added by Jason knichel over 16 years ago

changed the computer target to use g++ instead of gcc to be compatible with colonet

fixed the casting in the other files so g++ would actually compile

View differences:

trunk/code/projects/libwireless/lib/Makefile
176 176
	$(AR) $(ALL_ASFLAGS) $(TARGET).a $(OBJ)
177 177

  
178 178
computer:
179
	gcc *.c -g -I. -c
179
	g++ *.c -g -I. -c
180 180
	ar rcs $(TARGET).a $(OBJ)
181 181

  
182 182
# Eye candy.
trunk/code/projects/libwireless/lib/sensor_matrix.c
19 19
	SensorMatrix* m;
20 20
	int i;
21 21
	
22
	m = malloc(sizeof(SensorMatrix));
22
	m = (SensorMatrix*)malloc(sizeof(SensorMatrix));
23 23
	if (!m)
24 24
	{
25 25
		WL_DEBUG_PRINT("Out of memory - create sensor matrix.\r\n");
26 26
		return NULL;
27 27
	}
28 28
	m->size = DEFAULT_SENSOR_MATRIX_SIZE;
29
	m->matrix = malloc(m->size * sizeof(int*));
30
	m->joined = malloc(m->size * sizeof(int));
29
	m->matrix = (int**)malloc(m->size * sizeof(int*));
30
	m->joined = (int*)malloc(m->size * sizeof(int));
31 31
	m->numJoined = 0;
32 32
	if (!(m->matrix) || !(m->joined))
33 33
	{
......
73 73
	if (m->matrix[id] != NULL)
74 74
		return;
75 75
	
76
	m->matrix[id] = malloc(m->size * sizeof(int));
76
	m->matrix[id] = (int*)malloc(m->size * sizeof(int));
77 77
	if (!(m->matrix[id]))
78 78
	{
79 79
		WL_DEBUG_PRINT("Out of memory - add robot.\r\n");
......
125 125
	int i, j;
126 126
	WL_DEBUG_PRINT("Expanding sensor matrix.\r\n");
127 127
	
128
	int** tempMatrix = malloc(nextSize * sizeof(int*));
128
	int** tempMatrix = (int**)malloc(nextSize * sizeof(int*));
129 129
	if (!tempMatrix)
130 130
	{
131 131
		WL_DEBUG_PRINT("Out of memory - expand matrix.\r\n");
......
139 139
	for (i = 0; i < m->size; i++)
140 140
		if (m->matrix[i] != NULL)
141 141
		{
142
			tempMatrix[i] = malloc(nextSize * sizeof(int));
142
		  tempMatrix[i] = (int *)malloc(nextSize * sizeof(int));
143 143
			if (!tempMatrix[i])
144 144
			{
145 145
				WL_DEBUG_PRINT("Out of memory - expand matrix 2.\r\n");
......
158 158
	m->size = nextSize;
159 159

  
160 160
	//expand the size of joined
161
	int* tempJoined = malloc(nextSize * sizeof(int));
161
	int* tempJoined = (int *)malloc(nextSize * sizeof(int));
162 162
	if (!tempJoined)
163 163
	{
164 164
		WL_DEBUG_PRINT("Out of memory - expand matrix 3.\r\n");
trunk/code/projects/libwireless/lib/wireless.c
92 92

  
93 93
	//create signal handler
94 94
	struct sigaction wl_sig_act;
95
	wl_sig_act.sa_handler = (void *)sig_handler;
95
	wl_sig_act.sa_handler = sig_handler;
96 96
	wl_sig_act.sa_flags = 0;
97 97
	sigemptyset(&wl_sig_act.sa_mask);
98 98
	sigaction(SIGALRM, &wl_sig_act, 0);

Also available in: Unified diff