aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2017-02-26 09:56:44 -0800
committerPaul Eggert2017-02-26 09:58:25 -0800
commitd83c75ec19b549a1700622157d0ee292ca59785e (patch)
treeb7efd5d79d90b970662d2229241602dc93cdde35 /src
parentd8899b9d1baf517b30ec4752d1458e2a06000646 (diff)
downloademacs-d83c75ec19b549a1700622157d0ee292ca59785e.tar.gz
emacs-d83c75ec19b549a1700622157d0ee292ca59785e.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/eval.c12
-rw-r--r--src/lisp.h2
-rw-r--r--src/print.c18
-rw-r--r--src/systhread.c40
-rw-r--r--src/systhread.h2
5 files changed, 4 insertions, 70 deletions
diff --git a/src/eval.c b/src/eval.c
index 22b02b49521..9b36ee04ed2 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -3213,18 +3213,6 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
3213 return 0; 3213 return 0;
3214} 3214}
3215 3215
3216bool
3217let_shadows_global_binding_p (Lisp_Object symbol)
3218{
3219 union specbinding *p;
3220
3221 for (p = specpdl_ptr; p > specpdl; )
3222 if ((--p)->kind >= SPECPDL_LET && EQ (specpdl_symbol (p), symbol))
3223 return 1;
3224
3225 return 0;
3226}
3227
3228static void 3216static void
3229do_specbind (struct Lisp_Symbol *sym, union specbinding *bind, 3217do_specbind (struct Lisp_Symbol *sym, union specbinding *bind,
3230 Lisp_Object value, enum Set_Internal_Bind bindflag) 3218 Lisp_Object value, enum Set_Internal_Bind bindflag)
diff --git a/src/lisp.h b/src/lisp.h
index e048011a860..238c20bc189 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3707,7 +3707,6 @@ extern Lisp_Object Vprin1_to_string_buffer;
3707extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE; 3707extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
3708extern void temp_output_buffer_setup (const char *); 3708extern void temp_output_buffer_setup (const char *);
3709extern int print_level; 3709extern int print_level;
3710extern void write_string (const char *);
3711extern void print_error_message (Lisp_Object, Lisp_Object, const char *, 3710extern void print_error_message (Lisp_Object, Lisp_Object, const char *,
3712 Lisp_Object); 3711 Lisp_Object);
3713extern Lisp_Object internal_with_output_to_temp_buffer 3712extern Lisp_Object internal_with_output_to_temp_buffer
@@ -3848,7 +3847,6 @@ extern void mark_specpdl (union specbinding *first, union specbinding *ptr);
3848extern void get_backtrace (Lisp_Object array); 3847extern void get_backtrace (Lisp_Object array);
3849Lisp_Object backtrace_top_function (void); 3848Lisp_Object backtrace_top_function (void);
3850extern bool let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol); 3849extern bool let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol);
3851extern bool let_shadows_global_binding_p (Lisp_Object symbol);
3852 3850
3853#ifdef HAVE_MODULES 3851#ifdef HAVE_MODULES
3854/* Defined in alloc.c. */ 3852/* Defined in alloc.c. */
diff --git a/src/print.c b/src/print.c
index d8acf838749..85a6c4627e1 100644
--- a/src/print.c
+++ b/src/print.c
@@ -522,23 +522,13 @@ print_c_string (char const *string, Lisp_Object printcharfun)
522 Do not use this on the contents of a Lisp string. */ 522 Do not use this on the contents of a Lisp string. */
523 523
524static void 524static void
525write_string_1 (const char *data, Lisp_Object printcharfun) 525write_string (const char *data, Lisp_Object printcharfun)
526{ 526{
527 PRINTPREPARE; 527 PRINTPREPARE;
528 print_c_string (data, printcharfun); 528 print_c_string (data, printcharfun);
529 PRINTFINISH; 529 PRINTFINISH;
530} 530}
531 531
532/* Used from outside of print.c to print a C unibyte
533 string at DATA on the default output stream.
534 Do not use this on the contents of a Lisp string. */
535
536void
537write_string (const char *data)
538{
539 write_string_1 (data, Vstandard_output);
540}
541
542 532
543void 533void
544temp_output_buffer_setup (const char *bufname) 534temp_output_buffer_setup (const char *bufname)
@@ -888,7 +878,7 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context,
888 Lisp_Object errname, errmsg, file_error, tail; 878 Lisp_Object errname, errmsg, file_error, tail;
889 879
890 if (context != 0) 880 if (context != 0)
891 write_string_1 (context, stream); 881 write_string (context, stream);
892 882
893 /* If we know from where the error was signaled, show it in 883 /* If we know from where the error was signaled, show it in
894 *Messages*. */ 884 *Messages*. */
@@ -934,7 +924,7 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context,
934 const char *sep = ": "; 924 const char *sep = ": ";
935 925
936 if (!STRINGP (errmsg)) 926 if (!STRINGP (errmsg))
937 write_string_1 ("peculiar error", stream); 927 write_string ("peculiar error", stream);
938 else if (SCHARS (errmsg)) 928 else if (SCHARS (errmsg))
939 Fprinc (errmsg, stream); 929 Fprinc (errmsg, stream);
940 else 930 else
@@ -945,7 +935,7 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context,
945 Lisp_Object obj; 935 Lisp_Object obj;
946 936
947 if (sep) 937 if (sep)
948 write_string_1 (sep, stream); 938 write_string (sep, stream);
949 obj = XCAR (tail); 939 obj = XCAR (tail);
950 if (!NILP (file_error) 940 if (!NILP (file_error)
951 || EQ (errname, Qend_of_file) || EQ (errname, Quser_error)) 941 || EQ (errname, Qend_of_file) || EQ (errname, Quser_error))
diff --git a/src/systhread.c b/src/systhread.c
index a1b3eae64a6..a84060c18f0 100644
--- a/src/systhread.c
+++ b/src/systhread.c
@@ -39,11 +39,6 @@ sys_mutex_unlock (sys_mutex_t *m)
39} 39}
40 40
41void 41void
42sys_mutex_destroy (sys_mutex_t *m)
43{
44}
45
46void
47sys_cond_init (sys_cond_t *c) 42sys_cond_init (sys_cond_t *c)
48{ 43{
49 *c = 0; 44 *c = 0;
@@ -76,12 +71,6 @@ sys_thread_self (void)
76} 71}
77 72
78int 73int
79sys_thread_equal (sys_thread_t x, sys_thread_t y)
80{
81 return x == y;
82}
83
84int
85sys_thread_create (sys_thread_t *t, const char *name, 74sys_thread_create (sys_thread_t *t, const char *name,
86 thread_creation_function *func, void *datum) 75 thread_creation_function *func, void *datum)
87{ 76{
@@ -120,12 +109,6 @@ sys_mutex_unlock (sys_mutex_t *mutex)
120} 109}
121 110
122void 111void
123sys_mutex_destroy (sys_mutex_t *mutex)
124{
125 pthread_mutex_destroy (mutex);
126}
127
128void
129sys_cond_init (sys_cond_t *cond) 112sys_cond_init (sys_cond_t *cond)
130{ 113{
131 pthread_cond_init (cond, NULL); 114 pthread_cond_init (cond, NULL);
@@ -162,12 +145,6 @@ sys_thread_self (void)
162} 145}
163 146
164int 147int
165sys_thread_equal (sys_thread_t one, sys_thread_t two)
166{
167 return pthread_equal (one, two);
168}
169
170int
171sys_thread_create (sys_thread_t *thread_ptr, const char *name, 148sys_thread_create (sys_thread_t *thread_ptr, const char *name,
172 thread_creation_function *func, void *arg) 149 thread_creation_function *func, void *arg)
173{ 150{
@@ -230,17 +207,6 @@ sys_mutex_unlock (sys_mutex_t *mutex)
230} 207}
231 208
232void 209void
233sys_mutex_destroy (sys_mutex_t *mutex)
234{
235 /* FIXME: According to MSDN, deleting a critical session that is
236 owned by a thread leaves the other threads waiting for the
237 critical session in an undefined state. Posix docs seem to say
238 the same about pthread_mutex_destroy. Do we need to protect
239 against such calamities? */
240 DeleteCriticalSection ((LPCRITICAL_SECTION)mutex);
241}
242
243void
244sys_cond_init (sys_cond_t *cond) 210sys_cond_init (sys_cond_t *cond)
245{ 211{
246 cond->initialized = false; 212 cond->initialized = false;
@@ -346,12 +312,6 @@ sys_thread_self (void)
346 return (sys_thread_t) GetCurrentThreadId (); 312 return (sys_thread_t) GetCurrentThreadId ();
347} 313}
348 314
349int
350sys_thread_equal (sys_thread_t one, sys_thread_t two)
351{
352 return one == two;
353}
354
355static thread_creation_function *thread_start_address; 315static thread_creation_function *thread_start_address;
356 316
357/* _beginthread wants a void function, while we are passed a function 317/* _beginthread wants a void function, while we are passed a function
diff --git a/src/systhread.h b/src/systhread.h
index c007d3ceb53..c7999c0651d 100644
--- a/src/systhread.h
+++ b/src/systhread.h
@@ -92,7 +92,6 @@ typedef void *(thread_creation_function) (void *);
92extern void sys_mutex_init (sys_mutex_t *); 92extern void sys_mutex_init (sys_mutex_t *);
93extern void sys_mutex_lock (sys_mutex_t *); 93extern void sys_mutex_lock (sys_mutex_t *);
94extern void sys_mutex_unlock (sys_mutex_t *); 94extern void sys_mutex_unlock (sys_mutex_t *);
95extern void sys_mutex_destroy (sys_mutex_t *);
96 95
97extern void sys_cond_init (sys_cond_t *); 96extern void sys_cond_init (sys_cond_t *);
98extern void sys_cond_wait (sys_cond_t *, sys_mutex_t *); 97extern void sys_cond_wait (sys_cond_t *, sys_mutex_t *);
@@ -101,7 +100,6 @@ extern void sys_cond_broadcast (sys_cond_t *);
101extern void sys_cond_destroy (sys_cond_t *); 100extern void sys_cond_destroy (sys_cond_t *);
102 101
103extern sys_thread_t sys_thread_self (void); 102extern sys_thread_t sys_thread_self (void);
104extern int sys_thread_equal (sys_thread_t, sys_thread_t);
105 103
106extern int sys_thread_create (sys_thread_t *, const char *, 104extern int sys_thread_create (sys_thread_t *, const char *,
107 thread_creation_function *, 105 thread_creation_function *,