clang-modernize -use-nullptr

and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
This commit is contained in:
Tillmann Karras
2014-03-09 21:14:26 +01:00
parent f28116b7da
commit d802d39281
292 changed files with 1526 additions and 1526 deletions

View File

@ -134,7 +134,7 @@ static gdb_bp_t *gdb_bp_ptr(u32 type)
case GDB_BP_TYPE_A:
return bp_x;
default:
return NULL;
return nullptr;
}
}
@ -144,15 +144,15 @@ static gdb_bp_t *gdb_bp_empty_slot(u32 type)
u32 i;
p = gdb_bp_ptr(type);
if (p == NULL)
return NULL;
if (p == nullptr)
return nullptr;
for (i = 0; i < GDB_MAX_BP; i++) {
if (p[i].active == 0)
return &p[i];
}
return NULL;
return nullptr;
}
static gdb_bp_t *gdb_bp_find(u32 type, u32 addr, u32 len)
@ -161,8 +161,8 @@ static gdb_bp_t *gdb_bp_find(u32 type, u32 addr, u32 len)
u32 i;
p = gdb_bp_ptr(type);
if (p == NULL)
return NULL;
if (p == nullptr)
return nullptr;
for (i = 0; i < GDB_MAX_BP; i++) {
if (p[i].active == 1 &&
@ -171,7 +171,7 @@ static gdb_bp_t *gdb_bp_find(u32 type, u32 addr, u32 len)
return &p[i];
}
return NULL;
return nullptr;
}
static void gdb_bp_remove(u32 type, u32 addr, u32 len)
@ -180,12 +180,12 @@ static void gdb_bp_remove(u32 type, u32 addr, u32 len)
do {
p = gdb_bp_find(type, addr, len);
if (p != NULL) {
if (p != nullptr) {
DEBUG_LOG(GDB_STUB, "gdb: removed a breakpoint: %08x bytes at %08x\n", len, addr);
p->active = 0;
memset(p, 0, sizeof(gdb_bp_t));
}
} while (p != NULL);
} while (p != nullptr);
}
static int gdb_bp_check(u32 addr, u32 type)
@ -194,7 +194,7 @@ static int gdb_bp_check(u32 addr, u32 type)
u32 i;
p = gdb_bp_ptr(type);
if (p == NULL)
if (p == nullptr)
return 0;
for (i = 0; i < GDB_MAX_BP; i++) {
@ -288,7 +288,7 @@ static int gdb_data_available() {
t.tv_sec = 0;
t.tv_usec = 20;
if (select(sock + 1, fds, NULL, NULL, &t) < 0)
if (select(sock + 1, fds, nullptr, nullptr, &t) < 0)
{
ERROR_LOG(GDB_STUB, "select failed");
return 0;
@ -631,7 +631,7 @@ bool gdb_add_bp(u32 type, u32 addr, u32 len)
{
gdb_bp_t *bp;
bp = gdb_bp_empty_slot(type);
if (bp == NULL)
if (bp == nullptr)
return false;
bp->active = 1;