mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-27 09:39:22 +00:00
Revert few useless changes
This commit is contained in:
1 parent
7bda71ce3c
commit
951ce61283
5 files changed
+35
-58
No files matched your search
+15
-15
@@ -102,7 +102,7 @@ grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
|
||||
|
||||
/* Convert UCS-4 to UTF-8. */
|
||||
grub_size_t
|
||||
grub_ucs4_to_utf8 (const grub_wchar_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. */
|
||||
@@ -130,10 +130,10 @@ grub_ucs4_to_utf8 (const grub_wchar_t *src, grub_size_t size,
|
||||
/* Returns the number of bytes the string src would occupy is converted
|
||||
to UTF-8, excluding trailing \0. */
|
||||
grub_size_t
|
||||
grub_get_num_of_utf8_bytes (const grub_wchar_t *src, grub_size_t size)
|
||||
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size)
|
||||
{
|
||||
grub_size_t remaining;
|
||||
const grub_wchar_t *ptr;
|
||||
const grub_uint32_t *ptr;
|
||||
grub_size_t cnt = 0;
|
||||
|
||||
remaining = size;
|
||||
@@ -178,7 +178,7 @@ int
|
||||
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize)
|
||||
{
|
||||
int count = 0;
|
||||
grub_wchar_t code = 0;
|
||||
grub_uint32_t code = 0;
|
||||
|
||||
while (srcsize)
|
||||
{
|
||||
@@ -198,8 +198,8 @@ grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize)
|
||||
}
|
||||
|
||||
grub_ssize_t
|
||||
grub_utf8_to_ucs4_alloc (const char *msg, grub_wchar_t **unicode_msg,
|
||||
grub_wchar_t **last_position)
|
||||
grub_utf8_to_ucs4_alloc (const char *msg, grub_uint32_t **unicode_msg,
|
||||
grub_uint32_t **last_position)
|
||||
{
|
||||
grub_size_t msg_len = grub_strlen (msg);
|
||||
|
||||
@@ -224,13 +224,13 @@ grub_utf8_to_ucs4_alloc (const char *msg, grub_wchar_t **unicode_msg,
|
||||
If SRCEND is not NULL, then *SRCEND is set to the next byte after the
|
||||
last byte used in SRC. */
|
||||
grub_size_t
|
||||
grub_utf8_to_ucs4 (grub_wchar_t *dest, grub_size_t destsize,
|
||||
grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
|
||||
const grub_uint8_t *src, grub_size_t srcsize,
|
||||
const grub_uint8_t **srcend)
|
||||
{
|
||||
grub_wchar_t *p = dest;
|
||||
grub_uint32_t *p = dest;
|
||||
int count = 0;
|
||||
grub_wchar_t code = 0;
|
||||
grub_uint32_t code = 0;
|
||||
|
||||
if (srcend)
|
||||
*srcend = src;
|
||||
@@ -419,11 +419,11 @@ is_type_after (enum grub_comb_type a, enum grub_comb_type b)
|
||||
}
|
||||
|
||||
grub_size_t
|
||||
grub_unicode_aglomerate_comb (const grub_wchar_t *in, grub_size_t inlen,
|
||||
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
|
||||
struct grub_unicode_glyph *out)
|
||||
{
|
||||
int haveout = 0;
|
||||
const grub_wchar_t *ptr;
|
||||
const grub_uint32_t *ptr;
|
||||
unsigned last_comb_pointer = 0;
|
||||
|
||||
grub_memset (out, 0, sizeof (*out));
|
||||
@@ -764,7 +764,7 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out,
|
||||
|
||||
|
||||
static grub_ssize_t
|
||||
grub_bidi_line_logical_to_visual (const grub_wchar_t *logical,
|
||||
grub_bidi_line_logical_to_visual (const grub_uint32_t *logical,
|
||||
grub_size_t logical_len,
|
||||
struct grub_unicode_glyph *visual_out,
|
||||
grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
|
||||
@@ -839,7 +839,7 @@ grub_bidi_line_logical_to_visual (const grub_wchar_t *logical,
|
||||
cur_level = base_level;
|
||||
cur_override = OVERRIDE_NEUTRAL;
|
||||
{
|
||||
const grub_wchar_t *lptr;
|
||||
const grub_uint32_t *lptr;
|
||||
enum {JOIN_DEFAULT, NOJOIN, JOIN_FORCE} join_state = JOIN_DEFAULT;
|
||||
int zwj_propagate_to_previous = 0;
|
||||
for (lptr = logical; lptr < logical + logical_len;)
|
||||
@@ -1122,7 +1122,7 @@ grub_bidi_line_logical_to_visual (const grub_wchar_t *logical,
|
||||
}
|
||||
|
||||
grub_ssize_t
|
||||
grub_bidi_logical_to_visual (const grub_wchar_t *logical,
|
||||
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
|
||||
grub_size_t logical_len,
|
||||
struct grub_unicode_glyph **visual_out,
|
||||
grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
|
||||
@@ -1130,7 +1130,7 @@ grub_bidi_logical_to_visual (const grub_wchar_t *logical,
|
||||
grub_size_t max_length, grub_size_t startwidth,
|
||||
grub_uint32_t contchar, struct grub_term_pos *pos, int primitive_wrap)
|
||||
{
|
||||
const grub_wchar_t *line_start = logical, *ptr;
|
||||
const grub_uint32_t *line_start = logical, *ptr;
|
||||
struct grub_unicode_glyph *visual_ptr;
|
||||
*visual_out = visual_ptr = grub_malloc (3 * sizeof (visual_ptr[0])
|
||||
* logical_len);
|
||||
|
||||
+8
-24
@@ -19,17 +19,7 @@
|
||||
#ifndef GRUB_CHARSET_HEADER
|
||||
#define GRUB_CHARSET_HEADER 1
|
||||
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
#define __need_wchar_t 1
|
||||
#define __need_wint_t 1
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/misc.h>
|
||||
#ifndef WCHAR_MAX
|
||||
#define WCHAR_MAX __WCHAR_MAX__
|
||||
#endif
|
||||
#define GRUB_WCHAR_MAX WCHAR_MAX
|
||||
|
||||
#define GRUB_UINT8_1_LEADINGBIT 0x80
|
||||
#define GRUB_UINT8_2_LEADINGBITS 0xc0
|
||||
@@ -59,16 +49,12 @@
|
||||
#define GRUB_UTF16_LOWER_SURROGATE(code) \
|
||||
(0xDC00 | (((code) - GRUB_UCS2_LIMIT) & 0x3ff))
|
||||
|
||||
typedef wchar_t grub_wchar_t;
|
||||
|
||||
/* Process one character from UTF8 sequence.
|
||||
At beginning set *code = 0, *count = 0. Returns 0 on failure and
|
||||
1 on success. *count holds the number of trailing bytes. */
|
||||
static inline int
|
||||
grub_utf8_process (grub_uint8_t c, grub_wchar_t *code, int *count)
|
||||
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
|
||||
{
|
||||
COMPILE_TIME_ASSERT (sizeof (grub_wchar_t) == 4);
|
||||
COMPILE_TIME_ASSERT ((WCHAR_MAX >> 20));
|
||||
if (*count)
|
||||
{
|
||||
if ((c & GRUB_UINT8_2_LEADINGBITS) != GRUB_UINT8_1_LEADINGBIT)
|
||||
@@ -141,7 +127,7 @@ grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
|
||||
{
|
||||
grub_uint16_t *p = dest;
|
||||
int count = 0;
|
||||
grub_wchar_t code = 0;
|
||||
grub_uint32_t code = 0;
|
||||
|
||||
if (srcend)
|
||||
*srcend = src;
|
||||
@@ -303,26 +289,26 @@ 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 (const grub_wchar_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);
|
||||
|
||||
grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
|
||||
grub_wchar_t **unicode_msg,
|
||||
grub_wchar_t **last_position);
|
||||
grub_uint32_t **unicode_msg,
|
||||
grub_uint32_t **last_position);
|
||||
|
||||
/* Returns the number of bytes the string src would occupy is converted
|
||||
to UTF-8, excluding \0. */
|
||||
grub_size_t
|
||||
grub_get_num_of_utf8_bytes (const grub_wchar_t *src, grub_size_t size);
|
||||
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);
|
||||
|
||||
/* Converts UCS-4 to UTF-8. Returns the number of bytes effectively written
|
||||
excluding the trailing \0. */
|
||||
grub_size_t
|
||||
grub_ucs4_to_utf8 (const grub_wchar_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_wchar_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,
|
||||
const grub_uint8_t **srcend);
|
||||
/* Returns -2 if not enough space, -1 on invalid character. */
|
||||
@@ -330,8 +316,6 @@ grub_ssize_t
|
||||
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
|
||||
grub_uint32_t code);
|
||||
|
||||
char
|
||||
grub_translit (grub_wchar_t in);
|
||||
const grub_uint32_t *
|
||||
grub_unicode_get_comb_start (const grub_uint32_t *str,
|
||||
const grub_uint32_t *cur);
|
||||
|
||||
+9
-10
@@ -27,7 +27,6 @@
|
||||
#include <grub/menu.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/file.h>
|
||||
#include <grub/charset.h>
|
||||
|
||||
/* The standard left and right margin for some messages. */
|
||||
#define STANDARD_MARGIN 6
|
||||
@@ -88,25 +87,25 @@ int grub_parse_color_name_pair (grub_uint8_t *ret, const char *name);
|
||||
/* Defined in `menu_text.c'. */
|
||||
void grub_wait_after_message (void);
|
||||
void
|
||||
grub_print_ucs4 (const grub_wchar_t * str,
|
||||
const grub_wchar_t * last_position,
|
||||
grub_print_ucs4 (const grub_uint32_t * str,
|
||||
const grub_uint32_t * last_position,
|
||||
int margin_left, int margin_right,
|
||||
struct grub_term_output *term);
|
||||
|
||||
void
|
||||
grub_print_ucs4_menu (const grub_wchar_t * str,
|
||||
const grub_wchar_t * last_position,
|
||||
grub_print_ucs4_menu (const grub_uint32_t * str,
|
||||
const grub_uint32_t * last_position,
|
||||
int margin_left, int margin_right,
|
||||
struct grub_term_output *term,
|
||||
int skip_lines, int max_lines, grub_wchar_t contchar,
|
||||
int skip_lines, int max_lines, grub_uint32_t contchar,
|
||||
struct grub_term_pos *pos);
|
||||
int
|
||||
grub_ucs4_count_lines (const grub_wchar_t * str,
|
||||
const grub_wchar_t * last_position,
|
||||
grub_ucs4_count_lines (const grub_uint32_t * str,
|
||||
const grub_uint32_t * last_position,
|
||||
int margin_left, int margin_right,
|
||||
struct grub_term_output *term);
|
||||
grub_size_t grub_getstringwidth (grub_wchar_t * str,
|
||||
const grub_wchar_t * last_position,
|
||||
grub_size_t grub_getstringwidth (grub_uint32_t * str,
|
||||
const grub_uint32_t * last_position,
|
||||
struct grub_term_output *term);
|
||||
void grub_print_message_indented (const char *msg, int margin_left,
|
||||
int margin_right,
|
||||
|
||||
+1
-6
@@ -323,7 +323,7 @@ grub_term_unregister_output (grub_term_output_t term)
|
||||
#define FOR_ACTIVE_TERM_OUTPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_outputs))
|
||||
#define FOR_DISABLED_TERM_OUTPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_outputs_disabled))
|
||||
|
||||
void grub_putcode (grub_wchar_t code, struct grub_term_output *term);
|
||||
void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
|
||||
int EXPORT_FUNC(grub_getkey) (void);
|
||||
int EXPORT_FUNC(grub_getkey_noblock) (void);
|
||||
void grub_cls (void);
|
||||
@@ -348,11 +348,6 @@ grub_term_getxy (struct grub_term_output *term)
|
||||
return term->getxy (term);
|
||||
}
|
||||
|
||||
static inline unsigned grub_term_is_tiny (struct grub_term_output *term)
|
||||
{
|
||||
return grub_term_height (term) < 5;
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_term_refresh (struct grub_term_output *term)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <grub/types.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/charset.h>
|
||||
|
||||
struct grub_unicode_bidi_pair
|
||||
{
|
||||
@@ -251,7 +250,7 @@ struct grub_term_pos
|
||||
};
|
||||
|
||||
grub_ssize_t
|
||||
grub_bidi_logical_to_visual (const grub_wchar_t *logical,
|
||||
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
|
||||
grub_size_t logical_len,
|
||||
struct grub_unicode_glyph **visual_out,
|
||||
grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
|
||||
@@ -264,7 +263,7 @@ grub_bidi_logical_to_visual (const grub_wchar_t *logical,
|
||||
enum grub_comb_type
|
||||
grub_unicode_get_comb_type (grub_uint32_t c);
|
||||
grub_size_t
|
||||
grub_unicode_aglomerate_comb (const grub_wchar_t *in, grub_size_t inlen,
|
||||
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
|
||||
struct grub_unicode_glyph *out);
|
||||
|
||||
static inline const struct grub_unicode_combining *
|
||||
|
||||
Reference in new issue
Block a user