Project

General

Profile

Revision 342

Added by Jason knichel over 16 years ago

added some flags to the make computer target
checked some calls of malloc to make sure that it didn't return null

View differences:

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

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

  
182 182
colonet:
trunk/code/projects/libwireless/lib/sensor_matrix.c
61 61
	}
62 62
	m->size = DEFAULT_SENSOR_MATRIX_SIZE;
63 63
	m->matrix = (int**)malloc(m->size * sizeof(int*));
64
	if (!(m->matrix)) {
65
	  WL_DEBUG_PRINT("Out of memory - allocating memory for matrix.\r\n");
66
	  free(m);
67
	  return NULL;
68
	}
64 69
	m->joined = (int*)malloc(m->size * sizeof(int));
70
	if (!(m->joined)) {
71
	  WL_DEBUG_PRINT("Out of memory - allocating memory for joined.\r\n");
72
	  free(m->matrix);
73
	  free(m);
74
	  return NULL;
75
	}
65 76
	m->numJoined = 0;
66 77
	if (!(m->matrix) || !(m->joined))
67 78
	{

Also available in: Unified diff