Commit Graph

12 Commits (0b621292246f2736eeed82ef106f64749c058f68)

Author SHA1 Message Date
Orestis Floros 0b62129224
Remove unused headers
With help from
https://github.com/include-what-you-use/include-what-you-use/
2020-04-20 04:25:06 +02:00
Orestis Floros 3c522d9f2f
Sort includes in *.c files
Not enabling in .clang-format because it breaks headers files.

Used:
    IncludeCategories:
      - Regex:           '^<config'
        Priority:        0
      - Regex:           '^".*"'
        Priority:        1
      - Regex:           '^<(xcb|xkb|yajl|X11)'
        Priority:        3
      - Regex:           '.*'
        Priority:        2
2020-04-19 09:58:25 +02:00
Michael Stapelberg f354f53435 Ensure all *.[ch] files include config.h
Including config.h is necessary to get e.g. the _GNU_SOURCE define and
any other definitions that autoconf declares. Hence, config.h needs to
be included as the first header in each file.

This is done either via:
1. Including "common.h" (i3bar)
2. Including "libi3.h"
3. Including "all.h" (i3)
4. Including <config.h> directly

Also remove now-unused I3__FILE__, add copyright/license statement
where missing and switch include/all.h to #pragma once.
2016-10-23 21:09:24 +02:00
Deiz 884214f14f Update copyright notices and get rid of ranges
The script used to make these changes can be found at:

   https://gist.github.com/Deiz/32322020f76d23e2bf8f
2015-04-20 17:50:21 -04:00
hwangcc 42515308e7 Add a safe wrapper for write and fix some warnings
1. Add a function writeall and make swrite wrap that function. Use either writeall or swrite, depending on whether we want to exit on errors or not.
2. Fix warnings when compiling with a higher optimisation level.
(CFLAGS ?= -pipe -O3 -march=native -mtune=native -freorder-blocks-and-partition)

Signed-off-by: hwangcc <hwangcc@csie.nctu.edu.tw>
2015-03-29 10:22:34 +08:00
Michael Stapelberg 9200094203 format **/*.c with clang-format-3.5
This has multiple effects:

1) The i3 codebase is now consistently formatted. clang-format uncovered
   plenty of places where inconsistent code made it into our code base.

2) When writing code, you don’t need to think or worry about our coding
   style. Write it in yours, then run clang-format-3.5

3) When submitting patches, we don’t need to argue about coding style.

The basic idea is that we don’t want to care about _how_ we write the
code, but _what_ it does :). The coding style that we use is defined in
the .clang-format config file and is based on the google style, but
adapted in such a way that the number of modifications to the i3 code
base is minimal.
2014-06-15 19:07:02 +02:00
Peter Boström 9c15b9504e Fix clang -Wextra except -Wunused-parameter.
Cleared all warnings that occur when passing
CFLAGS="-Wall -Wextra -Wno-unused-parameter" to make using clang 3.3 on
Linux x86-64.
2014-01-02 22:15:33 +01:00
Michael Stapelberg 7b0d75ee0a ipc_send_message: use stack frame with fixed size 2013-01-11 19:09:41 +01:00
Michael Stapelberg f5b7bfb12e Bugfix: fix IPC messages writes with low buffer sizes (Thanks jasper, dcoppa)
Use the following command to reproduce this bug:

    echo 4096 | sudo tee /proc/sys/net/core/wmem_default

Then just switch workspaces with some windows on it and i3bar would
exit due to malformed IPC messages.

This bug hits OpenBSD users (and possibly other BSDs) due to their lower
default buffer size.

fixes #896
2013-01-09 18:11:03 +01:00
Michael Stapelberg 726f2a1e5a normalize file headers across **/*.{h,c} 2011-10-25 21:19:38 +01:00
Michael Stapelberg cb9bbcfccf Move get_colorpixel to libi3, use it everywhere else 2011-10-23 17:38:21 +01:00
Michael Stapelberg 046cf99585 Move ipc_send_message and ipc_recv_message to libi3
Make i3-msg and src/ipc.c use it
2011-10-02 18:33:36 +01:00