~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzletest.cc

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1647
1647
        return(0);
1648
1648
      die("Empty variable");
1649
1649
    }
1650
 
    length= (uint) (var_name - save_var_name);
 
1650
    length= (uint32_t) (var_name - save_var_name);
1651
1651
    if (length >= MAX_VAR_NAME_LENGTH)
1652
1652
      die("Too long variable name: %s", save_var_name);
1653
1653
 
1712
1712
  digit= *var_name - '0';
1713
1713
  if (!(digit < 10 && digit >= 0))
1714
1714
  {
1715
 
    v= var_obtain(var_name, (uint) (var_name_end - var_name));
 
1715
    v= var_obtain(var_name, (uint32_t) (var_name_end - var_name));
1716
1716
  }
1717
1717
  else
1718
1718
    v= var_reg + digit;
3277
3277
      (as in ER_WRONG_VALUE vs. ER_WRONG_VALUE_COUNT).
3278
3278
    */
3279
3279
    if (!strncmp(error_name, e->name, (int) (error_end - error_name)) &&
3280
 
        (uint) strlen(e->name) == (uint) (error_end - error_name))
 
3280
        (uint32_t) strlen(e->name) == (uint32_t) (error_end - error_name))
3281
3281
    {
3282
3282
      return(e->code);
3283
3283
    }
3370
3370
      if (!str2int(start, 10, (long) INT_MIN, (long) INT_MAX, &val))
3371
3371
        die("Invalid argument to error: '%s'", command->first_argument);
3372
3372
 
3373
 
      to->code.errnum= (uint) val;
 
3373
      to->code.errnum= (uint32_t) val;
3374
3374
      to->type= ERR_ERRNO;
3375
3375
    }
3376
3376
    to++;
4434
4434
  p= command->query;
4435
4435
  while (*p && !my_isspace(charset_info, *p) && *p != '(')
4436
4436
    p++;
4437
 
  command->first_word_len= (uint) (p - command->query);
 
4437
  command->first_word_len= (uint32_t) (p - command->query);
4438
4438
 
4439
4439
  /* Skip spaces between command and first argument */
4440
4440
  while (*p && my_isspace(charset_info, *p))
5172
5172
  if (command->abort_on_error)
5173
5173
    die("query '%s' failed: %d: %s", command->query, err_errno, err_error);
5174
5174
 
5175
 
  for (i= 0 ; (uint) i < command->expected_errors.count ; i++)
 
5175
  for (i= 0 ; (uint32_t) i < command->expected_errors.count ; i++)
5176
5176
  {
5177
5177
    if (((command->expected_errors.err[i].type == ERR_ERRNO) &&
5178
5178
         (command->expected_errors.err[i].code.errnum == err_errno)) ||
6096
6096
  *pos=0;          /* End pointer */
6097
6097
  if (!(glob_replace= init_replace((char**) from_array.typelib.type_names,
6098
6098
                                   (char**) to_array.typelib.type_names,
6099
 
                                   (uint) from_array.typelib.count,
 
6099
                                   (uint32_t) from_array.typelib.count,
6100
6100
                                   word_end_chars)))
6101
6101
    die("Can't initialize replace from '%s'", command->query);
6102
6102
  free_pointer_array(&from_array);
6483
6483
 
6484
6484
 
6485
6485
#ifndef WORD_BIT
6486
 
#define WORD_BIT (8*sizeof(uint))
 
6486
#define WORD_BIT (8*sizeof(uint32_t))
6487
6487
#endif
6488
6488
 
6489
6489
#define SET_MALLOC_HUNC 64
6583
6583
      return(0);
6584
6584
    }
6585
6585
    states+=len+1;
6586
 
    result_len+=(uint) strlen(to[i])+1;
 
6586
    result_len+=(uint32_t) strlen(to[i])+1;
6587
6587
    if (len > max_length)
6588
6588
      max_length=len;
6589
6589
  }
6681
6681
    follow_ptr->table_offset=i;
