~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/longlong2str.c

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
  converts the (int64_t) integer "val" to character form and moves it to
21
21
  the destination string "dst" followed by a terminating NUL.  The
22
22
  result is normally a pointer to this NUL character, but if the radix
23
 
  is dud the result will be NULL and nothing will be changed.
 
23
  is dud the result will be NullS and nothing will be changed.
24
24
 
25
25
  If radix is -2..-36, val is taken to be SIGNED.
26
26
  If radix is  2.. 36, val is taken to be UNSIGNED.
78
78
  while (uval > (uint64_t) LONG_MAX)
79
79
  {
80
80
    uint64_t quo= uval/(uint) radix;
81
 
    uint32_t rem= (uint) (uval- quo* (uint) radix);
 
81
    uint rem= (uint) (uval- quo* (uint) radix);
82
82
    *--p = _dig_vec_upper[rem];
83
83
    uval= quo;
84
84
  }
86
86
  while (long_val != 0)
87
87
  {
88
88
    long quo= long_val/radix;
89
 
    *--p = _dig_vec_upper[(unsigned char) (long_val - quo*radix)];
 
89
    *--p = _dig_vec_upper[(uchar) (long_val - quo*radix)];
90
90
    long_val= quo;
91
91
  }
92
92
  while ((*dst++ = *p++) != 0) ;
125
125
  while (uval > (uint64_t) LONG_MAX)
126
126
  {
127
127
    uint64_t quo= uval/(uint) 10;
128
 
    uint32_t rem= (uint) (uval- quo* (uint) 10);
 
128
    uint rem= (uint) (uval- quo* (uint) 10);
129
129
    *--p = _dig_vec_upper[rem];
130
130
    uval= quo;
131
131
  }
133
133
  while (long_val != 0)
134
134
  {
135
135
    long quo= long_val/10;
136
 
    *--p = _dig_vec_upper[(unsigned char) (long_val - quo*10)];
 
136
    *--p = _dig_vec_upper[(uchar) (long_val - quo*10)];
137
137
    long_val= quo;
138
138
  }
139
139
  while ((*dst++ = *p++) != 0) ;