1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-20 18:50:21 +02:00

misc: Make jit_note and related functions take a const argument

Make jit_memcpy, jit_memmove, jit_data take const pointers to
allow jit_note to be used with a const string (e.g. a string
literal, __FILE__ or __func__). This is needed for GNU Smalltalk
to silence compiler warnings.

Sadly "const jit_pointer_t" is not the same as "typedef const void *"
so I introduced a new typedef for a const jit pointer. The other
option would be to replace jit_pointer_t with void*.
This commit is contained in:
Holger Hans Peter Freyther 2014-10-26 22:21:42 +01:00 committed by pcpa
parent 44519452d9
commit 2229200c44
5 changed files with 12 additions and 11 deletions

View file

@ -39,7 +39,7 @@ static jit_free_func_ptr jit_free_ptr = jit_default_free_func;
* Implementation
*/
jit_pointer_t
jit_memcpy(jit_pointer_t dst, jit_pointer_t src, jit_word_t size)
jit_memcpy(jit_pointer_t dst, jit_const_pointer_t src, jit_word_t size)
{
if (size)
return (memcpy(dst, src, size));
@ -47,7 +47,7 @@ jit_memcpy(jit_pointer_t dst, jit_pointer_t src, jit_word_t size)
}
jit_pointer_t
jit_memmove(jit_pointer_t dst, jit_pointer_t src , jit_word_t size)
jit_memmove(jit_pointer_t dst, jit_const_pointer_t src , jit_word_t size)
{
if (size)
return (memmove(dst, src, size));