6682
6682
    follow_ptr->len=len;
6683
6683
    follow_ptr++;
6684
 
    states+=(uint) len+1;
 
6684
    states+=(uint32_t) len+1;
6685
6685
  }
6686
6686
 
6687
6687
 
6845
6845
  sets->size_of_bits=((states+7)/8);
6846
6846
  if (!(sets->set_buffer=(REP_SET*) malloc(sizeof(REP_SET)*SET_MALLOC_HUNC)))
6847
6847
    return 1;
6848
 
  if (!(sets->bit_buffer=(uint*) malloc(sizeof(uint)*sets->size_of_bits*
 
6848
  if (!(sets->bit_buffer=(uint*) malloc(sizeof(uint32_t)*sets->size_of_bits*
6849
6849
                                        SET_MALLOC_HUNC)))
6850
6850
  {
6851
6851
    free(sets->set);
6871
6871
  {
6872
6872
    sets->extra--;
6873
6873
    set=sets->set+ sets->count++;
6874
 
    memset(set->bits, 0, sizeof(uint)*sets->size_of_bits);
 
6874
    memset(set->bits, 0, sizeof(uint32_t)*sets->size_of_bits);
6875
6875
    memset(&set->next[0], 0, sizeof(set->next[0])*LAST_CHAR_CODE);
6876
6876
    set->found_offset=0;
6877
6877
    set->found_len=0;
6886
6886
  sets->set_buffer=set;
6887
6887
  sets->set=set+sets->invisible;
6888
6888
  if (!(bit_buffer=(uint*) realloc((unsigned char*) sets->bit_buffer,
6889
 
                                   (sizeof(uint)*sets->size_of_bits)*count)))
 
6889
                                   (sizeof(uint32_t)*sets->size_of_bits)*count)))
6890
6890
    return 0;
6891
6891
  sets->bit_buffer=bit_buffer;
6892
6892
  for (i=0 ; i < count ; i++)
6936
6936
void copy_bits(REP_SET *to,REP_SET *from)
6937
6937
{
6938
6938
  memcpy(to->bits,from->bits,
6939
 
         (size_t) (sizeof(uint) * to->size_of_bits));
 
6939
         (size_t) (sizeof(uint32_t) * to->size_of_bits));
6940
6940
}
6941
6941
 
6942
6942
int cmp_bits(REP_SET *set1,REP_SET *set2)
6943
6943
{
6944
 
  return memcmp(set1->bits,set2->bits, sizeof(uint) * set1->size_of_bits);
 
6944
  return memcmp(set1->bits,set2->bits, sizeof(uint32_t) * set1->size_of_bits);
6945
6945
}
6946
6946
 
6947
6947
 
6959
6959
    bits=start[0];
6960
6960
  if (!bits)
6961
6961
    return 0;
6962
 
  pos=(uint) (start-set->bits)*WORD_BIT;
 
6962
  pos=(uint32_t) (start-set->bits)*WORD_BIT;
6963
6963
  while (! (bits & 1))
6964
6964
  {
6965
6965
    bits>>=1;
6996
6996
int find_found(FOUND_SET *found_set,uint32_t table_offset, int found_offset)
6997
6997
{
6998
6998
  int i;
6999
 
  for (i=0 ; (uint) i < found_sets ; i++)
 
6999
  for (i=0 ; (uint32_t) i < found_sets ; i++)
7000
7000
    if (found_set[i].table_offset == table_offset &&
7001
7001
        found_set[i].found_offset == found_offset)
7002
7002
      return -i-2;
7054
7054
    pa->max_length=PS_MALLOC-MALLOC_OVERHEAD;
7055
7055
    pa->array_allocs=1;
7056
7056
  }
7057
 
  length=(uint) strlen(name)+1;
 
7057
  length=(uint32_t) strlen(name)+1;
7058
7058
  if (pa->length+length >= pa->max_length)
7059
7059
  {
7060
7060
    if (!(new_pos= (unsigned char*)realloc((unsigned char*)pa->str,