OSDN Git Service
(root)
/
coroid
/
ffmpeg_saccubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6873cf9
)
ffplay: compact expression in compute_mod()
author
Stefano Sabatini
<stefano.sabatini-lala@poste.it>
Sun, 2 May 2010 20:23:48 +0000
(22:23 +0200)
committer
Stefano Sabatini
<stefano.sabatini-lala@poste.it>
Mon, 11 Apr 2011 23:23:43 +0000
(
01:23
+0200)
Prefer "return X ? Y : Z" over "if (x) return Y; else return Z",
reduce line count.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
ffplay.c
patch
|
blob
|
history
diff --git
a/ffplay.c
b/ffplay.c
index
04e0343
..
4b6fe8b
100644
(file)
--- a/
ffplay.c
+++ b/
ffplay.c
@@
-771,11
+771,7
@@
static void video_image_display(VideoState *is)
static inline int compute_mod(int a, int b)
{
- a = a % b;
- if (a >= 0)
- return a;
- else
- return a + b;
+ return a < 0 ? a%b + b : a%b;
}
static void video_audio_display(VideoState *s)