]> wimlib.net Git - wimlib/commitdiff
Remove --enable-more-debug and --disable-custom-memory-allocator options
authorEric Biggers <ebiggers3@gmail.com>
Wed, 25 Dec 2013 07:03:56 +0000 (01:03 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 25 Dec 2013 07:06:42 +0000 (01:06 -0600)
The former was of little use due to the lack of DEBUG2() statements, and
the latter barely saved any space and wasn't worth having an option for.

configure.ac
include/wimlib.h
include/wimlib/error.h
include/wimlib/util.h
include/wimlib/xml.h
src/capture_common.c
src/ntfs-3g_capture.c
src/util.c
src/xml.c

index 5783d35206604e36323dd5814317aa1999a998aa..50a8e056d13fe4d45f7332c0fd7273fef02ef24c 100644 (file)
@@ -2,7 +2,7 @@ AC_INIT([wimlib], [1.5.3], [ebiggers3@gmail.com])
 AC_CONFIG_SRCDIR([src/wim.c])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_SRCDIR([src/wim.c])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects])
+AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects foreign])
 AC_C_BIGENDIAN
 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 LT_INIT
 AC_C_BIGENDIAN
 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 LT_INIT
@@ -102,19 +102,6 @@ if test "x$ENABLE_DEBUG" = "xyes"; then
                        [Define to 1 if including lots of debug messages.])
 fi
 
                        [Define to 1 if including lots of debug messages.])
 fi
 
