[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master d83c75e: Remove a few unused C functions
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master d83c75e: Remove a few unused C functions |
Date: |
Sun, 26 Feb 2017 12:58:30 -0500 (EST) |
branch: master
commit d83c75ec19b549a1700622157d0ee292ca59785e
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Remove a few unused C functions
* src/eval.c (let_shadows_global_binding_p):
* src/print.c (write_string):
* src/systhread.c (sys_mutex_destroy, sys_thread_equal):
Remove.
* src/print.c (write_string): Rename from write_string_1.
All uses changed.
---
src/eval.c | 12 ------------
src/lisp.h | 2 --
src/print.c | 18 ++++--------------
src/systhread.c | 40 ----------------------------------------
src/systhread.h | 2 --
5 files changed, 4 insertions(+), 70 deletions(-)
diff --git a/src/eval.c b/src/eval.c
index 22b02b4..9b36ee0 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -3213,18 +3213,6 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
return 0;
}
-bool
-let_shadows_global_binding_p (Lisp_Object symbol)
-{
- union specbinding *p;
-
- for (p = specpdl_ptr; p > specpdl; )
- if ((--p)->kind >= SPECPDL_LET && EQ (specpdl_symbol (p), symbol))
- return 1;
-
- return 0;
-}
-
static void
do_specbind (struct Lisp_Symbol *sym, union specbinding *bind,
Lisp_Object value, enum Set_Internal_Bind bindflag)
diff --git a/src/lisp.h b/src/lisp.h
index e048011..238c20b 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3707,7 +3707,6 @@ extern Lisp_Object Vprin1_to_string_buffer;
extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
extern void temp_output_buffer_setup (const char *);
extern int print_level;
-extern void write_string (const char *);
extern void print_error_message (Lisp_Object, Lisp_Object, const char *,
Lisp_Object);
extern Lisp_Object internal_with_output_to_temp_buffer
@@ -3848,7 +3847,6 @@ extern void mark_specpdl (union specbinding *first, union
specbinding *ptr);
extern void get_backtrace (Lisp_Object array);
Lisp_Object backtrace_top_function (void);
extern bool let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol);
-extern bool let_shadows_global_binding_p (Lisp_Object symbol);
#ifdef HAVE_MODULES
/* Defined in alloc.c. */
diff --git a/src/print.c b/src/print.c
index d8acf83..85a6c46 100644
--- a/src/print.c
+++ b/src/print.c
@@ -522,23 +522,13 @@ print_c_string (char const *string, Lisp_Object
printcharfun)
Do not use this on the contents of a Lisp string. */
static void
-write_string_1 (const char *data, Lisp_Object printcharfun)
+write_string (const char *data, Lisp_Object printcharfun)
{
PRINTPREPARE;
print_c_string (data, printcharfun);
PRINTFINISH;
}
-/* Used from outside of print.c to print a C unibyte
- string at DATA on the default output stream.
- Do not use this on the contents of a Lisp string. */
-
-void
-write_string (const char *data)
-{
- write_string_1 (data, Vstandard_output);
-}
-
void
temp_output_buffer_setup (const char *bufname)
@@ -888,7 +878,7 @@ print_error_message (Lisp_Object data, Lisp_Object stream,
const char *context,
Lisp_Object errname, errmsg, file_error, tail;
if (context != 0)
- write_string_1 (context, stream);
+ write_string (context, stream);
/* If we know from where the error was signaled, show it in
*Messages*. */
@@ -934,7 +924,7 @@ print_error_message (Lisp_Object data, Lisp_Object stream,
const char *context,
const char *sep = ": ";
if (!STRINGP (errmsg))
- write_string_1 ("peculiar error", stream);
+ write_string ("peculiar error", stream);
else if (SCHARS (errmsg))
Fprinc (errmsg, stream);
else
@@ -945,7 +935,7 @@ print_error_message (Lisp_Object data, Lisp_Object stream,
const char *context,
Lisp_Object obj;
if (sep)
- write_string_1 (sep, stream);
+ write_string (sep, stream);
obj = XCAR (tail);
if (!NILP (file_error)
|| EQ (errname, Qend_of_file) || EQ (errname, Quser_error))
diff --git a/src/systhread.c b/src/systhread.c
index a1b3eae..a84060c 100644
--- a/src/systhread.c
+++ b/src/systhread.c
@@ -39,11 +39,6 @@ sys_mutex_unlock (sys_mutex_t *m)
}
void
-sys_mutex_destroy (sys_mutex_t *m)
-{
-}
-
-void
sys_cond_init (sys_cond_t *c)
{
*c = 0;
@@ -76,12 +71,6 @@ sys_thread_self (void)
}
int
-sys_thread_equal (sys_thread_t x, sys_thread_t y)
-{
- return x == y;
-}
-
-int
sys_thread_create (sys_thread_t *t, const char *name,
thread_creation_function *func, void *datum)
{
@@ -120,12 +109,6 @@ sys_mutex_unlock (sys_mutex_t *mutex)
}
void
-sys_mutex_destroy (sys_mutex_t *mutex)
-{
- pthread_mutex_destroy (mutex);
-}
-
-void
sys_cond_init (sys_cond_t *cond)
{
pthread_cond_init (cond, NULL);
@@ -162,12 +145,6 @@ sys_thread_self (void)
}
int
-sys_thread_equal (sys_thread_t one, sys_thread_t two)
-{
- return pthread_equal (one, two);
-}
-
-int
sys_thread_create (sys_thread_t *thread_ptr, const char *name,
thread_creation_function *func, void *arg)
{
@@ -230,17 +207,6 @@ sys_mutex_unlock (sys_mutex_t *mutex)
}
void
-sys_mutex_destroy (sys_mutex_t *mutex)
-{
- /* FIXME: According to MSDN, deleting a critical session that is
- owned by a thread leaves the other threads waiting for the
- critical session in an undefined state. Posix docs seem to say
- the same about pthread_mutex_destroy. Do we need to protect
- against such calamities? */
- DeleteCriticalSection ((LPCRITICAL_SECTION)mutex);
-}
-
-void
sys_cond_init (sys_cond_t *cond)
{
cond->initialized = false;
@@ -346,12 +312,6 @@ sys_thread_self (void)
return (sys_thread_t) GetCurrentThreadId ();
}
-int
-sys_thread_equal (sys_thread_t one, sys_thread_t two)
-{
- return one == two;
-}
-
static thread_creation_function *thread_start_address;
/* _beginthread wants a void function, while we are passed a function
diff --git a/src/systhread.h b/src/systhread.h
index c007d3c..c7999c0 100644
--- a/src/systhread.h
+++ b/src/systhread.h
@@ -92,7 +92,6 @@ typedef void *(thread_creation_function) (void *);
extern void sys_mutex_init (sys_mutex_t *);
extern void sys_mutex_lock (sys_mutex_t *);
extern void sys_mutex_unlock (sys_mutex_t *);
-extern void sys_mutex_destroy (sys_mutex_t *);
extern void sys_cond_init (sys_cond_t *);
extern void sys_cond_wait (sys_cond_t *, sys_mutex_t *);
@@ -101,7 +100,6 @@ extern void sys_cond_broadcast (sys_cond_t *);
extern void sys_cond_destroy (sys_cond_t *);
extern sys_thread_t sys_thread_self (void);
-extern int sys_thread_equal (sys_thread_t, sys_thread_t);
extern int sys_thread_create (sys_thread_t *, const char *,
thread_creation_function *,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master d83c75e: Remove a few unused C functions,
Paul Eggert <=