diff options
| author | Paul Eggert | 2017-02-26 09:56:44 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-02-26 09:58:25 -0800 |
| commit | d83c75ec19b549a1700622157d0ee292ca59785e (patch) | |
| tree | b7efd5d79d90b970662d2229241602dc93cdde35 /src | |
| parent | d8899b9d1baf517b30ec4752d1458e2a06000646 (diff) | |
| download | emacs-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.c | 12 | ||||
| -rw-r--r-- | src/lisp.h | 2 | ||||
| -rw-r--r-- | src/print.c | 18 | ||||
| -rw-r--r-- | src/systhread.c | 40 | ||||
| -rw-r--r-- | src/systhread.h | 2 |
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 | ||
| 3216 | bool | ||
| 3217 | let_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 | |||
| 3228 | static void | 3216 | static void |
| 3229 | do_specbind (struct Lisp_Symbol *sym, union specbinding *bind, | 3217 | do_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; | |||
| 3707 | extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE; | 3707 | extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE; |
| 3708 | extern void temp_output_buffer_setup (const char *); | 3708 | extern void temp_output_buffer_setup (const char *); |
| 3709 | extern int print_level; | 3709 | extern int print_level; |
| 3710 | extern void write_string (const char *); | ||
| 3711 | extern void print_error_message (Lisp_Object, Lisp_Object, const char *, | 3710 | extern void print_error_message (Lisp_Object, Lisp_Object, const char *, |
| 3712 | Lisp_Object); | 3711 | Lisp_Object); |
| 3713 | extern Lisp_Object internal_with_output_to_temp_buffer | 3712 | extern Lisp_Object internal_with_output_to_temp_buffer |
| @@ -3848,7 +3847,6 @@ extern void mark_specpdl (union specbinding *first, union specbinding *ptr); | |||
| 3848 | extern void get_backtrace (Lisp_Object array); | 3847 | extern void get_backtrace (Lisp_Object array); |
| 3849 | Lisp_Object backtrace_top_function (void); | 3848 | Lisp_Object backtrace_top_function (void); |
| 3850 | extern bool let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol); | 3849 | extern bool let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol); |
| 3851 | extern 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 | ||
| 524 | static void | 524 | static void |
| 525 | write_string_1 (const char *data, Lisp_Object printcharfun) | 525 | write_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 | |||
| 536 | void | ||
| 537 | write_string (const char *data) | ||
| 538 | { | ||
| 539 | write_string_1 (data, Vstandard_output); | ||
| 540 | } | ||
| 541 | |||
| 542 | 532 | ||
| 543 | void | 533 | void |
| 544 | temp_output_buffer_setup (const char *bufname) | 534 | temp_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 | ||
| 41 | void | 41 | void |
| 42 | sys_mutex_destroy (sys_mutex_t *m) | ||
| 43 | { | ||
| 44 | } | ||
| 45 | |||
| 46 | void | ||
| 47 | sys_cond_init (sys_cond_t *c) | 42 | sys_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 | ||
| 78 | int | 73 | int |
| 79 | sys_thread_equal (sys_thread_t x, sys_thread_t y) | ||
| 80 | { | ||
| 81 | return x == y; | ||
| 82 | } | ||
| 83 | |||
| 84 | int | ||
| 85 | sys_thread_create (sys_thread_t *t, const char *name, | 74 | sys_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 | ||
| 122 | void | 111 | void |
| 123 | sys_mutex_destroy (sys_mutex_t *mutex) | ||
| 124 | { | ||
| 125 | pthread_mutex_destroy (mutex); | ||
| 126 | } | ||
| 127 | |||
| 128 | void | ||
| 129 | sys_cond_init (sys_cond_t *cond) | 112 | sys_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 | ||
| 164 | int | 147 | int |
| 165 | sys_thread_equal (sys_thread_t one, sys_thread_t two) | ||
| 166 | { | ||
| 167 | return pthread_equal (one, two); | ||
| 168 | } | ||
| 169 | |||
| 170 | int | ||
| 171 | sys_thread_create (sys_thread_t *thread_ptr, const char *name, | 148 | sys_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 | ||
| 232 | void | 209 | void |
| 233 | sys_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 | |||
| 243 | void | ||
| 244 | sys_cond_init (sys_cond_t *cond) | 210 | sys_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 | ||
| 349 | int | ||
| 350 | sys_thread_equal (sys_thread_t one, sys_thread_t two) | ||
| 351 | { | ||
| 352 | return one == two; | ||
| 353 | } | ||
| 354 | |||
| 355 | static thread_creation_function *thread_start_address; | 315 | static 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 *); | |||
| 92 | extern void sys_mutex_init (sys_mutex_t *); | 92 | extern void sys_mutex_init (sys_mutex_t *); |
| 93 | extern void sys_mutex_lock (sys_mutex_t *); | 93 | extern void sys_mutex_lock (sys_mutex_t *); |
| 94 | extern void sys_mutex_unlock (sys_mutex_t *); | 94 | extern void sys_mutex_unlock (sys_mutex_t *); |
| 95 | extern void sys_mutex_destroy (sys_mutex_t *); | ||
| 96 | 95 | ||
| 97 | extern void sys_cond_init (sys_cond_t *); | 96 | extern void sys_cond_init (sys_cond_t *); |
| 98 | extern void sys_cond_wait (sys_cond_t *, sys_mutex_t *); | 97 | extern void sys_cond_wait (sys_cond_t *, sys_mutex_t *); |
| @@ -101,7 +100,6 @@ extern void sys_cond_broadcast (sys_cond_t *); | |||
| 101 | extern void sys_cond_destroy (sys_cond_t *); | 100 | extern void sys_cond_destroy (sys_cond_t *); |
| 102 | 101 | ||
| 103 | extern sys_thread_t sys_thread_self (void); | 102 | extern sys_thread_t sys_thread_self (void); |
| 104 | extern int sys_thread_equal (sys_thread_t, sys_thread_t); | ||
| 105 | 103 | ||
| 106 | extern int sys_thread_create (sys_thread_t *, const char *, | 104 | extern int sys_thread_create (sys_thread_t *, const char *, |
| 107 | thread_creation_function *, | 105 | thread_creation_function *, |