From cb8f88ea8220ff00d333c27af3463fd2d441f818 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 14 Dec 2011 10:01:24 +0100 Subject: [PATCH] * include/grub/charset.h (grub_utf16_to_utf8): Make src a const pointer. (grub_ucs4_to_utf8_alloc): Likewise. (grub_ucs4_to_utf8): Likewise. * grub-core/normal/charset.c (grub_ucs4_to_utf8): Likewise. (grub_ucs4_to_utf8_alloc): Likewise. --- ChangeLog | 8 ++++++++ grub-core/normal/charset.c | 6 +++--- include/grub/charset.h | 6 +++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d811e710..90f63fb77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-12-14 Vladimir Serbinenko + + * include/grub/charset.h (grub_utf16_to_utf8): Make src a const pointer. + (grub_ucs4_to_utf8_alloc): Likewise. + (grub_ucs4_to_utf8): Likewise. + * grub-core/normal/charset.c (grub_ucs4_to_utf8): Likewise. + (grub_ucs4_to_utf8_alloc): Likewise. + 2011-12-14 Vladimir Serbinenko AFFS never uses unicode. diff --git a/grub-core/normal/charset.c b/grub-core/normal/charset.c index d089843cc..ee4a7ef5f 100644 --- a/grub-core/normal/charset.c +++ b/grub-core/normal/charset.c @@ -197,7 +197,7 @@ grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend, /* Convert UCS-4 to UTF-8. */ void -grub_ucs4_to_utf8 (grub_uint32_t *src, grub_size_t size, +grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size, grub_uint8_t *dest, grub_size_t destsize) { /* Keep last char for \0. */ @@ -223,10 +223,10 @@ grub_ucs4_to_utf8 (grub_uint32_t *src, grub_size_t size, /* Convert UCS-4 to UTF-8. */ char * -grub_ucs4_to_utf8_alloc (grub_uint32_t *src, grub_size_t size) +grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size) { grub_size_t remaining; - grub_uint32_t *ptr; + const grub_uint32_t *ptr; grub_size_t cnt = 0; grub_uint8_t *ret; diff --git a/include/grub/charset.h b/include/grub/charset.h index 2b1f54fe8..b0960c940 100644 --- a/include/grub/charset.h +++ b/include/grub/charset.h @@ -51,7 +51,7 @@ grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize, /* Convert UTF-16 to UTF-8. */ static inline grub_uint8_t * -grub_utf16_to_utf8 (grub_uint8_t *dest, grub_uint16_t *src, +grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src, grub_size_t size) { grub_uint32_t code_high = 0; @@ -141,7 +141,7 @@ grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src, } /* Convert UCS-4 to UTF-8. */ -char *grub_ucs4_to_utf8_alloc (grub_uint32_t *src, grub_size_t size); +char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size); int grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize); @@ -156,7 +156,7 @@ int grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count); void -grub_ucs4_to_utf8 (grub_uint32_t *src, grub_size_t size, +grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size, grub_uint8_t *dest, grub_size_t destsize); grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize, const grub_uint8_t *src, grub_size_t srcsize,