Просмотр исходного кода

[gdb] Fix a compiler warning that shows up only when assertions are enabled

gcc should (I think) be warning about this anyway, but seems to do so
only when assertions are enabled for this object.
tags/v0.9.5
Michael Brown 17 лет назад
Родитель
Сommit
0015601f0b
1 измененных файлов: 2 добавлений и 2 удалений
  1. 2
    2
      src/arch/i386/core/gdbmach.c

+ 2
- 2
src/arch/i386/core/gdbmach.c Просмотреть файл

60
 }
60
 }
61
 
61
 
62
 static void gdbmach_commit_hwbp ( struct hwbp *bp ) {
62
 static void gdbmach_commit_hwbp ( struct hwbp *bp ) {
63
-	int regnum = bp - hwbps;
63
+	unsigned int regnum = bp - hwbps;
64
 
64
 
65
 	/* Set breakpoint address */
65
 	/* Set breakpoint address */
66
-	assert ( regnum >= 0 && regnum < sizeof hwbps / sizeof hwbps [ 0 ] );
66
+	assert ( regnum < ( sizeof hwbps / sizeof hwbps [ 0 ] ) );
67
 	switch ( regnum ) {
67
 	switch ( regnum ) {
68
 		case 0:
68
 		case 0:
69
 			__asm__ __volatile__ ( "movl %0, %%dr0\n" : : "r" ( bp->addr ) );
69
 			__asm__ __volatile__ ( "movl %0, %%dr0\n" : : "r" ( bp->addr ) );

Загрузка…
Отмена
Сохранить