~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/strfunc.cc

  • Committer: Monty Taylor
  • Date: 2009-03-08 23:45:12 UTC
  • mto: (923.2.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 921.
  • Revision ID: mordred@inaugust.com-20090308234512-tqkygxtu1iaig23s
Removed C99 isnan() usage, which allows us to remove the util/math.{cc,h} workarounds. Yay for standards!

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
  *err_pos= 0;                  // No error yet
48
48
  if (str != end)
49
49
  {
50
 
    const char *start= str;    
 
50
    const char *start= str;
51
51
    for (;;)
52
52
    {
53
53
      const char *pos= start;
59
59
        for ( ; pos < end; pos+= mblen)
60
60
        {
61
61
          my_wc_t wc;
62
 
          if ((mblen= cs->cset->mb_wc(cs, &wc, (const unsigned char *) pos, 
 
62
          if ((mblen= cs->cset->mb_wc(cs, &wc, (const unsigned char *) pos,
63
63
                                               (const unsigned char *) end)) < 1)
64
64
            mblen= 1; // Not to hang on a wrong multibyte sequence
65
65
          if (wc == (my_wc_t) field_separator)
68
68
      }
69
69
      else
70
70
        for (; pos != end && *pos != field_separator; pos++) ;
71
 
      var_len= (uint) (pos - start);
 
71
      var_len= (uint32_t) (pos - start);
72
72
      uint32_t find= cs ? find_type2(lib, start, var_len, cs) :
73
73
                      find_type(lib, start, var_len, (bool) 0);
74
74
      if (!find)
113
113
  const char *j;
114
114
  for (uint32_t pos=0 ; (j=lib->type_names[pos++]) ; )
115
115
  {
116
 
    for (i=find ; i != end && 
117
 
           my_toupper(system_charset_info,*i) == 
 
116
    for (i=find ; i != end &&
 
117
           my_toupper(system_charset_info,*i) ==
118
118
           my_toupper(system_charset_info,*j) ; i++, j++) ;
119
119
    if (i == end)
120
120
    {
228
228
  /* Fiend end of word */
229
229
  for (ptr= val ; ptr < end && my_isalpha(&my_charset_utf8_general_ci, *ptr) ; ptr++)
230
230
    ;
231
 
  if ((res=find_type(lib, val, (uint) (ptr - val), 1)) > 0)
 
231
  if ((res=find_type(lib, val, (uint32_t) (ptr - val), 1)) > 0)
232
232
    *end_of_word= ptr;
233
233
  return res;
234
234
}