]> jfr.im git - irc/atheme/libmowgli-2.git/commit
All Source Files: Lots of header/macro/function cleanups
authorAaron Jones <redacted>
Tue, 15 Jan 2019 13:40:31 +0000 (13:40 +0000)
committerAaron Jones <redacted>
Tue, 15 Jan 2019 14:30:24 +0000 (14:30 +0000)
commit6d7d8edac8c528be1485eb517409aa14e359baa4
treee2363c7f27f87bf387dd60a2c6e071a37986401c
parenta481c2fa93c516b610d6e6556d203e3303e4570f
All Source Files: Lots of header/macro/function cleanups

- Consistently use 2 spaces for preprocessor directive indentation

- Ensure all header files can successfully compile stand-alone

- Rearrange inclusions in alphabetical order; now that each header
  can build by itself, it doesn't matter what order you use them in

- Replace compiler attributes macro header wholesale with the one from
  Atheme IRC Services

- Add lots of missing function attributes where applicable

  Memory allocation attributes in particular will be useful for
  static analysis; but you can't just add the malloc attribute to
  every function returning a newly-allocated pointer. The malloc
  attribute is used to declare functions that return newly-allocated
  memory, and if that return value is a pointer to a newly-allocated
  structure, and some of its members point to memory that existed
  before the function was called, then it is not entirely newly-
  allocated memory, and the optimizer might generate broken code
  with the faulty assumption given to it. So, a careful audit was
  required to identify functions that allocated memory without setting
  pointers in the resulting structures to point to things that existed
  before the allocating function was called.

- Remove unnecessary includes from source files

- Fix 2 broken parameter-less function prototypes

- Avoid using "#elif" preprocessor directive where it does not result
  in uglier output
67 files changed:
src/libmowgli/base/argstack.c
src/libmowgli/base/argstack.h
src/libmowgli/base/bitvector.c
src/libmowgli/base/bitvector.h
src/libmowgli/base/formatter.h
src/libmowgli/base/hook.c
src/libmowgli/base/hook.h
src/libmowgli/base/memslice.c
src/libmowgli/base/memslice.h
src/libmowgli/base/mowgli_signal.c
src/libmowgli/base/random.c
src/libmowgli/container/dictionary.h
src/libmowgli/container/index.c
src/libmowgli/container/index.h
src/libmowgli/container/list.c
src/libmowgli/container/list.h
src/libmowgli/container/patricia.h
src/libmowgli/container/queue.c
src/libmowgli/container/queue.h
src/libmowgli/core/alloc.c
src/libmowgli/core/alloc.h
src/libmowgli/core/allocation_policy.c
src/libmowgli/core/allocation_policy.h
src/libmowgli/core/allocator.c
src/libmowgli/core/allocator.h
src/libmowgli/core/assert.h
src/libmowgli/core/bootstrap.c
src/libmowgli/core/heap.h
src/libmowgli/core/logger.c
src/libmowgli/core/logger.h
src/libmowgli/core/mowgli_string.h
src/libmowgli/core/process.h
src/libmowgli/core/stdinc.h
src/libmowgli/dns/dns.h
src/libmowgli/dns/evloop_res.c
src/libmowgli/dns/evloop_res.h
src/libmowgli/eventloop/eventloop.h
src/libmowgli/eventloop/windows_pollops.c
src/libmowgli/ext/confparse.c
src/libmowgli/ext/confparse.h
src/libmowgli/ext/error_backtrace.h
src/libmowgli/ext/getopt_long.c
src/libmowgli/ext/global_storage.c
src/libmowgli/ext/json-inline.h
src/libmowgli/ext/json.c
src/libmowgli/ext/json.h
src/libmowgli/ext/proctitle.h
src/libmowgli/ext/program_opts.c
src/libmowgli/ext/program_opts.h
src/libmowgli/linebuf/linebuf.h
src/libmowgli/module/interface.c
src/libmowgli/module/module.h
src/libmowgli/mowgli.h
src/libmowgli/object/class.c
src/libmowgli/object/class.h
src/libmowgli/object/message.h
src/libmowgli/object/metadata.h
src/libmowgli/object/object.h
src/libmowgli/platform/attributes.h
src/libmowgli/platform/cacheline.c
src/libmowgli/platform/cacheline.h
src/libmowgli/platform/constructor.h
src/libmowgli/platform/machine.h
src/libmowgli/platform/win32/win32_stdinc.h
src/libmowgli/thread/mutex.h
src/libmowgli/thread/thread.h
src/libmowgli/vio/vio.h