mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Comparing the address of a member to 0 is pointless
Or... this code doesn't do what you think it does. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2c0223fbb2
commit
895d6e0000
2 changed files with 3 additions and 3 deletions
4
dive.c
4
dive.c
|
@ -1055,10 +1055,10 @@ static struct event *find_previous_event(struct divecomputer *dc, struct event *
|
||||||
struct event *ev = dc->events;
|
struct event *ev = dc->events;
|
||||||
struct event *previous = NULL;
|
struct event *previous = NULL;
|
||||||
|
|
||||||
if (!event->name)
|
if (same_string(event->name, ""))
|
||||||
return NULL;
|
return NULL;
|
||||||
while (ev && ev != event) {
|
while (ev && ev != event) {
|
||||||
if (ev->name && !strcmp(ev->name, event->name))
|
if (same_string(ev->name, event->name))
|
||||||
previous = ev;
|
previous = ev;
|
||||||
ev = ev->next;
|
ev = ev->next;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1329,7 +1329,7 @@ void ProfileWidget2::hideEvents()
|
||||||
if (QMessageBox::question(MainWindow::instance(),
|
if (QMessageBox::question(MainWindow::instance(),
|
||||||
TITLE_OR_TEXT(tr("Hide events"), tr("Hide all %1 events?").arg(event->name)),
|
TITLE_OR_TEXT(tr("Hide events"), tr("Hide all %1 events?").arg(event->name)),
|
||||||
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
|
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
|
||||||
if (event->name) {
|
if (!same_string(event->name, "")) {
|
||||||
for (int i = 0; i < evn_used; i++) {
|
for (int i = 0; i < evn_used; i++) {
|
||||||
if (same_string(event->name, ev_namelist[i].ev_name)) {
|
if (same_string(event->name, ev_namelist[i].ev_name)) {
|
||||||
ev_namelist[i].plot_ev = false;
|
ev_namelist[i].plot_ev = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue