Browse Source

Tidied up debugging messages

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
1dbafa8950
2 changed files with 5 additions and 5 deletions
  1. 4
    4
      src/core/malloc.c
  2. 1
    1
      src/net/ethernet.c

+ 4
- 4
src/core/malloc.c View File

77
 	 */
77
 	 */
78
 	size = ( size + MIN_MEMBLOCK_SIZE - 1 ) & ~( MIN_MEMBLOCK_SIZE - 1 );
78
 	size = ( size + MIN_MEMBLOCK_SIZE - 1 ) & ~( MIN_MEMBLOCK_SIZE - 1 );
79
 	align_mask = ( align - 1 ) | ( MIN_MEMBLOCK_SIZE - 1 );
79
 	align_mask = ( align - 1 ) | ( MIN_MEMBLOCK_SIZE - 1 );
80
-	DBG ( "Allocating %zx (aligned %zx)\n", size, align );
80
+	DBG ( "Allocating %#zx (aligned %#zx)\n", size, align );
81
 
81
 
82
 	/* Search through blocks for the first one with enough space */
82
 	/* Search through blocks for the first one with enough space */
83
 	list_for_each_entry ( block, &free_blocks, list ) {
83
 	list_for_each_entry ( block, &free_blocks, list ) {
92
 			pre   = block;
92
 			pre   = block;
93
 			block = ( ( ( void * ) pre   ) + pre_size );
93
 			block = ( ( ( void * ) pre   ) + pre_size );
94
 			post  = ( ( ( void * ) block ) + size     );
94
 			post  = ( ( ( void * ) block ) + size     );
95
-			DBG ( "[%p,%p) ->  [%p,%p) + [%p,%p)\n", pre,
95
+			DBG ( "[%p,%p) -> [%p,%p) + [%p,%p)\n", pre,
96
 			      ( ( ( void * ) pre ) + pre->size ), pre, block,
96
 			      ( ( ( void * ) pre ) + pre->size ), pre, block,
97
 			      post, ( ( ( void * ) pre ) + pre->size ) );
97
 			      post, ( ( ( void * ) pre ) + pre->size ) );
98
 			/* If there is a "post" block, add it in to
98
 			/* If there is a "post" block, add it in to
124
 		}
124
 		}
125
 	}
125
 	}
126
 
126
 
127
-	DBG ( "Failed to allocate %zx (aligned %zx)\n", size, align );
127
+	DBG ( "Failed to allocate %#zx (aligned %#zx)\n", size, align );
128
 	return NULL;
128
 	return NULL;
129
 }
129
 }
130
 
130
 
261
 
261
 
262
 	printf ( "Free block list:\n" );
262
 	printf ( "Free block list:\n" );
263
 	list_for_each_entry ( block, &free_blocks, list ) {
263
 	list_for_each_entry ( block, &free_blocks, list ) {
264
-		printf ( "[%p,%p] (size %zx)\n", block,
264
+		printf ( "[%p,%p] (size %#zx)\n", block,
265
 			 ( ( ( void * ) block ) + block->size ), block->size );
265
 			 ( ( ( void * ) block ) + block->size ), block->size );
266
 	}
266
 	}
267
 }
267
 }

+ 1
- 1
src/net/ethernet.c View File

140
 	static char buf[18]; /* "00:00:00:00:00:00" */
140
 	static char buf[18]; /* "00:00:00:00:00:00" */
141
 	uint8_t *eth_addr = ll_addr;
141
 	uint8_t *eth_addr = ll_addr;
142
 
142
 
143
-	sprintf ( buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
143
+	sprintf ( buf, "%02x:%02x:%02x:%02x:%02x:%02x",
144
 		  eth_addr[0], eth_addr[1], eth_addr[2],
144
 		  eth_addr[0], eth_addr[1], eth_addr[2],
145
 		  eth_addr[3], eth_addr[4], eth_addr[5] );
145
 		  eth_addr[3], eth_addr[4], eth_addr[5] );
146
 	return buf;
146
 	return buf;

Loading…
Cancel
Save