~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/int64_t.cc

MergedĀ fromĀ lee.

Show diffs side-by-side

added added

removed removed

Lines of Context:
265
265
  res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(), "bigint"));
266
266
  add_unsigned(res);
267
267
}
268
 
 
269
 
 
270
 
/*
271
 
  Floating-point numbers
272
 
 */
273
 
 
274
 
unsigned char *
275
 
Field_real::pack(unsigned char *to, const unsigned char *from,
276
 
                 uint32_t max_length, bool low_byte_first)
277
 
{
278
 
  assert(max_length >= pack_length());
279
 
#ifdef WORDS_BIGENDIAN
280
 
  if (low_byte_first != table->s->db_low_byte_first)
281
 
  {
282
 
    const unsigned char *dptr= from + pack_length();
283
 
    while (dptr-- > from)
284
 
      *to++ = *dptr;
285
 
    return(to);
286
 
  }
287
 
  else
288
 
#endif
289
 
    return(Field::pack(to, from, max_length, low_byte_first));
290
 
}
291
 
 
292
 
const unsigned char *
293
 
Field_real::unpack(unsigned char *to, const unsigned char *from,
294
 
                   uint32_t param_data, bool low_byte_first)
295
 
{
296
 
#ifdef WORDS_BIGENDIAN
297
 
  if (low_byte_first != table->s->db_low_byte_first)
298
 
  {
299
 
    const unsigned char *dptr= from + pack_length();
300
 
    while (dptr-- > from)
301
 
      *to++ = *dptr;
302
 
    return(from + pack_length());
303
 
  }
304
 
  else
305
 
#endif
306
 
    return(Field::unpack(to, from, param_data, low_byte_first));
307
 
}
308