Treat tabs as having eight spaces instead of four
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 12 Mar 2019 23:41:50 +0000 (19:41 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Sun, 24 Mar 2019 02:43:40 +0000 (22:43 -0400)
commite2e76c34b4eb027eec44bf0ab81523c4359aa6a3
tree3eca4045e92c0c6a5cb86ca14be6f422b6de415a
parentf7e6779c382d2f6f68488662a6cbd6093764f821
Treat tabs as having eight spaces instead of four

For whatever bad reason, we chose to treat tabs as four spaces instead
of eight.  e.g. in vim, tabstop=4.

That's a huge pain - both when dealing with other tools and when
switching between projects.  I don't particularly like having
per-project vim settings and whatnot.  Plus, that's a bit harder for
other people who look at our code and have their vim/emacs set to 8
space tabs.

I had regretted that for a long time, but I didn't want to make the
change for two reasons:

1) With other people working on the project, changes of this sort can
lead to merge conflicts.  Since I'm the only one working on it, for the
most part, this isn't a concern.

2) The bigger reason is that major reformatting changes break git blame.
However, there are tools that can ignore commits when running git blame.
Chromium has git hyper-blame.  I thought that feature ought to be baked
into git, so I have a patchset out for git to do so.  Either way, I'll
either have my own patched git or the feature will get merged.  In a
future commit, I'll have instructions for how to use that feature.

A lot of our files didn't need too much attention, due to our old
"spaces for formatting" policy.  I didn't change those to use tabs
instead of spaces for the formatting either.  I expect newer code will
just do whatever people's editors do.  I didn't want to change more
lines than were needed, and the code looks the same either way.

The biggest offenders were indented comments.  Structs with
column-aligned members needed some work too.  I did most of that stuff
manually, since the tools do a mediocre job.

Since I was making changes, I also fixed up the switch-case indenting:
don't do an extra level of indentation for the case keywords.  Doing
this now actually helped with the 8-space tab change, since switch
statements got a few spaces to work with.

A few of the kernel's C files were so badly messed up that I just used
clang-format on them.  Same for Plan 9 files that had been
clang-formatted before and hadn't been heavily modified by us.
Clang-format caused a few problems with its "alphabetized headers"
policy.  That was fun.

