Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: basecamp/mysql2
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fffaa424adabb629ec707a951e951131c2bc3307
Choose a base ref
..
head repository: basecamp/mysql2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b8ab80dc57e895c2a5c54f7fe64a89284b37f376
Choose a head ref
Showing with 7 additions and 17 deletions.
  1. +7 −17 ext/mysql2/mysql_enc_name_to_ruby.h
24 changes: 7 additions & 17 deletions ext/mysql2/mysql_enc_name_to_ruby.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* C code produced by gperf version 3.0.4 */
/* Command-line: gperf */
/* ANSI-C code produced by gperf version 3.1 */
/* Command-line: /usr/bin/gperf */
/* Computed positions: -k'1,3,$' */

#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -26,7 +26,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-gperf@gnu.org>."
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
#endif

struct mysql2_mysql_enc_name_to_rb_map { const char *name; const char *rb_name; };
@@ -40,9 +40,7 @@ inline
#endif
#endif
static unsigned int
mysql2_mysql_enc_name_to_rb_hash (str, len)
register const char *str;
register unsigned int len;
mysql2_mysql_enc_name_to_rb_hash (register const char *str, register size_t len)
{
static const unsigned char asso_values[] =
{
@@ -76,16 +74,8 @@ mysql2_mysql_enc_name_to_rb_hash (str, len)
return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]];
}

#ifdef __GNUC__
__inline
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
const struct mysql2_mysql_enc_name_to_rb_map *
mysql2_mysql_enc_name_to_rb (str, len)
register const char *str;
register unsigned int len;
mysql2_mysql_enc_name_to_rb (register const char *str, register size_t len)
{
enum
{
@@ -159,9 +149,9 @@ mysql2_mysql_enc_name_to_rb (str, len)

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

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