323 lines
6.6 KiB
Diff
323 lines
6.6 KiB
Diff
diff --git dcs.c dcs.c
|
|
index e0f5f97..b1e7919 100644
|
|
--- a/dcs.c
|
|
+++ b/dcs.c
|
|
@@ -28,13 +28,13 @@
|
|
#include "dcs.h"
|
|
|
|
#include <stdio.h>
|
|
-#if HAVE_CTYPE_H
|
|
+#ifdef HAVE_CTYPE_H
|
|
# include <ctype.h>
|
|
#endif
|
|
-#if HAVE_STDLIB_H
|
|
+#ifdef HAVE_STDLIB_H
|
|
# include <stdlib.h>
|
|
#endif
|
|
-#if HAVE_STRING_H
|
|
+#ifdef HAVE_STRING_H
|
|
# include <string.h>
|
|
#endif
|
|
|
|
diff --git function.c function.c
|
|
index fb2066d..efbd4b4 100644
|
|
--- a/function.c
|
|
+++ b/function.c
|
|
@@ -23,7 +23,7 @@
|
|
#include "function.h"
|
|
|
|
#include <stdio.h>
|
|
-#if HAVE_STRING_H
|
|
+#ifdef HAVE_STRING_H
|
|
# include <string.h>
|
|
#endif
|
|
|
|
diff --git gifsave89.c gifsave89.c
|
|
index 1eeb1ad..3af3384 100644
|
|
--- a/gifsave89.c
|
|
+++ b/gifsave89.c
|
|
@@ -25,10 +25,10 @@ standard headers...
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
-#if HAVE_STRING_H
|
|
+#ifdef HAVE_STRING_H
|
|
# include <string.h>
|
|
#endif
|
|
-#if HAVE_CTYPE_H
|
|
+#ifdef HAVE_CTYPE_H
|
|
# include <ctype.h>
|
|
#endif
|
|
#if defined(GSTESTDRIVE)
|
|
diff --git main.c main.c
|
|
index 894e493..18cd178 100644
|
|
--- a/main.c
|
|
+++ b/main.c
|
|
@@ -28,22 +28,22 @@
|
|
|
|
#include <stdio.h>
|
|
|
|
-#if HAVE_STDLIB_H
|
|
+#ifdef HAVE_STDLIB_H
|
|
# include <stdlib.h>
|
|
#endif
|
|
-#if HAVE_STRING_H
|
|
+#ifdef HAVE_STRING_H
|
|
# include <string.h>
|
|
#endif
|
|
-#if HAVE_UNISTD_H
|
|
+#ifdef HAVE_UNISTD_H
|
|
# include <unistd.h>
|
|
#endif
|
|
-#if HAVE_GETOPT_H
|
|
+#ifdef HAVE_GETOPT_H
|
|
# include <getopt.h>
|
|
#endif
|
|
-#if HAVE_ERRNO_H
|
|
+#ifdef HAVE_ERRNO_H
|
|
# include <errno.h>
|
|
#endif
|
|
-#if HAVE_FCNTL_H
|
|
+#ifdef HAVE_FCNTL_H
|
|
# include <fcntl.h>
|
|
#endif
|
|
|
|
@@ -246,11 +246,11 @@ static int parse_args(int argc, char *argv[], struct settings_t *psettings)
|
|
int long_opt;
|
|
int n;
|
|
char const *optstring = "w:h:HVl:f:b:c:t:jr:i:o:";
|
|
-#if HAVE_GETOPT_LONG
|
|
+#ifdef HAVE_GETOPT_LONG
|
|
int option_index;
|
|
#endif /* HAVE_GETOPT_LONG */
|
|
|
|
-#if HAVE_GETOPT_LONG
|
|
+#ifdef HAVE_GETOPT_LONG
|
|
struct option long_options[] = {
|
|
{"width", required_argument, &long_opt, 'w'},
|
|
{"height", required_argument, &long_opt, 'h'},
|
|
@@ -271,7 +271,7 @@ static int parse_args(int argc, char *argv[], struct settings_t *psettings)
|
|
|
|
for (;;) {
|
|
|
|
-#if HAVE_GETOPT_LONG
|
|
+#ifdef HAVE_GETOPT_LONG
|
|
n = getopt_long(argc, argv, optstring,
|
|
long_options, &option_index);
|
|
#else
|
|
@@ -390,7 +390,7 @@ static FILE * open_input_file(char const *filename)
|
|
}
|
|
f = fopen(filename, "rb");
|
|
if (!f) {
|
|
-#if _ERRNO_H
|
|
+#ifdef _ERRNO_H
|
|
fprintf(stderr, "fopen('%s') failed.\n" "reason: %s.\n",
|
|
filename, strerror(errno));
|
|
#endif /* HAVE_ERRNO_H */
|
|
@@ -416,7 +416,7 @@ static FILE * open_output_file(char const *filename)
|
|
}
|
|
f = fopen(filename, "wb");
|
|
if (!f) {
|
|
-#if _ERRNO_H
|
|
+#ifdef _ERRNO_H
|
|
fprintf(stderr, "fopen('%s') failed.\n" "reason: %s.\n",
|
|
filename, strerror(errno));
|
|
#endif /* HAVE_ERRNO_H */
|
|
diff --git malloc_stub.c malloc_stub.c
|
|
index c5e881a..e858069 100644
|
|
--- a/malloc_stub.c
|
|
+++ b/malloc_stub.c
|
|
@@ -17,17 +17,17 @@
|
|
|
|
#include "config.h"
|
|
|
|
-#if HAVE_ERRNO_H
|
|
+#ifdef HAVE_ERRNO_H
|
|
#include <errno.h>
|
|
#endif /* HAVE_ERRNO_H */
|
|
|
|
#include <stdlib.h>
|
|
|
|
-#if HAVE_MEMORY_H
|
|
+#ifdef HAVE_MEMORY_H
|
|
# include <memory.h>
|
|
#endif /* HAVE_MEMORY_H */
|
|
|
|
-#if !HAVE_MALLOC
|
|
+#ifndef HAVE_MALLOC
|
|
# undef malloc
|
|
void *
|
|
rpl_malloc(size_t n)
|
|
@@ -39,7 +39,7 @@ rpl_malloc(size_t n)
|
|
}
|
|
#endif /* !HAVE_MALLOC */
|
|
|
|
-#if !HAVE_REALLOC
|
|
+#ifndef HAVE_REALLOC
|
|
# undef realloc
|
|
void *
|
|
rpl_realloc(void *p, size_t n)
|
|
diff --git malloc_stub.h malloc_stub.h
|
|
index 676b1b6..3ae5a50 100644
|
|
--- a/malloc_stub.h
|
|
+++ b/malloc_stub.h
|
|
@@ -18,15 +18,15 @@
|
|
#ifndef MALLOC_STUB_H
|
|
#define MALLOC_STUB_H
|
|
|
|
-#if HAVE_SYS_TYPES_H
|
|
+#ifdef HAVE_SYS_TYPES_H
|
|
# include <sys/types.h>
|
|
#endif /* HAVE_SYS_TYPES_H */
|
|
|
|
-#if !HAVE_MALLOC
|
|
+#ifndef HAVE_MALLOC
|
|
void * rpl_malloc(size_t n);
|
|
#endif /* !HAVE_MALLOC */
|
|
|
|
-#if !HAVE_REALLOC
|
|
+#ifndef HAVE_REALLOC
|
|
void * rpl_realloc(void *p, size_t n);
|
|
#endif /* !HAVE_REALLOC */
|
|
|
|
diff --git parse.c parse.c
|
|
index 65b00ab..aec3692 100644
|
|
--- a/parse.c
|
|
+++ b/parse.c
|
|
@@ -24,10 +24,10 @@
|
|
#include "dcs.h"
|
|
|
|
#include <stdio.h>
|
|
-#if HAVE_CTYPE_H
|
|
+#ifdef HAVE_CTYPE_H
|
|
# include <ctype.h>
|
|
#endif
|
|
-#if HAVE_STRING_H
|
|
+#ifdef HAVE_STRING_H
|
|
# include <string.h>
|
|
#endif
|
|
|
|
diff --git pseudo.c pseudo.c
|
|
index 89de986..2560b11 100644
|
|
--- a/pseudo.c
|
|
+++ b/pseudo.c
|
|
@@ -21,7 +21,7 @@
|
|
#include "util.h"
|
|
#include "pseudo.h"
|
|
|
|
-#if HAVE_STRING_H
|
|
+#ifdef HAVE_STRING_H
|
|
# include <string.h>
|
|
#endif
|
|
|
|
diff --git terminal.c terminal.c
|
|
index 6d1a0be..26ce2aa 100644
|
|
--- a/terminal.c
|
|
+++ b/terminal.c
|
|
@@ -23,10 +23,10 @@
|
|
#include "wcwidth.h"
|
|
|
|
#include <stdio.h>
|
|
-#if HAVE_STDLIB_H
|
|
+#ifdef HAVE_STDLIB_H
|
|
# include <stdlib.h>
|
|
#endif
|
|
-#if HAVE_STRING_H
|
|
+#ifdef HAVE_STRING_H
|
|
# include <string.h>
|
|
#endif
|
|
|
|
diff --git util.c util.c
|
|
index ce3cfe8..6aa0439 100644
|
|
--- a/util.c
|
|
+++ b/util.c
|
|
@@ -19,19 +19,19 @@
|
|
#include "config.h"
|
|
|
|
#include <stdio.h>
|
|
-#if HAVE_ERRNO_H
|
|
+#ifdef HAVE_ERRNO_H
|
|
# include <errno.h>
|
|
#endif
|
|
-#if HAVE_LIMITS_H
|
|
+#ifdef HAVE_LIMITS_H
|
|
# include <limits.h>
|
|
#endif
|
|
-#if HAVE_UNISTD_H
|
|
+#ifdef HAVE_UNISTD_H
|
|
# include <unistd.h>
|
|
#endif
|
|
-#if HAVE_STDLIB_H
|
|
+#ifdef HAVE_STDLIB_H
|
|
# include <stdlib.h>
|
|
#endif
|
|
-#if HAVE_STRING_H
|
|
+#ifdef HAVE_STRING_H
|
|
# include <string.h>
|
|
#endif
|
|
|
|
@@ -54,11 +54,11 @@ void fatal(char *str)
|
|
void *ecalloc(size_t nmemb, size_t size)
|
|
{
|
|
void *ptr;
|
|
-#if HAVE_SYS_ERRNO_H || HAVE_ERRNO_H
|
|
+#if defined(HAVE_SYS_ERRNO_H) || (HAVE_ERRNO_H)
|
|
errno = 0;
|
|
#endif
|
|
|
|
-#if HAVE_CALLOC
|
|
+#ifdef HAVE_CALLOC
|
|
if ((ptr = calloc(nmemb, size)) == NULL)
|
|
error("calloc");
|
|
#else
|
|
@@ -73,7 +73,7 @@ void *ecalloc(size_t nmemb, size_t size)
|
|
void *erealloc(void *ptr, size_t size)
|
|
{
|
|
void *new;
|
|
-#if HAVE_SYS_ERRNO_H || HAVE_ERRNO_H
|
|
+#if defined(HAVE_SYS_ERRNO_H) || (HAVE_ERRNO_H)
|
|
errno = 0;
|
|
#endif
|
|
|
|
@@ -86,12 +86,12 @@ void *erealloc(void *ptr, size_t size)
|
|
static long estrtol(const char *nptr, char **endptr, int base)
|
|
{
|
|
long int ret;
|
|
-#if HAVE_SYS_ERRNO_H || HAVE_ERRNO_H
|
|
+#if defined(HAVE_SYS_ERRNO_H) || (HAVE_ERRNO_H)
|
|
errno = 0;
|
|
#endif
|
|
|
|
ret = strtol(nptr, endptr, base);
|
|
-#if HAVE_LIMITS_H
|
|
+#ifdef HAVE_LIMITS_H
|
|
if (ret == LONG_MIN || ret == LONG_MAX) {
|
|
perror("strtol");
|
|
return 0;
|
|
diff --git wcwidth.h wcwidth.h
|
|
index 5a2041f..e1da9e5 100644
|
|
--- a/wcwidth.h
|
|
+++ b/wcwidth.h
|
|
@@ -16,7 +16,7 @@
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
-#if HAVE_WCHAR_H
|
|
+#ifdef HAVE_WCHAR_H
|
|
# include <wchar.h>
|
|
#endif
|
|
|
|
diff --git yaft.h yaft.h
|
|
index 9ecdfd6..4fc3644 100644
|
|
--- a/yaft.h
|
|
+++ b/yaft.h
|
|
@@ -19,7 +19,7 @@
|
|
#include "config.h"
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
-#if HAVE_WCHAR_H
|
|
+#ifdef HAVE_WCHAR_H
|
|
# include <wchar.h>
|
|
#endif
|
|
|