Skip to content

Commit

Permalink
htmlchar: updates from newer gperf
Browse files Browse the repository at this point in the history
  • Loading branch information
elliefm committed Jan 3, 2025
1 parent 4d42787 commit ef24264
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions lib/htmlchar.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* ANSI-C code produced by gperf version 3.0.3 */
/* Command-line: gperf /tmp/compile_st_9xQvtm.gperf */
/* ANSI-C code produced by gperf version 3.1 */
/* Computed positions: -k'1-7,10,12,$' */

#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
Expand All @@ -26,7 +25,7 @@
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-[email protected]>."
#error "gperf generated tables don't work with this execution character set. Please report a bug to <[email protected]>."
#endif


Expand All @@ -50,7 +49,7 @@ inline
#endif
#endif
static unsigned int
hash (register const char *str, register unsigned int len)
hash (register const char *str, register size_t len)
{
static const unsigned short asso_values[] =
{
Expand Down Expand Up @@ -81,7 +80,7 @@ hash (register const char *str, register unsigned int len)
18061, 18061, 18061, 18061, 18061, 18061, 18061, 18061, 18061, 18061,
18061, 18061, 18061, 18061, 18061, 18061, 18061, 18061, 18061, 18061
};
register int hval = len;
register unsigned int hval = len;

switch (hval)
{
Expand Down Expand Up @@ -119,14 +118,8 @@ hash (register const char *str, register unsigned int len)
return hval + asso_values[(unsigned char)str[len - 1]];
}

#ifdef __GNUC__
__inline
#ifdef __GNUC_STDC_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
const struct htmlchar_desc *
__htmlchar_lookup (register const char *str, register unsigned int len)
__htmlchar_lookup (register const char *str, register size_t len)
{
static const struct htmlchar_desc wordlist[] =
{
Expand Down Expand Up @@ -5070,9 +5063,9 @@ __htmlchar_lookup (register const char *str, register unsigned int len)

if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
register unsigned int key = hash (str, len);

if (key <= MAX_HASH_VALUE && key >= 0)
if (key <= MAX_HASH_VALUE)
{
register const char *s = wordlist[key].name;

Expand Down

0 comments on commit ef24264

Please sign in to comment.