-AC_MSG_CHECKING([whether to include more debugging messages])
-AC_ARG_ENABLE([more_debug],
-       AS_HELP_STRING([--enable-more-debug],
-                       [include even more debugging messages]),
-       [ENABLE_MORE_DEBUG=$enableval],
-       [ENABLE_MORE_DEBUG=no]
-       )
-AC_MSG_RESULT([$ENABLE_MORE_DEBUG])
-if test "x$ENABLE_MORE_DEBUG" = "xyes"; then
-       AC_DEFINE([ENABLE_MORE_DEBUG], [1],
-                       [Define to 1 if including even more debug messages.])
-fi
-
 AC_MSG_CHECKING([whether to include error messages])
 AC_ARG_ENABLE([error_messages],
        AS_HELP_STRING([--disable-error-messages],
 AC_MSG_CHECKING([whether to include error messages])
 AC_ARG_ENABLE([error_messages],
        AS_HELP_STRING([--disable-error-messages],
@@ -128,20 +115,6 @@ if test "x$ENABLE_ERROR_MESSAGES" = "xyes"; then
                        [Define to 1 if including error messages])
 fi
 
                        [Define to 1 if including error messages])
 fi
 
-AC_MSG_CHECKING([whether to support custom memory allocation functions])
-AC_ARG_ENABLE([custom_memory_allocator],
-       AS_HELP_STRING([--disable-custom-memory-allocator],
-                      [do not support the use of custom memory allocation
-                       functions]),
-       [ENABLE_CUSTOM_MEMORY_ALLOCATOR=$enableval],
-       [ENABLE_CUSTOM_MEMORY_ALLOCATOR=yes]
-       )
-AC_MSG_RESULT([$ENABLE_CUSTOM_MEMORY_ALLOCATOR])
-if test "x$ENABLE_CUSTOM_MEMORY_ALLOCATOR" = "xyes"; then
-       AC_DEFINE([ENABLE_CUSTOM_MEMORY_ALLOCATOR], [1],
-               [Define to 1 if supporting custom memory allocation functions])
-fi
-
 AC_MSG_CHECKING([whether to include assertions])
 AC_ARG_ENABLE([assertions],
        AS_HELP_STRING([--disable-assertions], [do not include assertions]),
 AC_MSG_CHECKING([whether to include assertions])
 AC_ARG_ENABLE([assertions],
        AS_HELP_STRING([--disable-assertions], [do not include assertions]),
index 4a47ebacbbdb70e7921b2e35d74c0b9c43cf9672..2245a37271e3ab63a3c79720a933a2314b75d5ad 100644 (file)
@@ -3359,10 +3359,7 @@ wimlib_set_image_name(WIMStruct *wim, int image, const wimlib_tchar *name);
  *     A function equivalent to @c realloc() that wimlib will use to reallocate
  *     memory.  If @c NULL, the free function is set back to the default @c
  *     realloc() from the C library.
  *     A function equivalent to @c realloc() that wimlib will use to reallocate
  *     memory.  If @c NULL, the free function is set back to the default @c
  *     realloc() from the C library.
- * @return 0 on success; nonzero on error.
- * @retval ::WIMLIB_ERR_UNSUPPORTED
- *     wimlib was compiled with the @c --without-custom-memory-allocator flag,
- *     so custom memory allocators are unsupported.
+ * @return 0
  */
 extern int
 wimlib_set_memory_allocator(void *(*malloc_func)(size_t),
  */
 extern int
 wimlib_set_memory_allocator(void *(*malloc_func)(size_t),
index 8d02120bf36fb3b1db606738fd5c2b522441d68b..522264021d3089bf80614c1a1000abc4f4067b60 100644 (file)
@@ -74,10 +74,4 @@ wimlib_debug(const tchar *file, int line, const char *func,
 #  define DEBUG(format, ...) dummy_tprintf(T(format), ## __VA_ARGS__)
 #endif /* !ENABLE_DEBUG */
 
 #  define DEBUG(format, ...) dummy_tprintf(T(format), ## __VA_ARGS__)
 #endif /* !ENABLE_DEBUG */
 
-#ifdef ENABLE_MORE_DEBUG
-#  define DEBUG2(format, ...) DEBUG(format, ## __VA_ARGS__)
-#else
-#  define DEBUG2(format, ...) dummy_tprintf(T(format), ## __VA_ARGS__)
-#endif /* !ENABLE_MORE_DEBUG */
-
 #endif /* _WIMLIB_ERROR_H */
 #endif /* _WIMLIB_ERROR_H */
index 8e9d695ed090a1cbd35ad75e37da425be7663a7b..2f630d57dbf8826d34f13faee33ba091068e14ae 100644 (file)
@@ -53,7 +53,6 @@
  * places when large temporary buffers are needed).  */
 #define STACK_MAX 32768
 
  * places when large temporary buffers are needed).  */
 #define STACK_MAX 32768
 
-#ifdef ENABLE_CUSTOM_MEMORY_ALLOCATOR
 extern void *
 wimlib_malloc(size_t) _malloc_attribute;
 
 extern void *
 wimlib_malloc(size_t) _malloc_attribute;
 
@@ -74,22 +73,12 @@ wimlib_wcsdup(const wchar_t *str) _malloc_attribute;
 extern char *
 wimlib_strdup(const char *str) _malloc_attribute;
 
 extern char *
 wimlib_strdup(const char *str) _malloc_attribute;
 
-#  define      MALLOC  wimlib_malloc
-#  define      FREE    wimlib_free_memory
-#  define      REALLOC wimlib_realloc
-#  define      CALLOC  wimlib_calloc
-#  define      STRDUP  wimlib_strdup
-#  define      WCSDUP  wimlib_wcsdup
-#else /* ENABLE_CUSTOM_MEMORY_ALLOCATOR */
-#  include <stdlib.h>
-#  include <string.h>
-#  define      MALLOC  malloc
-#  define      FREE    free
-#  define      REALLOC realloc
-#  define      CALLOC  calloc
-#  define      STRDUP  strdup
-#  define       WCSDUP  wcsdup
-#endif /* !ENABLE_CUSTOM_MEMORY_ALLOCATOR */
+#define        MALLOC  wimlib_malloc
+#define        FREE    wimlib_free_memory
+#define        REALLOC wimlib_realloc
+#define        CALLOC  wimlib_calloc
+#define        STRDUP  wimlib_strdup
+#define        WCSDUP  wimlib_wcsdup
 
 extern void *
 memdup(const void *mem, size_t size) _malloc_attribute;
 
 extern void *
 memdup(const void *mem, size_t size) _malloc_attribute;
index a4fd115247d391992cc121c7235e266d23222420..e9c044afd8854076a3e9ec10ce72aa6be365bed8 100644 (file)
@@ -60,11 +60,9 @@ libxml_global_init(void);
 extern void
 libxml_global_cleanup(void);
 
 extern void
 libxml_global_cleanup(void);
 
-#ifdef ENABLE_CUSTOM_MEMORY_ALLOCATOR
 extern void
 xml_set_memory_allocator(void *(*malloc_func)(size_t),
                         void (*free_func)(void *),
                         void *(*realloc_func)(void *, size_t));
 extern void
 xml_set_memory_allocator(void *(*malloc_func)(size_t),
                         void (*free_func)(void *),
                         void *(*realloc_func)(void *, size_t));
-#endif
 
 #endif
 
 #endif
index c45ae152345e7ecba77c983ded9d3d2a81ea5b39..66f6411fdaa1fadc4189b8d02fcd8d0c16fdc62f 100644 (file)
@@ -177,8 +177,8 @@ match_pattern(const tchar *path,
                              string, pat);
                        return true;
                } else {
                              string, pat);
                        return true;
                } else {
-                       DEBUG2("\"%"TS"\" does not match the pattern \"%"TS"\"",
-                              string, pat);
+                       DEBUG("\"%"TS"\" does not match the pattern \"%"TS"\"",
+                             string, pat);
                }
        }
        return false;
                }
        }
        return false;
