diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | array.c | 4 | ||||
| -rw-r--r-- | array.h | 3 | ||||
| -rw-r--r-- | buffer.c | 5 | ||||
| -rw-r--r-- | buffer.h | 2 | ||||
| -rwxr-xr-x | configure | 2 | ||||
| -rw-r--r-- | event-basic.c | 2 | ||||
| -rw-r--r-- | map.c | 3 | ||||
| -rw-r--r-- | sam.c | 9 | ||||
| -rw-r--r-- | test/core/array-test.c | 7 | ||||
| -rw-r--r-- | test/core/buffer-test.c | 8 | ||||
| -rw-r--r-- | test/core/map-test.c | 7 | ||||
| -rw-r--r-- | test/core/text-test.c | 11 | ||||
| -rw-r--r-- | text-common.c | 3 | ||||
| -rw-r--r-- | text-internal.h | 2 | ||||
| -rw-r--r-- | text-io.c | 16 | ||||
| -rw-r--r-- | text-iterator.c | 5 | ||||
| -rw-r--r-- | text-motions.c | 6 | ||||
| -rw-r--r-- | text-motions.h | 1 | ||||
| -rw-r--r-- | text-objects.c | 4 | ||||
| -rw-r--r-- | text-objects.h | 1 | ||||
| -rw-r--r-- | text-regex-tre.c | 5 | ||||
| -rw-r--r-- | text-regex.c | 3 | ||||
| -rw-r--r-- | text-util.c | 3 | ||||
| -rw-r--r-- | text-util.h | 2 | ||||
| -rw-r--r-- | text.c | 15 | ||||
| -rw-r--r-- | text.h | 8 | ||||
| -rw-r--r-- | ui-terminal-curses.c | 1 | ||||
| -rw-r--r-- | ui-terminal.c | 17 | ||||
| -rw-r--r-- | ui.h | 4 | ||||
| -rw-r--r-- | util.h | 36 | ||||
| -rw-r--r-- | view.c | 8 | ||||
| -rw-r--r-- | view.h | 3 | ||||
| -rw-r--r-- | vis-cmds.c | 1 | ||||
| -rw-r--r-- | vis-core.h | 2 | ||||
| -rw-r--r-- | vis-lua.c | 10 | ||||
| -rw-r--r-- | vis-menu.c | 3 | ||||
| -rw-r--r-- | vis-modes.c | 2 | ||||
| -rw-r--r-- | vis-motions.c | 3 | ||||
| -rw-r--r-- | vis-operators.c | 2 | ||||
| -rw-r--r-- | vis-prompt.c | 1 | ||||
| -rw-r--r-- | vis-registers.c | 3 | ||||
| -rw-r--r-- | vis-subprocess.c | 7 | ||||
| -rw-r--r-- | vis-subprocess.h | 1 | ||||
| -rw-r--r-- | vis.c | 25 |
45 files changed, 52 insertions, 216 deletions
@@ -9,7 +9,7 @@ DOCUMENTATION = LICENSE README.md VERSION = $(shell git describe --always --dirty 2>/dev/null || echo "v0.9-git") -CFLAGS_STD ?= -std=c99 -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -DNDEBUG +CFLAGS_STD ?= -std=c99 -DNDEBUG CFLAGS_STD += -DVERSION=\"${VERSION}\" LDFLAGS_STD ?= -lc @@ -1,7 +1,3 @@ -#include <stdlib.h> -#include <string.h> -#include <errno.h> - #include "util.h" #include "array.h" @@ -1,9 +1,6 @@ #ifndef ARRAY_H #define ARRAY_H -#include <stddef.h> -#include <stdbool.h> - /** * @file * @@ -1,8 +1,3 @@ -#include <stdlib.h> -#include <string.h> -#include <stdarg.h> -#include <stdio.h> - #include "buffer.h" #ifndef BUFFER_SIZE @@ -1,8 +1,6 @@ #ifndef BUFFER_H #define BUFFER_H -#include <stddef.h> -#include <stdbool.h> #include "text.h" /** @@ -220,7 +220,7 @@ tryflag CFLAGS_TRY -Werror=unused-command-line-argument tryldflag LDFLAGS_TRY -Werror=unknown-warning-option tryldflag LDFLAGS_TRY -Werror=unused-command-line-argument -CFLAGS_STD="-std=c99 -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -DNDEBUG" +CFLAGS_STD="-std=c99 -DNDEBUG" LDFLAGS_STD="-lc" OS=$(uname) diff --git a/event-basic.c b/event-basic.c index e070522..a03d13f 100644 --- a/event-basic.c +++ b/event-basic.c @@ -1,5 +1,3 @@ -#include <stdarg.h> - #include "vis-core.h" #if !CONFIG_LUA @@ -9,9 +9,6 @@ * http://github.com/agl/critbit * http://ccodearchive.net/info/strmap.html */ -#include <stdlib.h> -#include <string.h> -#include <inttypes.h> #include "map.h" typedef struct Node Node; @@ -16,15 +16,6 @@ * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. */ -#include <string.h> -#include <strings.h> -#include <stdio.h> -#include <ctype.h> -#include <errno.h> -#include <unistd.h> -#include <limits.h> -#include <fcntl.h> - #include "util.h" #include "sam.h" diff --git a/test/core/array-test.c b/test/core/array-test.c index e4da4f6..5944904 100644 --- a/test/core/array-test.c +++ b/test/core/array-test.c @@ -1,9 +1,4 @@ -#include <stdlib.h> -#include <stddef.h> -#include <stdbool.h> -#include <string.h> -#include <stdio.h> -#include <errno.h> +#include "util.h" #include "tap.h" diff --git a/test/core/buffer-test.c b/test/core/buffer-test.c index 8034ac4..edb7786 100644 --- a/test/core/buffer-test.c +++ b/test/core/buffer-test.c @@ -1,9 +1,7 @@ -#include <stdbool.h> -#include <stddef.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> +#include "util.h" + #include "tap.h" + #include "buffer.c" static bool compare(Buffer *buf, const char *data, size_t len) { diff --git a/test/core/map-test.c b/test/core/map-test.c index a8231a3..a78777f 100644 --- a/test/core/map-test.c +++ b/test/core/map-test.c @@ -1,8 +1,7 @@ -#include <stddef.h> -#include <stdbool.h> -#include <string.h> -#include <stdio.h> +#include "util.h" + #include "tap.h" + #include "map.c" static bool get(Map *map, const char *key, const void *data) { diff --git a/test/core/text-test.c b/test/core/text-test.c index c69038c..4ec5fb6 100644 --- a/test/core/text-test.c +++ b/test/core/text-test.c @@ -1,14 +1,7 @@ -#include <errno.h> -#include <fcntl.h> -#include <stdbool.h> -#include <stddef.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include "tap.h" - #include "util.h" +#include "tap.h" + #include "array.c" #include "buffer.c" #include "text.c" diff --git a/text-common.c b/text-common.c index 87dc13f..d052d51 100644 --- a/text-common.c +++ b/text-common.c @@ -1,6 +1,3 @@ -#include <stdlib.h> -#include <string.h> -#include <stdio.h> #include "text.h" static bool text_vprintf(Text *txt, size_t pos, const char *format, va_list ap) { diff --git a/text-internal.h b/text-internal.h index 3f9052f..13647d6 100644 --- a/text-internal.h +++ b/text-internal.h @@ -1,8 +1,6 @@ #ifndef TEXT_INTERNAL #define TEXT_INTERNAL -#include <stdbool.h> -#include <stddef.h> #include "text.h" /* Block holding the file content, either readonly mmap(2)-ed from the original @@ -1,19 +1,3 @@ -#include <fcntl.h> -#include <unistd.h> -#include <stdlib.h> -#include <libgen.h> -#include <stdio.h> -#include <errno.h> -#include <string.h> -#include <limits.h> -#include <sys/mman.h> -#if CONFIG_ACL -#include <sys/acl.h> -#endif -#if CONFIG_SELINUX -#include <selinux/selinux.h> -#endif - #include "text.h" #include "text-internal.h" #include "text-util.h" diff --git a/text-iterator.c b/text-iterator.c index e264781..3dbf664 100644 --- a/text-iterator.c +++ b/text-iterator.c @@ -1,8 +1,3 @@ -#include <limits.h> -#include <stddef.h> -#include <errno.h> -#include <wchar.h> -#include <string.h> #include "text.h" #include "util.h" diff --git a/text-motions.c b/text-motions.c index a17adde..9bd6461 100644 --- a/text-motions.c +++ b/text-motions.c @@ -1,9 +1,3 @@ -#include <ctype.h> -#include <string.h> -#include <stdlib.h> -#include <wchar.h> -#include <errno.h> -#include <limits.h> #include "text-motions.h" #include "text-util.h" #include "util.h" diff --git a/text-motions.h b/text-motions.h index 95e554d..218b44b 100644 --- a/text-motions.h +++ b/text-motions.h @@ -5,7 +5,6 @@ * perform a certain movement and return the new position. If the movement * is not possible the original position is returned unchanged. */ -#include <stddef.h> #include "text.h" #include "text-regex.h" diff --git a/text-objects.c b/text-objects.c index 69ea91c..5e724b8 100644 --- a/text-objects.c +++ b/text-objects.c @@ -1,7 +1,3 @@ -#include <errno.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> #include "text-motions.h" #include "text-objects.h" #include "text-util.h" diff --git a/text-objects.h b/text-objects.h index d9ea218..f98c496 100644 --- a/text-objects.h +++ b/text-objects.h @@ -6,7 +6,6 @@ * such text-object at the given location, an empty range is returned. */ -#include <stddef.h> #include "text.h" /* return range covering the entire text */ diff --git a/text-regex-tre.c b/text-regex-tre.c index eccbafb..a4443f7 100644 --- a/text-regex-tre.c +++ b/text-regex-tre.c @@ -1,8 +1,3 @@ -#include <stdlib.h> -#include <string.h> -#include <wchar.h> -#include <errno.h> - #include "text-regex.h" #include "text-motions.h" diff --git a/text-regex.c b/text-regex.c index 7c6812e..0cf05ab 100644 --- a/text-regex.c +++ b/text-regex.c @@ -1,6 +1,3 @@ -#include <stdlib.h> -#include <string.h> - #include "text-regex.h" struct Regex { diff --git a/text-util.c b/text-util.c index 7e47cce..acd80c2 100644 --- a/text-util.c +++ b/text-util.c @@ -1,8 +1,5 @@ #include "text-util.h" #include "util.h" -#include <wchar.h> -#include <errno.h> -#include <stdlib.h> Filerange text_range_union(const Filerange *r1, const Filerange *r2) { if (!text_range_valid(r1)) diff --git a/text-util.h b/text-util.h index 922bab3..9e906b5 100644 --- a/text-util.h +++ b/text-util.h @@ -1,8 +1,6 @@ #ifndef TEXT_UTIL_H #define TEXT_UTIL_H -#include <stdbool.h> -#include <stddef.h> #include "text.h" /* test whether the given range is valid (start <= end) */ @@ -1,18 +1,3 @@ -#include <unistd.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> -#include <fcntl.h> -#include <errno.h> -#include <wchar.h> -#include <stdint.h> -#include <libgen.h> -#include <limits.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/mman.h> - #include "util.h" #include "array.h" @@ -1,14 +1,6 @@ #ifndef TEXT_H #define TEXT_H -#include <stdbool.h> -#include <stdint.h> -#include <time.h> -#include <unistd.h> -#include <stdarg.h> -#include <sys/types.h> -#include <sys/stat.h> - #include "util.h" /** A mark. */ diff --git a/ui-terminal-curses.c b/ui-terminal-curses.c index a2aa7ec..1224d5a 100644 --- a/ui-terminal-curses.c +++ b/ui-terminal-curses.c @@ -1,5 +1,4 @@ /* This file is included from ui-terminal.c */ -#include <stdio.h> #include <curses.h> #define UI_TERMKEY_FLAGS (TERMKEY_FLAG_UTF8|TERMKEY_FLAG_NOTERMIOS) diff --git a/ui-terminal.c b/ui-terminal.c index a96bea3..746e24c 100644 --- a/ui-terminal.c +++ b/ui-terminal.c @@ -1,20 +1,3 @@ -#include <unistd.h> -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <string.h> -#include <strings.h> -#include <limits.h> -#include <ctype.h> -#include <locale.h> -#include <poll.h> -#include <sys/ioctl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <termios.h> -#include <errno.h> - #include "vis.h" #include "vis-core.h" #include "text.h" @@ -1,10 +1,6 @@ #ifndef UI_H #define UI_H -#include <stdbool.h> -#include <stdarg.h> -#include <termkey.h> - /* enable large file optimization for files larger than: */ #define UI_LARGE_FILE_SIZE (1 << 25) /* enable large file optimization for files containing lines longer than: */ @@ -26,9 +26,45 @@ #define CONFIG_ACL 0 #endif +#undef _XOPEN_SOURCE +#define _XOPEN_SOURCE 700 + +#include <ctype.h> +#include <errno.h> +#include <fcntl.h> +#include <inttypes.h> +#include <libgen.h> +#include <limits.h> +#include <locale.h> +#include <poll.h> +#include <pwd.h> +#include <setjmp.h> +#include <signal.h> +#include <stdarg.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <strings.h> +#include <sys/ioctl.h> +#include <sys/mman.h> +#include <sys/select.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <sys/wait.h> +#include <termios.h> +#include <time.h> +#include <unistd.h> +#include <wchar.h> + +#if CONFIG_ACL +#include <sys/acl.h> +#endif +#if CONFIG_SELINUX +#include <selinux/selinux.h> +#endif #define LENGTH(x) ((int)(sizeof (x) / sizeof *(x))) #define MIN(a, b) ((a) > (b) ? (b) : (a)) @@ -1,11 +1,3 @@ -#include <ctype.h> -#include <errno.h> -#include <limits.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <wchar.h> - #include "vis-core.h" #include "view.h" #include "text.h" @@ -1,9 +1,6 @@ #ifndef VIEW_H #define VIEW_H -#include <stddef.h> -#include <stdbool.h> - #include "ui.h" #include "text.h" #include "array.h" @@ -1,6 +1,5 @@ /* this file is included from sam.c */ -#include <termkey.h> #include "vis-lua.h" // FIXME: avoid this redirection? @@ -1,8 +1,6 @@ #ifndef VIS_CORE_H #define VIS_CORE_H -#include <setjmp.h> - #include "util.h" #include "vis.h" @@ -11,16 +11,6 @@ * @license ISC * @release RELEASE */ -#include <stddef.h> -#include <stdarg.h> -#include <stdio.h> -#include <string.h> -#include <limits.h> -#include <unistd.h> -#include <libgen.h> -#include <sys/types.h> -#include <pwd.h> - #include "util.h" #include "vis-lua.h" @@ -30,6 +30,9 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ +#undef _XOPEN_SOURCE +#define _XOPEN_SOURCE 700 + #include <fcntl.h> #include <stdio.h> #include <stdlib.h> diff --git a/vis-modes.c b/vis-modes.c index 5b8a71d..2d8abbd 100644 --- a/vis-modes.c +++ b/vis-modes.c @@ -1,5 +1,3 @@ -#include <string.h> -#include <strings.h> #include "vis-core.h" #include "text-motions.h" #include "util.h" diff --git a/vis-motions.c b/vis-motions.c index d864dd5..0510a59 100644 --- a/vis-motions.c +++ b/vis-motions.c @@ -1,6 +1,3 @@ -#include <stdio.h> -#include <string.h> -#include <ctype.h> #include "vis-core.h" #include "text-motions.h" #include "text-objects.h" diff --git a/vis-operators.c b/vis-operators.c index 123d126..ae2da5a 100644 --- a/vis-operators.c +++ b/vis-operators.c @@ -1,5 +1,3 @@ -#include <string.h> -#include <ctype.h> #include "vis-core.h" #include "text-motions.h" #include "text-objects.h" diff --git a/vis-prompt.c b/vis-prompt.c index 089a931..f6f06a7 100644 --- a/vis-prompt.c +++ b/vis-prompt.c @@ -1,4 +1,3 @@ -#include <string.h> #include "vis-core.h" #include "text-motions.h" #include "text-objects.h" diff --git a/vis-registers.c b/vis-registers.c index e1f2c92..2059d5c 100644 --- a/vis-registers.c +++ b/vis-registers.c @@ -1,6 +1,3 @@ -#include <stdlib.h> -#include <string.h> - #include "vis-core.h" static Buffer *register_buffer(Register *reg, size_t slot) { diff --git a/vis-subprocess.c b/vis-subprocess.c index b1d6a26..4c556be 100644 --- a/vis-subprocess.c +++ b/vis-subprocess.c @@ -1,10 +1,3 @@ -#include <fcntl.h> -#include <stdio.h> -#include <stdbool.h> -#include <errno.h> -#include <string.h> -#include <sys/wait.h> - #include "util.h" #include "vis-lua.h" diff --git a/vis-subprocess.h b/vis-subprocess.h index 05f4dfe..3d69978 100644 --- a/vis-subprocess.h +++ b/vis-subprocess.h @@ -2,7 +2,6 @@ #define VIS_SUBPROCESS_H #include "vis-core.h" #include "vis-lua.h" -#include <sys/select.h> typedef struct Process Process; #if CONFIG_LUA @@ -1,27 +1,7 @@ -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <strings.h> -#include <signal.h> -#include <stdarg.h> -#include <stdio.h> -#include <errno.h> -#include <fcntl.h> -#include <limits.h> -#include <ctype.h> -#include <time.h> -#include <sys/select.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <sys/stat.h> -#include <sys/ioctl.h> -#include <sys/mman.h> -#include <pwd.h> -#include <libgen.h> -#include <termkey.h> - #include "util.h" +#include <termkey.h> + #include "vis.h" #include "text-util.h" #include "text-motions.h" @@ -31,7 +11,6 @@ #include "ui.h" #include "vis-subprocess.h" - #include "array.c" #include "buffer.c" #include "event-basic.c" |
