serenity/Userland/Utilities
Lenny Maiorani 800ea8ea96 Userland: static vs non-static constexpr variables
Problem:
- `static` variables consume memory and sometimes are less
  optimizable.
- `static const` variables can be `constexpr`, usually.
- `static` function-local variables require an initialization check
  every time the function is run.

Solution:
- If a global `static` variable is only used in a single function then
  move it into the function and make it non-`static` and `constexpr`.
- Make all global `static` variables `constexpr` instead of `const`.
- Change function-local `static const[expr]` variables to be just
  `constexpr`.
2021-05-21 10:07:06 +01:00
..
adjtime.cpp
allocate.cpp
aplay.cpp
arp.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
avol.cpp
base64.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
basename.cpp
beep.cpp
bt.cpp Userland: Remove no-longer-needed unveil()'s of /tmp/rpc 2021-05-13 23:28:40 +02:00
cal.cpp
cat.cpp Utilities: Use Vector<String> positional arguments in some places 2021-04-29 11:28:01 +02:00
checksum.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
chgrp.cpp
chmod.cpp
chown.cpp
chres.cpp Userland: Update IPC calls to use proxies 2021-05-03 21:14:40 +02:00
chroot.cpp
cksum.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
clear.cpp
CMakeLists.txt Utilities: Rename CppParserTest => cpp-parser 2021-05-19 23:19:07 +02:00
copy.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
cp.cpp
cpp-parser.cpp LibCpp: Generalize ASTNode::dump() to support redirecting its output 2021-05-19 23:19:07 +02:00
crash.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
cut.cpp Everywhere: "indexes" => "indices" 2021-04-29 22:23:52 +02:00
date.cpp Userland: Fix 64-bit portability issues 2021-05-03 08:42:39 +02:00
dd.cpp dd: Add ability to use k, M, & G suffixes for block sizes 2021-05-08 10:03:31 +01:00
ddate.cpp Userland: static vs non-static constexpr variables 2021-05-21 10:07:06 +01:00
df.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
dirname.cpp
disasm.cpp Everywhere: Add missing includes for <AK/OwnPtr.h> 2021-05-19 21:36:57 +02:00
disk_benchmark.cpp
dmesg.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
du.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
echo.cpp
env.cpp
errno.cpp Utilities: Add errno utility 2021-05-15 23:51:50 +01:00
expr.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
false.cpp
fgrep.cpp
file.cpp LibCore+Userland: Add two more detectable formats 2021-05-18 19:57:53 +01:00
find.cpp Utilites: Make find respect lack of -L when iterating over directories 2021-05-18 08:11:42 +02:00
flock.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
fortune.cpp Userland: Migrate from arc4random_uniform() to get_random_uniform() 2021-05-14 22:24:02 +02:00
functrace.cpp Userland: Fix 64-bit portability issues 2021-05-03 08:42:39 +02:00
gml-format.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
grep.cpp Utilities: Fix grep match when reading from stdin 2021-05-20 23:53:06 +02:00
gron.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
groups.cpp Userland: Add groups program 2021-05-05 15:12:30 +01:00
gunzip.cpp Utilities: Use Vector<String> positional arguments in some places 2021-04-29 11:28:01 +02:00
gzip.cpp Utilities: Use Vector<String> positional arguments in some places 2021-04-29 11:28:01 +02:00
head.cpp Userland: Refactor head(1) to not use stdio 2021-05-04 22:36:58 +02:00
hexdump.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
host.cpp
hostname.cpp Userland: Move HOST_NAME_MAX to limits.h 2021-04-27 23:06:16 +02:00
id.cpp Everywhere: Remove empty line after function body opening curly brace 2021-04-25 20:20:00 +02:00
ifconfig.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
ini.cpp
jp.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
js.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
keymap.cpp Userland: Preserve keyboard mapping preference on reboot (#6955) 2021-05-09 15:56:03 +02:00
kill.cpp
killall.cpp
ln.cpp
ls.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
lsirq.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
lsof.cpp Utilities: Allow for white spaces in lsof name parsing 2021-05-19 09:13:12 +02:00
lspci.cpp Userland: static vs non-static constexpr variables 2021-05-21 10:07:06 +01:00
man.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
md.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
misbehaving-application.cpp
mkdir.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
mkfifo.cpp
mknod.cpp
mktemp.cpp LibC: Remove static from function local constexpr variable 2021-05-18 08:07:21 +02:00
modload.cpp
modunload.cpp
more.cpp
mount.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
mv.cpp Utilities: Fix mv command requesting incorrect path 2021-05-08 15:22:47 +02:00
nc.cpp
netstat.cpp Utilities: Implement a netstat command 2021-05-15 11:27:20 +01:00
nl.cpp
notify.cpp
nproc.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
ntpquery.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
open.cpp
pape.cpp
passwd.cpp LibC: Implement support for getspnam() and friends 2021-05-01 12:40:12 +02:00
paste.cpp Userland: Implement paste --watch mode 2021-05-10 19:09:53 +01:00
pathchk.cpp Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
pidof.cpp
ping.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
pmap.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
PreprocessorTest.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
printf.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
pro.cpp Services: Rename ProtocolServer to RequestServer 2021-04-25 19:04:34 +02:00
profile.cpp Kernel: Generate page fault events from the kernel profiler 2021-05-19 22:51:42 +02:00
ps.cpp
purge.cpp
readelf.cpp AK+Kernel+LibELF: Remove the need for IteratorDecision::Continue 2021-05-16 10:36:52 +01:00
readlink.cpp
realpath.cpp
reboot.cpp
rev.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
rm.cpp
rmdir.cpp Userland: Make rmdir take multiple paths 2021-04-26 09:32:42 +02:00
seq.cpp Utilities: Fix const-correctness inside seq 2021-05-14 22:24:02 +02:00
shot.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
shuf.cpp Userland: Migrate from arc4random_uniform() to get_random_uniform() 2021-05-14 22:24:02 +02:00
shutdown.cpp
sleep.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
sort.cpp
sql.cpp
stat.cpp LibC: Move makedev(), major(), minor(), to sys/types.h 2021-05-14 22:24:02 +02:00
strace.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
su.cpp
sync.cpp
syscall.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
sysctl.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
tac.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
tail.cpp LibCore+Everywhere: Move SeekMode out of IODevice 2021-05-12 11:00:45 +01:00
tar.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
tee.cpp
telws.cpp Utilities: Update telws to use the isolated WebSocket service 2021-04-25 19:04:34 +02:00
test-bindtodevice.cpp Everywhere: Use "the SerenityOS developers." in copyright headers 2021-04-29 00:59:26 +02:00
test-crypto.cpp LibCrypto: Add the SHA-384 hash algorithm 2021-05-19 09:18:45 +02:00
test-fuzz.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
test-pthread.cpp
test-unveil.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
test.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
test_efault.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
test_env.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
test_io.cpp
top.cpp Utilities: Make the STATE column for top slightly larger 2021-05-18 08:07:29 +02:00
touch.cpp
tr.cpp
traceroute.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
tree.cpp Userland: Move HOST_NAME_MAX to limits.h 2021-04-27 23:06:16 +02:00
true.cpp
truncate.cpp
tt.cpp LibC: Move mman.h to sys/mman.h 2021-05-14 22:24:02 +02:00
tty.cpp
umount.cpp
uname.cpp
uniq.cpp
unzip.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
uptime.cpp
useradd.cpp Everywhere: Add a blank line after copyright header where missing 2021-05-15 00:27:09 +01:00
userdel.cpp
utmpupdate.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
w.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
wasm.cpp LibWasm: Implement a very basic linker 2021-05-21 00:15:23 +01:00
watch.cpp Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
wc.cpp
which.cpp
whoami.cpp
xargs.cpp Everywhere: Use "the SerenityOS developers." in copyright headers 2021-04-29 00:59:26 +02:00
yes.cpp
zip.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00