~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/korr.h

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#pragma once
 
20
#ifndef DRIZZLED_KORR_H
 
21
#define DRIZZLED_KORR_H
21
22
 
22
23
 
23
24
/*
76
77
#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0]; \
77
78
                             *(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; \
78
79
                         } while (0)
 
80
#define float4get(V,M)   do { *((float *) &(V)) = *((float*) (M)); } while(0)
79
81
#define float8get(V,M)   doubleget((V),(M))
80
82
#define floatstore(T,V)  memcpy((T), (&V), sizeof(float))
81
83
#define float8store(V,M) doublestore((V),(M))
87
89
*/
88
90
#define sint2korr(A)    (int16_t) (((int16_t) ((unsigned char) (A)[0])) +\
89
91
                                 ((int16_t) ((int16_t) (A)[1]) << 8))
 
92
#define sint3korr(A)    ((int32_t) ((((unsigned char) (A)[2]) & 128) ? \
 
93
                                  (((uint32_t) 255L << 24) | \
 
94
                                   (((uint32_t) (unsigned char) (A)[2]) << 16) |\
 
95
                                   (((uint32_t) (unsigned char) (A)[1]) << 8) | \
 
96
                                   ((uint32_t) (unsigned char) (A)[0])) : \
 
97
                                  (((uint32_t) (unsigned char) (A)[2]) << 16) |\
 
98
                                  (((uint32_t) (unsigned char) (A)[1]) << 8) | \
 
99
                                  ((uint32_t) (unsigned char) (A)[0])))
90
100
#define sint4korr(A)    (int32_t) (((int32_t) ((unsigned char) (A)[0])) +\
91
101
                                (((int32_t) ((unsigned char) (A)[1]) << 8)) +\
92
102
                                (((int32_t) ((unsigned char) (A)[2]) << 16)) +\
231
241
 
232
242
#endif /* WORDS_BIGENDIAN */
233
243
 
 
244
#endif /* DRIZZLED_KORR_H */