~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/type/decimal.cc

  • Committer: Mark Atwood
  • Date: 2011-08-12 04:08:33 UTC
  • mfrom: (2385.2.17 refactor5)
  • Revision ID: me@mark.atwood.name-20110812040833-u6j85nc6ahuc0dtz
mergeĀ lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
2669
2669
void test_d2b2d(const char *str, int p, int s, const char *orig, int ex)
2670
2670
{
2671
2671
  char s1[100], buf[100], *end;
2672
 
  int res, i, size=decimal_bin_size(p, s);
 
2672
  int size=decimal_bin_size(p, s);
2673
2673
 
2674
2674
  snprintf(s1, sizeof(s1), "'%s'", str);
2675
2675
  end= strend(str);
2676
2676
  string2decimal(str, &a, &end);
2677
 
  res=decimal2bin(&a, buf, p, s);
 
2677
  int res=decimal2bin(&a, buf, p, s);
2678
2678
  printf("%-31s {%2d, %2d} => res=%d size=%-2d ", s1, p, s, res, size);
2679
2679
  if (full)
2680
2680
  {
2681
2681
    printf("0x");
2682
 
    for (i=0; i < size; i++)
 
2682
    for (int i= 0; i < size; i++)
2683
2683
      printf("%02x", ((unsigned char *)buf)[i]);
2684
2684
  }
2685
2685
  res=bin2decimal(buf, &a, p, s);