Browse Source

fix printf format args

tags/v0.9.3
Marty Connor 18 years ago
parent
commit
eb091f03e3
2 changed files with 6 additions and 5 deletions
  1. 5
    5
      src/core/debug.c
  2. 1
    0
      src/core/image.c

+ 5
- 5
src/core/debug.c View File

25
 			more();
25
 			more();
26
 		}
26
 		}
27
 		if ( ( index % 16 ) == 0 ) {
27
 		if ( ( index % 16 ) == 0 ) {
28
-			printf ( "%X [%X] : %hX :", data + index,
28
+			printf ( "%p [%lX] : %X :", data + index,
29
 				 virt_to_phys ( data + index ), index );
29
 				 virt_to_phys ( data + index ), index );
30
 		}
30
 		}
31
-		printf ( " %hhX", data[index] );
31
+		printf ( " %02X", data[index] );
32
 	}
32
 	}
33
 	printf ( "\n" );
33
 	printf ( "\n" );
34
 }
34
 }
64
 			/* Start of corruption */
64
 			/* Start of corruption */
65
 			if ( corrupted == 0 ) {
65
 			if ( corrupted == 0 ) {
66
 				corrupted = 1;
66
 				corrupted = 1;
67
-				printf ( "Region %#x-%#x (physical %#x-%#x) "
67
+				printf ( "Region %p-%p (physical %#lx-%#lx) "
68
 					 "corrupted\n",
68
 					 "corrupted\n",
69
 					 region, region + len,
69
 					 region, region + len,
70
 					 virt_to_phys ( region ),
70
 					 virt_to_phys ( region ),
71
 					 virt_to_phys ( region + len ) );
71
 					 virt_to_phys ( region + len ) );
72
 			}
72
 			}
73
 			in_corruption = 1;
73
 			in_corruption = 1;
74
-			printf ( "--- offset %#x ", offset );
74
+			printf ( "--- offset %#lx ", offset );
75
 		} else if ( ( in_corruption != 0 ) &&
75
 		} else if ( ( in_corruption != 0 ) &&
76
 			    ( test == GUARD_SYMBOL ) ) {
76
 			    ( test == GUARD_SYMBOL ) ) {
77
 			/* End of corruption */
77
 			/* End of corruption */
78
 			in_corruption = 0;
78
 			in_corruption = 0;
79
-			printf ( "to offset %#x", offset );
79
+			printf ( "to offset %#lx", offset );
80
 		}
80
 		}
81
 
81
 
82
 	}
82
 	}

+ 1
- 0
src/core/image.c View File

2
 #include "buffer.h"
2
 #include "buffer.h"
3
 #include "load_buffer.h"
3
 #include "load_buffer.h"
4
 #include "image.h"
4
 #include "image.h"
5
+#include <console.h>
5
 
6
 
6
 static struct image images[0] __image_start;
7
 static struct image images[0] __image_start;
7
 static struct image images_end[0] __image_end;
8
 static struct image images_end[0] __image_end;

Loading…
Cancel
Save