index 9bcdcc5148fdb60692a14f8f55a9435356a4814e..03c3282db1e830f20dcf14b8364c6333cdde5f18 100644 (file)
@@ -171,7 +171,7 @@ capture_ntfs_streams(struct wim_inode *inode,
        int ret;
        struct wim_lookup_table_entry *lte;
 
        int ret;
        struct wim_lookup_table_entry *lte;
 
-       DEBUG2("Capturing NTFS data streams from `%s'", path);
+       DEBUG("Capturing NTFS data streams from `%s'", path);
 
        /* Get context to search the streams of the NTFS file. */
        actx = ntfs_attr_get_search_ctx(ni, NULL);
 
        /* Get context to search the streams of the NTFS file. */
        actx = ntfs_attr_get_search_ctx(ni, NULL);
@@ -296,7 +296,7 @@ out_free_ntfs_loc:
 out_put_actx:
        ntfs_attr_put_search_ctx(actx);
        if (ret == 0)
 out_put_actx:
        ntfs_attr_put_search_ctx(actx);
        if (ret == 0)
-               DEBUG2("Successfully captured NTFS streams from \"%s\"", path);
+               DEBUG("Successfully captured NTFS streams from \"%s\"", path);
        else
                ERROR("Failed to capture NTFS streams from \"%s\"", path);
        return ret;
        else
                ERROR("Failed to capture NTFS streams from \"%s\"", path);
        return ret;
index 728dae3f13b1c181bb5a98a619ebdd28deb3ffdc..27f01c415ff240594d22ed6d7fe5be18fb566f3d 100644 (file)
@@ -438,7 +438,6 @@ wimlib_get_error_string(enum wimlib_error_code code)
 
 
 
 
 
 
-#ifdef ENABLE_CUSTOM_MEMORY_ALLOCATOR
 static void *(*wimlib_malloc_func) (size_t)         = malloc;
 static void  (*wimlib_free_func)   (void *)         = free;
 static void *(*wimlib_realloc_func)(void *, size_t) = realloc;
 static void *(*wimlib_malloc_func) (size_t)         = malloc;
 static void  (*wimlib_free_func)   (void *)         = free;
 static void *(*wimlib_realloc_func)(void *, size_t) = realloc;
@@ -509,8 +508,6 @@ wimlib_wcsdup(const wchar_t *str)
 }
 #endif
 
 }
 #endif
 
-#endif /* ENABLE_CUSTOM_MEMORY_ALLOCATOR */
-
 void *
 memdup(const void *mem, size_t size)
 {
 void *
 memdup(const void *mem, size_t size)
 {
@@ -526,7 +523,6 @@ wimlib_set_memory_allocator(void *(*malloc_func)(size_t),
                            void (*free_func)(void *),
                            void *(*realloc_func)(void *, size_t))
 {
                            void (*free_func)(void *),
                            void *(*realloc_func)(void *, size_t))
 {
-#ifdef ENABLE_CUSTOM_MEMORY_ALLOCATOR
        wimlib_malloc_func  = malloc_func  ? malloc_func  : malloc;
        wimlib_free_func    = free_func    ? free_func    : free;
        wimlib_realloc_func = realloc_func ? realloc_func : realloc;
        wimlib_malloc_func  = malloc_func  ? malloc_func  : malloc;
        wimlib_free_func    = free_func    ? free_func    : free;
        wimlib_realloc_func = realloc_func ? realloc_func : realloc;
@@ -534,12 +530,6 @@ wimlib_set_memory_allocator(void *(*malloc_func)(size_t),
        xml_set_memory_allocator(wimlib_malloc_func, wimlib_free_func,
                                 wimlib_realloc_func);
        return 0;
        xml_set_memory_allocator(wimlib_malloc_func, wimlib_free_func,
                                 wimlib_realloc_func);
        return 0;
-#else
-       ERROR("Cannot set custom memory allocator functions:");
-       ERROR("wimlib was compiled with the --without-custom-memory-allocator "
-             "flag");
-       return WIMLIB_ERR_UNSUPPORTED;
-#endif
 }
 
 static bool seeded = false;
 }
 
 static bool seeded = false;
index 542fc3791b7d1ce8c4ddfe0bc3c482046a995d8e..5103d75d8d34d01901cf6505fc05950b98b4ad14 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -1092,7 +1092,6 @@ xml_get_max_image_name_len(const WIMStruct *wim)
        return max_len;
 }
 
        return max_len;
 }
 
-#ifdef ENABLE_CUSTOM_MEMORY_ALLOCATOR
 void
 xml_set_memory_allocator(void *(*malloc_func)(size_t),
                         void (*free_func)(void *),
 void
 xml_set_memory_allocator(void *(*malloc_func)(size_t),
                         void (*free_func)(void *),
@@ -1100,7 +1099,6 @@ xml_set_memory_allocator(void *(*malloc_func)(size_t),
 {
        xmlMemSetup(free_func, malloc_func, realloc_func, STRDUP);
 }
 {
        xmlMemSetup(free_func, malloc_func, realloc_func, STRDUP);
 }
-#endif
 
 static int
 calculate_dentry_statistics(struct wim_dentry *dentry, void *arg)
 
 static int
 calculate_dentry_statistics(struct wim_dentry *dentry, void *arg)