pinosaur
/
smdp.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
74ee020
)
Use `MAX()` to make codes more readable.
author
FreeBirdLjj
<ljj11011@mail.ustc.edu.cn>
Sat, 4 Oct 2014 13:03:02 +0000
(21:03 +0800)
committer
FreeBirdLjj
<ljj11011@mail.ustc.edu.cn>
Sat, 4 Oct 2014 13:03:02 +0000
(21:03 +0800)
src/viewer.c
patch
|
blob
|
history
diff --git
a/src/viewer.c
b/src/viewer.c
index
4031948
..
a82b0d0
100644
(file)
--- a/
src/viewer.c
+++ b/
src/viewer.c
@@
-117,7
+117,7
@@
int ncurses_display(deck_t *deck, int notrans, int nofade, int invert) {
}
// set max_cols
}
// set max_cols
- max_cols =
(i > max_cols) ? i : max_cols
;
+ max_cols =
MAX(i, max_cols)
;
// iterate to next line
offset = prev_blank(line->text, offset + COLS);
// iterate to next line
offset = prev_blank(line->text, offset + COLS);
@@
-125,16
+125,16
@@
int ncurses_display(deck_t *deck, int notrans, int nofade, int invert) {
lc++;
}
// set max_cols one last time
lc++;
}
// set max_cols one last time
- max_cols =
(i > max_cols) ? i : max_cols
;
+ max_cols =
MAX(i, max_cols)
;
} else {
// set max_cols
} else {
// set max_cols
- max_cols =
(line->length > max_cols) ? line->length : max_cols
;
+ max_cols =
MAX(line->length, max_cols)
;
}
lc++;
line = line->next;
}
}
lc++;
line = line->next;
}
- max_lines =
(lc > max_lines) ? lc : max_lines
;
+ max_lines =
MAX(lc, max_lines)
;
slide = slide->next;
}
slide = slide->next;
}