switch(fd) { case 0: f = freopen(_PATH_DEVNULL, r, stdin); break; case 1: f = freopen(_PATH_DEVNULL, w, stdout); break; case 2: f = freopen(_PATH_DEVNULL, w, stderr); break; default: f = NULL; break; }
f = (fd == 0) ? freopen(_PATH_DEVNULL, r, stdin) : (fd == 1) ? freopen(_PATH_DEVNULL, w, stdout) : (fd == 2) ? freopen(_PATH_DEVNULL, w, stderr) : NULL;
f = NULL; if (fd >= 0 && fd <= 2) f = ((FILE*[]){ freopen(_PATH_DEVNULL, r, stdin) , freopen(_PATH_DEVNULL, w, stdout) , freopen(_PATH_DEVNULL, w, stderr) })[fd];