~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to include/my_global.h

  • Committer: Brian Aker
  • Date: 2008-07-13 22:21:51 UTC
  • Revision ID: brian@tangent.org-20080713222151-fv2tcpbsc829j2oc
Ulonglong to uint64_t

Show diffs side-by-side

added added

removed removed

Lines of Context:
570
570
 
571
571
#undef remove           /* Crashes MySQL on SCO 5.0.0 */
572
572
#define closesocket(A)  close(A)
573
 
#ifndef ulonglong2double
574
 
#define ulonglong2double(A) ((double) (ulonglong) (A))
 
573
#ifndef uint64_t2double
 
574
#define uint64_t2double(A) ((double) (uint64_t) (A))
575
575
#define my_off_t2double(A)  ((double) (my_off_t) (A))
576
576
#endif
577
577
 
758
758
  [unsigned] long long unconditionally in many places, 
759
759
  for example in constants with [U]LL suffix.
760
760
*/
761
 
typedef uint64_t ulonglong; /* ulong or unsigned long long */
762
761
typedef int64_t longlong;
763
762
#endif
764
763
 
769
768
typedef uint64_t uint64;
770
769
#endif
771
770
 
772
 
typedef uint64_t my_ulonglong;
 
771
typedef uint64_t my_uint64_t;
773
772
 
774
773
#if SIZEOF_CHARP == SIZEOF_INT
775
774
typedef int intptr;
784
783
#define MY_ERRPTR ((void*)(intptr)1)
785
784
 
786
785
#if SIZEOF_OFF_T > 4
787
 
typedef ulonglong my_off_t;
 
786
typedef uint64_t my_off_t;
788
787
#else
789
788
typedef unsigned long my_off_t;
790
789
#endif
866
865
#define uint3korr(A)    (long) (*((unsigned int *) (A)) & 0xFFFFFF)
867
866
#endif /* HAVE_purify */
868
867
#define uint4korr(A)    (*((uint32 *) (A)))
869
 
#define uint5korr(A)    ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
 
868
#define uint5korr(A)    ((uint64_t)(((uint32) ((uchar) (A)[0])) +\
870
869
                                    (((uint32) ((uchar) (A)[1])) << 8) +\
871
870
                                    (((uint32) ((uchar) (A)[2])) << 16) +\
872
871
                                    (((uint32) ((uchar) (A)[3])) << 24)) +\
873
 
                                    (((ulonglong) ((uchar) (A)[4])) << 32))
874
 
#define uint6korr(A)    ((ulonglong)(((uint32)    ((uchar) (A)[0]))          + \
 
872
                                    (((uint64_t) ((uchar) (A)[4])) << 32))
 
873
#define uint6korr(A)    ((uint64_t)(((uint32)    ((uchar) (A)[0]))          + \
875
874
                                     (((uint32)    ((uchar) (A)[1])) << 8)   + \
876
875
                                     (((uint32)    ((uchar) (A)[2])) << 16)  + \
877
876
                                     (((uint32)    ((uchar) (A)[3])) << 24)) + \
878
 
                         (((ulonglong) ((uchar) (A)[4])) << 32) +       \
879
 
                         (((ulonglong) ((uchar) (A)[5])) << 40))
880
 
#define uint8korr(A)    (*((ulonglong *) (A)))
 
877
                         (((uint64_t) ((uchar) (A)[4])) << 32) +       \
 
878
                         (((uint64_t) ((uchar) (A)[5])) << 40))
 
879
#define uint8korr(A)    (*((uint64_t *) (A)))
881
880
#define sint8korr(A)    (*((longlong *) (A)))
882
881
#define int2store(T,A)  *((uint16*) (T))= (uint16) (A)
883
882
#define int3store(T,A)  do { *(T)=  (uchar) ((A));\
895
894
                             *((T)+3)=(uchar) (((A) >> 24)); \
896
895
                             *((T)+4)=(uchar) (((A) >> 32)); \
897
896
                             *((T)+5)=(uchar) (((A) >> 40)); } while(0)
898
 
#define int8store(T,A)  *((ulonglong *) (T))= (ulonglong) (A)
 
897
#define int8store(T,A)  *((uint64_t *) (T))= (uint64_t) (A)
899
898
 
900
899
typedef union {
901
900
  double v;
945
944
                                  (((uint32) ((uchar) (A)[1])) << 8) +\
946
945
                                  (((uint32) ((uchar) (A)[2])) << 16) +\
947
946
                                  (((uint32) ((uchar) (A)[3])) << 24))
948
 
#define uint5korr(A)    ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
 
947
#define uint5korr(A)    ((uint64_t)(((uint32) ((uchar) (A)[0])) +\
949
948
                                    (((uint32) ((uchar) (A)[1])) << 8) +\
950
949
                                    (((uint32) ((uchar) (A)[2])) << 16) +\
951
950
                                    (((uint32) ((uchar) (A)[3])) << 24)) +\
952
 
                                    (((ulonglong) ((uchar) (A)[4])) << 32))
953
 
#define uint6korr(A)    ((ulonglong)(((uint32)    ((uchar) (A)[0]))          + \
 
951
                                    (((uint64_t) ((uchar) (A)[4])) << 32))
 
952
#define uint6korr(A)    ((uint64_t)(((uint32)    ((uchar) (A)[0]))          + \
954
953
                                     (((uint32)    ((uchar) (A)[1])) << 8)   + \
955
954
                                     (((uint32)    ((uchar) (A)[2])) << 16)  + \
956
955
                                     (((uint32)    ((uchar) (A)[3])) << 24)) + \
957
 
                         (((ulonglong) ((uchar) (A)[4])) << 32) +       \
958
 
                         (((ulonglong) ((uchar) (A)[5])) << 40))
959
 
#define uint8korr(A)    ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
 
956
                         (((uint64_t) ((uchar) (A)[4])) << 32) +       \
 
957
                         (((uint64_t) ((uchar) (A)[5])) << 40))
 
958
#define uint8korr(A)    ((uint64_t)(((uint32) ((uchar) (A)[0])) +\
960
959
                                    (((uint32) ((uchar) (A)[1])) << 8) +\
961
960
                                    (((uint32) ((uchar) (A)[2])) << 16) +\
962
961
                                    (((uint32) ((uchar) (A)[3])) << 24)) +\
963
 
                        (((ulonglong) (((uint32) ((uchar) (A)[4])) +\
 
962
                        (((uint64_t) (((uint32) ((uchar) (A)[4])) +\
964
963
                                    (((uint32) ((uchar) (A)[5])) << 8) +\
965
964
                                    (((uint32) ((uchar) (A)[6])) << 16) +\
966
965
                                    (((uint32) ((uchar) (A)[7])) << 24))) <<\
1101
1100
#define floatstore(T,V)  memcpy_fixed((uchar*) (T),(uchar*)(&V),sizeof(float))
1102
1101
#define doubleget(V,M)   memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
1103
1102
#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
1104
 
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong))
1105
 
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong))
 
1103
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(uint64_t))
 
1104
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(uint64_t))
1106
1105
 
1107
1106
#else
1108
1107
 
1120
1119
#define doubleget(V,M)   memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
1121
1120
#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
1122
1121
#endif /* doubleget */
1123
 
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong))
1124
 
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong))
 
1122
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(uint64_t))
 
1123
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(uint64_t))
1125
1124
 
1126
1125
#endif /* WORDS_BIGENDIAN */
1127
1126