[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master a5cbd98376 3/9: Omit unnecessary code when !HAVE_NATIVE_COMP
From: |
Paul Eggert |
Subject: |
master a5cbd98376 3/9: Omit unnecessary code when !HAVE_NATIVE_COMP |
Date: |
Sat, 19 Mar 2022 15:49:03 -0400 (EDT) |
branch: master
commit a5cbd983767c5b3e18e7b039795d036262b41958
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
Omit unnecessary code when !HAVE_NATIVE_COMP
* src/decompress.c (MD5_BLOCKSIZE, acc_buf, acc_size)
(accumulate_and_process_md5, final_process_md5, md5_gz_stream):
* src/dynlib.c (dynlib_open_for_eln, dynlib_close) [!WINDOWSNT]:
* src/fileio.c (internal_delete_file_1, internal_delete_file):
Define only if HAVE_NATIVE_COMP && WINDOWSNT,
as they’re not used otherwise.
---
src/decompress.c | 10 ++++++----
src/dynlib.c | 4 ++++
src/fileio.c | 4 ++++
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/decompress.c b/src/decompress.c
index ddd8abbf27..dbdc9104a3 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -67,8 +67,9 @@ init_zlib_functions (void)
#endif /* WINDOWSNT */
+#ifdef HAVE_NATIVE_COMP
-#define MD5_BLOCKSIZE 32768 /* From md5.c */
+# define MD5_BLOCKSIZE 32768 /* From md5.c */
static char acc_buff[2 * MD5_BLOCKSIZE];
static size_t acc_size;
@@ -106,7 +107,7 @@ md5_gz_stream (FILE *source, void *resblock)
unsigned char in[MD5_BLOCKSIZE];
unsigned char out[MD5_BLOCKSIZE];
-#ifdef WINDOWSNT
+# ifdef WINDOWSNT
if (!zlib_initialized)
zlib_initialized = init_zlib_functions ();
if (!zlib_initialized)
@@ -114,7 +115,7 @@ md5_gz_stream (FILE *source, void *resblock)
message1 ("zlib library not found");
return -1;
}
-#endif
+# endif
eassert (!acc_size);
@@ -164,7 +165,8 @@ md5_gz_stream (FILE *source, void *resblock)
return 0;
}
-#undef MD5_BLOCKSIZE
+# undef MD5_BLOCKSIZE
+#endif
diff --git a/src/dynlib.c b/src/dynlib.c
index 8cb9a23374..e2c71f1448 100644
--- a/src/dynlib.c
+++ b/src/dynlib.c
@@ -279,11 +279,13 @@ dynlib_open (const char *path)
return dlopen (path, RTLD_LAZY | RTLD_GLOBAL);
}
+# ifdef HAVE_NATIVE_COMP
dynlib_handle_ptr
dynlib_open_for_eln (const char *path)
{
return dlopen (path, RTLD_LAZY);
}
+# endif
void *
dynlib_sym (dynlib_handle_ptr h, const char *sym)
@@ -313,11 +315,13 @@ dynlib_error (void)
return dlerror ();
}
+# ifdef HAVE_NATIVE_COMP
int
dynlib_close (dynlib_handle_ptr h)
{
return dlclose (h) == 0;
}
+# endif
#else
diff --git a/src/fileio.c b/src/fileio.c
index a0282204de..5d66a93ac6 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2505,6 +2505,8 @@ With a prefix argument, TRASH is nil. */)
return Qnil;
}
+#if defined HAVE_NATIVE_COMP && defined WINDOWSNT
+
static Lisp_Object
internal_delete_file_1 (Lisp_Object ignore)
{
@@ -2523,6 +2525,8 @@ internal_delete_file (Lisp_Object filename)
Qt, internal_delete_file_1);
return NILP (tem);
}
+
+#endif
/* Return -1 if FILE is a case-insensitive file name, 0 if not,
and a positive errno value if the result cannot be determined. */
- master updated (71b8f1fc63 -> ccf4a4fa48), Paul Eggert, 2022/03/19
- master c3c5e50ba4 4/9: Use filenvercmp instead of doing it by hand, Paul Eggert, 2022/03/19
- master abfb76732c 2/9: Remove internal_condition_case_[345], Paul Eggert, 2022/03/19
- master a5cbd98376 3/9: Omit unnecessary code when !HAVE_NATIVE_COMP,
Paul Eggert <=
- master 035e8e4d45 1/9: Remove sanitize_window_sizes, Paul Eggert, 2022/03/19
- master 0fed561042 5/9: Remove unused fns/data and make fns static, Paul Eggert, 2022/03/19
- master 495d8519ca 7/9: Simplify alloc.c static function decls, Paul Eggert, 2022/03/19
- master c11b4758b7 8/9: valid_sp inline fix, Paul Eggert, 2022/03/19
- master c386f7e825 6/9: Make native helper functions static, Paul Eggert, 2022/03/19
- master ccf4a4fa48 9/9: Port to gcc -D EMACS_EXTERN_INLINE, Paul Eggert, 2022/03/19