~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.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:
1184
1184
      if (verbose)
1185
1185
        tee_fprintf(stdout, _("Reading history-file %s\n"),histfile);
1186
1186
      read_history(histfile);
1187
 
      if (!(histfile_tmp= (char*) malloc((uint) strlen(histfile) + 5)))
 
1187
      if (!(histfile_tmp= (char*) malloc((uint32_t) strlen(histfile) + 5)))
1188
1188
      {
1189
1189
        fprintf(stderr, _("Couldn't allocate memory for temp histfile!\n"));
1190
1190
        exit(1);
1514
1514
        return false;
1515
1515
      }
1516
1516
    }
1517
 
    delimiter_length= (uint)strlen(delimiter);
 
1517
    delimiter_length= (uint32_t)strlen(delimiter);
1518
1518
    delimiter_str= delimiter;
1519
1519
    break;
1520
1520
  case OPT_LOCAL_INFILE:
1844
1844
      return((COMMANDS *) 0);
1845
1845
    if ((end=strcont(name," \t")))
1846
1846
    {
1847
 
      len=(uint) (end - name);
 
1847
      len=(uint32_t) (end - name);
1848
1848
      while (my_isspace(charset_info,*end))
1849
1849
        end++;
1850
1850
      if (!*end)
1851
1851
        end=0;          // no arguments to function
1852
1852
    }
1853
1853
    else
1854
 
      len=(uint) strlen(name);
 
1854
      len=(uint32_t) strlen(name);
1855
1855
  }
1856
1856
 
1857
1857
  for (uint32_t i= 0; commands[i].name; i++)
1880
1880
    return(0);
1881
1881
  if (status.add_to_history && line[0] && not_in_history(line))
1882
1882
    add_history(line);
1883
 
  char *end_of_line=line+(uint) strlen(line);
 
1883
  char *end_of_line=line+(uint32_t) strlen(line);
1884
1884
 
1885
1885
  for (pos=out=line ; (inchar= (unsigned char) *pos) ; pos++)
1886
1886
  {
2124
2124
  if (out != line || (buffer->length() > 0))
2125
2125
  {
2126
2126
    *out++='\n';
2127
 
    uint32_t length=(uint) (out-line);
 
2127
    uint32_t length=(uint32_t) (out-line);
2128
2128
    if ((!*ml_comment || preserve_comments))
2129
2129
      buffer->append(line, length);
2130
2130
  }
2257
2257
  static uint32_t i;
2258
2258
 
2259
2259
  if (!state)
2260
 
    textlen=(uint) strlen(text);
 
2260
    textlen=(uint32_t) strlen(text);
2261
2261
 
2262
2262
  if (textlen>0)
2263
2263
  {            /* lookup in the hash */
2265
2265
    {
2266
2266
      uint32_t len;
2267
2267
 
2268
 
      b = find_all_matches(&ht,text,(uint) strlen(text),&len);
 
2268
      b = find_all_matches(&ht,text,(uint32_t) strlen(text),&len);
2269
2269
      if (!b)
2270
2270
        return NULL;
2271
2271
      e = b->pData;
2297
2297
    ptr= NULL;
2298
2298
    while (e && !ptr)
2299
2299
    {          /* find valid entry in bucket */
2300
 
      if ((uint) strlen(e->str) == b->nKeyLength)
 
2300
      if ((uint32_t) strlen(e->str) == b->nKeyLength)
2301
2301
        ptr = strdup(e->str);
2302
2302
      /* find the next used entry */
2303
2303
      e = e->pNext;
2393
2393
      {
2394
2394
        char *str=strdup_root(&hash_mem_root, (char*) table_row[0]);
2395
2395
        if (str &&
2396
 
            !completion_hash_exists(&ht,(char*) str, (uint) strlen(str)))
 
2396
            !completion_hash_exists(&ht,(char*) str, (uint32_t) strlen(str)))
2397
2397
          add_word(&ht,str);
2398
2398
      }
2399
2399
    }
2406
2406
  }
2407
2407
  drizzleclient_data_seek(tables,0);
2408
2408
  if (!(field_names= (char ***) alloc_root(&hash_mem_root,sizeof(char **) *
2409
 
                                           (uint) (drizzleclient_num_rows(tables)+1))))
 
2409
                                           (uint32_t) (drizzleclient_num_rows(tables)+1))))
2410
2410
  {
2411
2411
    drizzleclient_free_result(tables);
2412
2412
    return;
2434
2434
        field_names[i][num_fields+j] = strdup_root(&hash_mem_root,
2435
2435
                                                   sql_field->name);
2436
2436
        if (!completion_hash_exists(&ht,field_names[i][num_fields+j],
2437
 
                                    (uint) strlen(field_names[i][num_fields+j])))
 
2437
                                    (uint32_t) strlen(field_names[i][num_fields+j])))
2438
2438
          add_word(&ht,field_names[i][num_fields+j]);
2439
2439
        j++;
2440
2440
      }
2939
2939
    (void) tee_fputs("|", PAGER);
2940
2940
    for (uint32_t off=0; (field = drizzleclient_fetch_field(result)) ; off++)
2941
2941
    {
2942
 
      uint32_t name_length= (uint) strlen(field->name);
 
2942
      uint32_t name_length= (uint32_t) strlen(field->name);
2943
2943
      uint32_t numcells= charset_info->cset->numcells(charset_info,
2944
2944
                                                  field->name,
2945
2945
                                                  field->name + name_length);
2977
2977
      else
2978
2978
      {
2979
2979
        buffer= cur[off];
2980
 
        data_length= (uint) lengths[off];
 
2980
        data_length= (uint32_t) lengths[off];
2981
2981
      }
2982
2982
 
2983
2983
      field= drizzleclient_fetch_field(result);
3160
3160
    messages.  To be safe, skip printing the duplicate only if it is the only
3161
3161
    warning.
3162
3162
  */
3163
 
  if (!cur || (num_rows == 1 && error == (uint) strtoul(cur[1], NULL, 10)))
 
3163
  if (!cur || (num_rows == 1 && error == (uint32_t) strtoul(cur[1], NULL, 10)))
3164
3164
    goto end;
3165
3165
 
3166
3166
  /* Print the warnings */