~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to include/my_global.h

Removing deprecated functions from code and replacing them with C99 equivalents:
- replacing bcmp() calls with memcmp() calls
- replacing bfill() with memset()
- replacing bmove() and bcopy() with memcpy() or memmove()

The function memcpy_fixed() was apparantly introduced to fix a problem in gcc on
Alpha, but since it is not used consistently, it is likely not necessary any more.
It was replaced with memcpy().

Show diffs side-by-side

added added

removed removed

Lines of Context:
837
837
                              ((uchar*) &def_temp)[7]=(M)[0];\
838
838
                              (V) = def_temp; } while(0)
839
839
#else
840
 
#define float4get(V,M)   memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float))
841
 
#define float4store(V,M) memcpy_fixed((uchar*) V,(uchar*) (&M),sizeof(float))
 
840
#define float4get(V,M)   memcpy((uchar*) &V,(uchar*) (M),sizeof(float))
 
841
#define float4store(V,M) memcpy((uchar*) V,(uchar*) (&M),sizeof(float))
842
842
 
843
843
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
844
844
#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\
908
908
                             *(((char*)T)+1)=(((A) >> 16));\
909
909
                             *(((char*)T)+0)=(((A) >> 24)); } while(0)
910
910
 
911
 
#define floatget(V,M)    memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float))
912
 
#define floatstore(T,V)  memcpy_fixed((uchar*) (T),(uchar*)(&V),sizeof(float))
913
 
#define doubleget(V,M)   memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
914
 
#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
915
 
#define int64_tget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(uint64_t))
916
 
#define int64_tstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(uint64_t))
 
911
#define floatget(V,M)     memcpy((uchar*) &V,(uchar*) (M), sizeof(float))
 
912
#define floatstore(T,V)   memcpy((uchar*) (T),(uchar*)(&V), sizeof(float))
 
913
#define doubleget(V,M)    memcpy((uchar*) &V,(uchar*) (M), sizeof(double))
 
914
#define doublestore(T,V)  memcpy((uchar*) (T),(uchar*) &V, sizeof(double))
 
915
#define int64_tget(V,M)   memcpy((uchar*) &V,(uchar*) (M), sizeof(uint64_t))
 
916
#define int64_tstore(T,V) memcpy((uchar*) (T),(uchar*) &V, sizeof(uint64_t))
917
917
 
918
918
#else
919
919
 
924
924
#define shortstore(T,V) int2store(T,V)
925
925
#define longstore(T,V)  int4store(T,V)
926
926
#ifndef floatstore
927
 
#define floatstore(T,V)  memcpy_fixed((uchar*) (T),(uchar*) (&V),sizeof(float))
928
 
#define floatget(V,M)    memcpy_fixed((uchar*) &V, (uchar*) (M), sizeof(float))
 
927
#define floatstore(T,V)   memcpy((uchar*) (T),(uchar*) (&V),sizeof(float))
 
928
#define floatget(V,M)     memcpy((uchar*) &V, (uchar*) (M), sizeof(float))
929
929
#endif
930
930
#ifndef doubleget
931
 
#define doubleget(V,M)   memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
932
 
#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
 
931
#define doubleget(V,M)    memcpy((uchar*) &V,(uchar*) (M),sizeof(double))
 
932
#define doublestore(T,V)  memcpy((uchar*) (T),(uchar*) &V,sizeof(double))
933
933
#endif /* doubleget */
934
 
#define int64_tget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(uint64_t))
935
 
#define int64_tstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(uint64_t))
 
934
#define int64_tget(V,M)   memcpy((uchar*) &V,(uchar*) (M),sizeof(uint64_t))
 
935
#define int64_tstore(T,V) memcpy((uchar*) (T),(uchar*) &V,sizeof(uint64_t))
936
936
 
937
937
#endif /* WORDS_BIGENDIAN */
938
938