[FFmpeg-cvslog] cpu: Restructure code to avoid pointless ret variable indirection
Diego Biurrun
git at videolan.org
Mon Jun 3 12:04:30 CEST 2013
ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Sat Jun 1 15:38:51 2013 +0200| [f0ce1d9909efeb72ea8eefd44d447b7bada1a20c] | committer: Diego Biurrun
cpu: Restructure code to avoid pointless ret variable indirection
libavutil/cpu.c:133:9: warning: unused variable ‘ret’ [-Wunused-variable]
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f0ce1d9909efeb72ea8eefd44d447b7bada1a20c
---
libavutil/cpu.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 17273b6..6384d6d 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -130,27 +130,23 @@ int av_parse_cpu_flags(const char *s)
int av_cpu_count(void)
{
- int ret, nb_cpus = 1;
+ int nb_cpus = 1;
#if HAVE_SCHED_GETAFFINITY && defined(CPU_COUNT)
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
- ret = sched_getaffinity(0, sizeof(cpuset), &cpuset);
- if (!ret) {
+ if (!sched_getaffinity(0, sizeof(cpuset), &cpuset))
nb_cpus = CPU_COUNT(&cpuset);
- }
#elif HAVE_GETPROCESSAFFINITYMASK
DWORD_PTR proc_aff, sys_aff;
- ret = GetProcessAffinityMask(GetCurrentProcess(), &proc_aff, &sys_aff);
- if (ret)
+ if (GetProcessAffinityMask(GetCurrentProcess(), &proc_aff, &sys_aff))
nb_cpus = av_popcount64(proc_aff);
#elif HAVE_SYSCTL && defined(HW_NCPU)
int mib[2] = { CTL_HW, HW_NCPU };
size_t len = sizeof(nb_cpus);
- ret = sysctl(mib, 2, &nb_cpus, &len, NULL, 0);
- if (ret == -1)
+ if (sysctl(mib, 2, &nb_cpus, &len, NULL, 0) == -1)
nb_cpus = 0;
#elif HAVE_SYSCONF && defined(_SC_NPROC_ONLN)
nb_cpus = sysconf(_SC_NPROC_ONLN);
More information about the ffmpeg-cvslog
mailing list