Higher-quality (subjectively) code didn't need as much work as older,
poorer code.  Specifically, code with way too many levels of indentation
looks even worse than before - that's actually a benefit of 8-space
tabs: it tells you when your code is bad.  A lot of that older code
needs a more serious refactoring, which this commit does not do.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
528 files changed:
.clang-format
Documentation/Contributing.md
kern/arch/riscv/arch.h
kern/arch/riscv/cboot.c
kern/arch/riscv/console.c
kern/arch/riscv/cpuinfo.c
kern/arch/riscv/env.c
kern/arch/riscv/fpu.c
kern/arch/riscv/init.c
kern/arch/riscv/kdebug.c
kern/arch/riscv/page_alloc.c
kern/arch/riscv/pmap.c
kern/arch/riscv/pmap_ops.h
kern/arch/riscv/process.c
kern/arch/riscv/riscv.h
kern/arch/riscv/ros/arch.h
kern/arch/riscv/ros/cpu_feat.h
kern/arch/riscv/ros/mmu.h
kern/arch/riscv/ros/trapframe.h
kern/arch/riscv/smp.c
kern/arch/riscv/time.c
kern/arch/riscv/trap.c
kern/arch/riscv/uaccess.h
kern/arch/x86/apic.c
kern/arch/x86/apic.h
kern/arch/x86/apic9.c
kern/arch/x86/arch.h
kern/arch/x86/atomic.h
kern/arch/x86/boot/main.c
kern/arch/x86/console.c
kern/arch/x86/console.h
kern/arch/x86/cpuinfo.c
kern/arch/x86/devarch.c
kern/arch/x86/idle.c
kern/arch/x86/init.c
kern/arch/x86/intel.c
kern/arch/x86/io.h
kern/arch/x86/ioapic.c
kern/arch/x86/ioapic.h
kern/arch/x86/kclock.c
kern/arch/x86/kdebug.c
kern/arch/x86/kdebug.h
kern/arch/x86/kpt.h
kern/arch/x86/mp.c
kern/arch/x86/mpacpi.c
kern/arch/x86/msi.c
kern/arch/x86/msr.h
kern/arch/x86/page_alloc.c
kern/arch/x86/pci.c
kern/arch/x86/pci.h
kern/arch/x86/perfmon.c
kern/arch/x86/perfmon.h
kern/arch/x86/pic.c
kern/arch/x86/pic.h
kern/arch/x86/pmap.c
kern/arch/x86/pmap64.c
kern/arch/x86/pmap_ops.h
kern/arch/x86/process64.c
kern/arch/x86/rdtsc_test.c
kern/arch/x86/ros/cpu_feat.h
kern/arch/x86/ros/mmu64.h
kern/arch/x86/ros/msr-index.h
kern/arch/x86/ros/syscall64.h
kern/arch/x86/ros/trapframe.h
kern/arch/x86/ros/trapframe64.h
kern/arch/x86/ros/vmm.h
kern/arch/x86/smp.c
kern/arch/x86/smp_boot.c
kern/arch/x86/time.c
kern/arch/x86/topology.c
kern/arch/x86/topology.h
kern/arch/x86/trap.c
kern/arch/x86/trap.h
kern/arch/x86/trap64.c
kern/arch/x86/trap64.h
kern/arch/x86/uaccess.h
kern/arch/x86/usb.c
kern/arch/x86/vmm/ept.h
kern/arch/x86/vmm/intel/vmx.c
kern/arch/x86/vmm/intel/vmx.h
kern/arch/x86/vmm/vmm.c
kern/arch/x86/vmm/vmm.h
kern/arch/x86/x86.h
kern/drivers/dev/acpi.c
kern/drivers/dev/alarm.c
kern/drivers/dev/capability.c
kern/drivers/dev/cons.c
kern/drivers/dev/ether.c
kern/drivers/dev/eventfd.c
kern/drivers/dev/gtfs.c
kern/drivers/dev/kfs.c
kern/drivers/dev/kprof.c
kern/drivers/dev/mem.c
kern/drivers/dev/mnt.c
kern/drivers/dev/pci.c
kern/drivers/dev/pipe.c
kern/drivers/dev/proc.c
kern/drivers/dev/random.c
kern/drivers/dev/regress.c
kern/drivers/dev/sd.c
kern/drivers/dev/sdiahci.c
kern/drivers/dev/sdscsi.c
kern/drivers/dev/srv.c
kern/drivers/dev/tmpfs.c
kern/drivers/dev/vars.c
kern/drivers/dev/version.c
kern/drivers/net/bnx2x/bnx2x_cmn.c
kern/drivers/net/bnx2x/bnx2x_dev.c
kern/drivers/net/ether8139.c
kern/drivers/net/ether82563.c
kern/drivers/net/etherigbe.c
kern/drivers/net/ethermii.c
kern/drivers/net/ethermii.h
kern/drivers/net/mlx4/en_netdev.c
kern/drivers/net/mlx4/en_rx.c
kern/drivers/net/mlx4/en_tx.c
kern/drivers/net/mlx4/main.c
kern/drivers/net/mlx4/mlx4_en.h
kern/drivers/net/mlx4u/main.c
kern/drivers/net/r8169.c
kern/drivers/net/udrvr/compat.c
kern/drivers/net/udrvr/umem.c
kern/drivers/net/udrvr/uverbs.h
kern/drivers/timers/hpet.c
kern/include/acpi.h
kern/include/address_range.h
kern/include/alarm.h
kern/include/apipe.h
kern/include/arena.h
kern/include/atomic.h
kern/include/bitmask.h
kern/include/bitops.h
kern/include/circular_buffer.h
kern/include/common.h
kern/include/compat_todo.h
kern/include/core_set.h
kern/include/corealloc_fcfs.h
kern/include/corealloc_packed.h
kern/include/cpio.h
kern/include/debug.h
kern/include/devalarm.h
kern/include/elf.h
kern/include/env.h
kern/include/err.h
kern/include/fdtap.h
kern/include/fs_file.h
kern/include/hash_helper.h
kern/include/hashtable.h
kern/include/kdebug.h
kern/include/kmalloc.h
kern/include/kstack.h
kern/include/ktest.h
kern/include/kthread.h
kern/include/linker_func.h
kern/include/linux_compat.h
kern/include/mm.h
kern/include/net/ip.h
kern/include/net/tcp.h
kern/include/ns.h
kern/include/page_alloc.h
kern/include/pagemap.h
kern/include/percpu.h
kern/include/pmap.h
kern/include/pool.h
kern/include/process.h
kern/include/profiler.h
kern/include/radix.h
kern/include/rcu.h
kern/include/refd_pages.h
kern/include/rendez.h
kern/include/ros/atomic.h
kern/include/ros/bcq.h
kern/include/ros/bcq_struct.h
kern/include/ros/bitfield.h
kern/include/ros/bits/event.h
kern/include/ros/bits/syscall.h
kern/include/ros/ceq.h
kern/include/ros/common.h
kern/include/ros/cpu_feat.h
kern/include/ros/evbitmap.h
kern/include/ros/event.h
kern/include/ros/fdtap.h
kern/include/ros/fs.h
kern/include/ros/mman.h
kern/include/ros/procdata.h
kern/include/ros/procinfo.h
kern/include/ros/profiler_records.h
kern/include/ros/resource.h
kern/include/ros/ring_syscall.h
kern/include/ros/syscall.h
kern/include/ros/trapframe.h
kern/include/ros/ucq.h
kern/include/ros/vmm.h
kern/include/rwlock.h
kern/include/schedule.h
kern/include/slab.h
kern/include/smp.h
kern/include/syscall.h
kern/include/taskqueue.h
kern/include/termios.h
kern/include/test_infrastructure.h
kern/include/time.h
kern/include/trace.h
kern/include/trap.h
kern/include/tree_file.h
kern/lib/address_range.c
kern/lib/circular_buffer.c
kern/lib/cpio.c
kern/lib/random/fortuna.c
kern/lib/random/rijndael.c
kern/lib/random/sha2.c
kern/lib/slice.c
kern/src/alarm.c
kern/src/apipe.c
kern/src/arena.c
kern/src/arsc.c
kern/src/atomic.c
kern/src/ceq.c
kern/src/corealloc_fcfs.c
kern/src/corealloc_packed.c
kern/src/coreprov.c
kern/src/elf.c
kern/src/env.c
kern/src/err.c
kern/src/event.c
kern/src/ex_table.c
kern/src/fdtap.c
kern/src/hashtable.c
kern/src/hexdump.c
kern/src/init.c
kern/src/kdebug.c
kern/src/kmalloc.c
kern/src/ktest/ktest.c
kern/src/ktest/net_ktests.c
kern/src/ktest/pb_ktests.c
kern/src/kthread.c
kern/src/manager.c
kern/src/mm.c
kern/src/monitor.c
kern/src/multiboot.c
kern/src/net/arp.c
kern/src/net/devip.c
kern/src/net/dial.c
kern/src/net/eipconv.c
kern/src/net/ethermedium.c
kern/src/net/icmp.c
kern/src/net/icmp6.c
kern/src/net/ip.c
kern/src/net/ipaux.c
kern/src/net/ipifc.c
kern/src/net/iproute.c
kern/src/net/ipv6.c
kern/src/net/loopbackmedium.c
kern/src/net/netif.c
kern/src/net/netlog.c
kern/src/net/nullmedium.c
kern/src/net/pktmedium.c
kern/src/net/tcp.c
kern/src/net/udp.c
kern/src/ns/allocb.c
kern/src/ns/chan.c
kern/src/ns/cleanname.c
kern/src/ns/convM2D.c
kern/src/ns/convM2S.c
kern/src/ns/convM2kdirent.c
kern/src/ns/convS2M.c
kern/src/ns/dev.c
kern/src/ns/devtab.c
kern/src/ns/fs_file.c
kern/src/ns/parse.c
kern/src/ns/qio.c
kern/src/ns/sysfile.c
kern/src/ns/tokenize.c
kern/src/ns/tree_file.c
kern/src/ns/util.c
kern/src/pagemap.c
kern/src/percpu.c
kern/src/pmap.c
kern/src/printfmt.c
kern/src/process.c
kern/src/profiler.c
kern/src/radix.c
kern/src/rcu.c
kern/src/readline.c
kern/src/rendez.c
kern/src/rwlock.c
kern/src/schedule.c
kern/src/slab.c
kern/src/smallidpool.c
kern/src/smp.c
kern/src/string.c
kern/src/syscall.c
kern/src/taskqueue.c
kern/src/time.c
kern/src/trap.c
kern/src/ucq.c
kern/src/umem.c
scripts/checkpatch.pl
scripts/lindent
scripts/parse_errno.sh
tests/alarm.c
tests/bind.c
tests/block_test.c
tests/childfdmap.c
tests/cs.c
tests/csquery.c
tests/daemonize.c
tests/draw_nanwan.c
tests/dune/dune.c
tests/epoll_server.c
tests/evq_block.c
tests/file_test.c
tests/futex_timeout.c
tests/gai.c
tests/get_html.c
tests/getifaddrs.c
tests/interference.c
tests/linux-lock-hacks.h
tests/listen1.c
tests/listener.c
tests/lock_test.c
tests/microb_test.c
tests/misc-compat.h
tests/mmap.c
tests/mmap_file_vmm.c
tests/mount.c
tests/netstat.c
tests/notify.c
tests/peek.c
tests/ping.c
tests/pipetest.c
tests/printf-ext.c
tests/prov.c
tests/pthread_barrier_test.c
tests/pthread_cleanup_test.c
tests/pthread_switch.c
tests/pthread_test.c
tests/query.c
tests/select_server.c
tests/signal_futex.c
tests/stat.c
tests/strace.c
tests/testclone.c
tests/timerfd.c
tests/trandom.c
tests/ttcp.c
tests/turbo.c
tests/usleep.c
tests/vmm/vmrunkernel.c
tests/xmm.c
tools/apps/ipconfig/dhcp.h
tools/apps/ipconfig/ipconfig.h
tools/apps/ipconfig/ipv6.c
tools/apps/ipconfig/main.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/accept4.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/bind.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/bits/libc-lock.h
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/connect.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/convM2D.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/convM2S.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/convS2M.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/dl-execstack.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/eventfd.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/execve.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/fcall.h
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/fcntl.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getaddrinfo.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/gethstbynm2.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/gethstbynm2_r.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getpeername.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getsockname.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getsockopt.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getsrvbypt_r.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/kill.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/listen.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/lseek.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/lseek64.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/malloc-machine.h
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/nanosleep.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/parlib-compat.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/plan9_sockets.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/recvfrom.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sbrk.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sendmsg.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sendto.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/serialize.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/setsockopt.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sigaction.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/socket.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/socketpair.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sys/close_cb.h
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sys/fork_cb.h
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sys/plan9_helpers.h
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sys/user_fd.h
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/syscall.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/time.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/timerfd.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/tls.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/user_fd.c
tools/dev-util/perf/perf.c
tools/dev-util/perf/perf_core.c
tools/dev-util/perf/perf_core.h
tools/dev-util/perf/perf_format.h
tools/dev-util/perf/perfconv.c
tools/dev-util/perf/perfconv.h
tools/dev-util/perf/xlib.c
tools/dev-util/perf/xlib.h
user/benchutil/include/benchutil/measure.h
user/benchutil/measure.c
user/electric-fence/efence.c
user/electric-fence/eftest.c
user/electric-fence/print.c
user/iplib/dial.c
user/iplib/epoll.c
user/iplib/ifaddrs.c
user/iplib/include/iplib/iplib.h
user/iplib/netmkaddr.c
user/iplib/parseip.c
user/iplib/poll.c
user/iplib/readipifc.c
user/iplib/select.c
user/ndblib/dnsquery.c
user/ndblib/include/ndblib/ndb.h
user/ndblib/include/ndblib/ndbhf.h
user/ndblib/ndbcat.c
user/ndblib/ndbfree.c
user/ndblib/ndbgetipaddr.c
user/ndblib/ndbipinfo.c
user/parlib/alarm.c
user/parlib/asynccall.c
user/parlib/ceq.c
user/parlib/core_set.c
user/parlib/debug.c
user/parlib/dtls.c
user/parlib/evbitmap.c
user/parlib/event.c
user/parlib/hexdump.c
user/parlib/include/parlib/alarm.h
user/parlib/include/parlib/assert.h
user/parlib/include/parlib/bitmask.h
user/parlib/include/parlib/event.h
user/parlib/include/parlib/kref.h
user/parlib/include/parlib/parlib.h
user/parlib/include/parlib/pool.h
user/parlib/include/parlib/printf-ext.h
user/parlib/include/parlib/riscv/arch.h
user/parlib/include/parlib/riscv/atomic.h
user/parlib/include/parlib/riscv/vcore.h
user/parlib/include/parlib/signal.h
user/parlib/include/parlib/stdio.h
user/parlib/include/parlib/tsc-compat.h
user/parlib/include/parlib/uthread.h
user/parlib/include/parlib/vcore.h
user/parlib/include/parlib/waitfreelist.h
user/parlib/include/parlib/x86/arch.h
user/parlib/include/parlib/x86/atomic.h
user/parlib/include/parlib/x86/trap.h
user/parlib/include/parlib/x86/vcore.h
user/parlib/mcs.c
user/parlib/mutex.c
user/parlib/net.c
user/parlib/panic.c
user/parlib/parlib.c
user/parlib/poke.c
user/parlib/printf-ext.c
user/parlib/pvcalarm.c
user/parlib/riscv/vcore.c
user/parlib/signal.c
user/parlib/slab.c
user/parlib/spinlock.c
user/parlib/syscall.c
user/parlib/thread0_sched.c
user/parlib/ucq.c
user/parlib/uthread.c
user/parlib/vcore.c
user/parlib/vcore_tick.c
user/parlib/waitfreelist.c
user/parlib/x86/vcore.c
user/pthread/pthread.c
user/pthread/pthread.h
user/pthread/semaphore.h
user/utest/alarm.c
user/utest/atexit.c
user/utest/cv.c
user/utest/dtls.c
user/utest/efence.c
user/utest/example.c
user/utest/file-posix.c
user/utest/include/utest.h
user/utest/mmap_pf.c
user/utest/pthread.c
user/utest/pvcalarm.c
user/utest/qio.c
user/utest/signal.c
user/vmm/apic.c
user/vmm/biostables.c
user/vmm/decode.c
user/vmm/include/vmm/net.h
user/vmm/include/vmm/sched.h
user/vmm/include/vmm/virtio_balloon.h
user/vmm/include/vmm/virtio_config.h
user/vmm/include/vmm/virtio_lguest_helpers.h
user/vmm/include/vmm/virtio_mmio.h
user/vmm/include/vmm/virtio_pci.h
user/vmm/include/vmm/virtio_ring.h
user/vmm/include/vmm/virtio_scsi.h
user/vmm/include/vmm/vmm.h
user/vmm/include/vmm/vthread.h
user/vmm/io.c
user/vmm/ioapic.c
user/vmm/linuxemu.c
user/vmm/load_elf.c
user/vmm/memory.c
user/vmm/nat.c
user/vmm/pagetables.c
user/vmm/sched.c
user/vmm/util.c
user/vmm/virtio.c
user/vmm/virtio_blk.c
user/vmm/virtio_lguest_console.c
user/vmm/virtio_lguest_helpers.c
user/vmm/virtio_mmio.c
user/vmm/virtio_net.c
user/vmm/vmexit.c
user/vmm/vmm.c
user/vmm/vmx.c
user/vmm/vmxmsr.c
user/vmm/vthread.c