~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/longlong2str.cc

pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
macros.
Add PANDORA_DRIZZLE_BUILD to run the extra checks that drizzle needs that 
plugins would also need to run so we can just use that macro in generated
external plugin builds.
Added support to register_plugins for external plugin building.
Renamed register_plugins.py to pandora-plugin.

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 NullS and nothing will be changed.
 
23
  is dud the result will be NULL 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.
37
37
        itoa assumes that 10 -base numbers are allways signed and other arn't.
38
38
*/
39
39
 
 
40
#include "drizzled/global.h"
 
41
 
40
42
#include "m_string.h"
41
43
 
42
44
#if !defined(int64_t2str) && !defined(HAVE_LONGLONG2STR)
77
79
 
78
80
  while (uval > (uint64_t) LONG_MAX)
79
81
  {
80
 
    uint64_t quo= uval/(uint) radix;
81
 
    uint rem= (uint) (uval- quo* (uint) radix);
 
82
    uint64_t quo= uval/(uint32_t) radix;
 
83
    uint32_t rem= (uint32_t) (uval- quo* (uint32_t) radix);
82
84
    *--p = _dig_vec_upper[rem];
83
85
    uval= quo;
84
86
  }
86
88
  while (long_val != 0)
87
89
  {
88
90
    long quo= long_val/radix;
89
 
    *--p = _dig_vec_upper[(uchar) (long_val - quo*radix)];
 
91
    *--p = _dig_vec_upper[(unsigned char) (long_val - quo*radix)];
90
92
    long_val= quo;
91
93
  }
92
94
  while ((*dst++ = *p++) != 0) ;
124
126
 
125
127
  while (uval > (uint64_t) LONG_MAX)
126
128
  {
127
 
    uint64_t quo= uval/(uint) 10;
128
 
    uint rem= (uint) (uval- quo* (uint) 10);
 
129
    uint64_t quo= uval/(uint32_t) 10;
 
130
    uint32_t rem= (uint32_t) (uval- quo* (uint32_t) 10);
129
131
    *--p = _dig_vec_upper[rem];
130
132
    uval= quo;
131
133
  }
133
135
  while (long_val != 0)
134
136
  {
135
137
    long quo= long_val/10;
136
 
    *--p = _dig_vec_upper[(uchar) (long_val - quo*10)];
 
138
    *--p = _dig_vec_upper[(unsigned char) (long_val - quo*10)];
137
139
    long_val= quo;
138
140
  }
139
141
  while ((*dst++ = *p++) != 0) ;