~mkindahl/drizzle/remove-mem-casts

« back to all changes in this revision

Viewing changes to include/my_global.h

  • Committer: Brian Aker
  • Date: 2008-07-23 00:11:39 UTC
  • Revision ID: brian@tangent.org-20080723001139-967ewfngqqotwb6e
Removed final uint dead types.

Show diffs side-by-side

added added

removed removed

Lines of Context:
429
429
/* #define USE_RECORD_LOCK      */
430
430
 
431
431
        /* Unsigned types supported by the compiler */
432
 
#define UNSINT8                 /* unsigned int8 (char) */
433
 
#define UNSINT16                /* unsigned int16 */
 
432
#define UNSINT8                 /* unsigned int8_t (char) */
 
433
#define UNSINT16                /* unsigned int16_t */
434
434
#define UNSINT32                /* unsigned int32_t */
435
435
 
436
436
        /* General constants */
603
603
typedef unsigned char   uchar;  /* Short for unsigned char */
604
604
#endif
605
605
 
606
 
#ifndef HAVE_INT8
607
 
typedef signed char int8;       /* Signed integer >= 8  bits */
608
 
#endif
609
 
 
610
 
#ifndef HAVE_UINT8
611
 
typedef unsigned char uint8;    /* Unsigned integer >= 8  bits */
612
 
#endif
613
 
 
614
 
#ifndef HAVE_INT16
615
 
typedef short int16;
616
 
#endif
617
 
 
618
 
#ifndef HAVE_UINT16
619
 
typedef unsigned short uint16;
620
 
#endif
621
 
 
622
606
#if !defined(HAVE_ULONG) && !defined(__USE_MISC)
623
607
typedef uint32_t        ulong;            /* Short for unsigned long */
624
608
#endif
644
628
#define SOCKET_ENFILE   ENFILE
645
629
#define SOCKET_EMFILE   EMFILE
646
630
 
647
 
typedef uint8           int7;   /* Most effective integer 0 <= x <= 127 */
 
631
typedef uint8_t         int7;   /* Most effective integer 0 <= x <= 127 */
648
632
typedef short           int15;  /* Most effective integer 0 <= x <= 32767 */
649
633
typedef int             myf;    /* Type of MyFlags in my_funcs */
650
634
typedef char            my_bool; /* Small bool */
652
636
typedef char            bool;   /* Ordinary boolean values 0 1 */
653
637
#endif
654
638
        /* Macros for converting *constants* to the right type */
655
 
#define INT8(v)         (int8) (v)
656
 
#define INT16(v)        (int16) (v)
 
639
#define INT8(v)         (int8_t) (v)
 
640
#define INT16(v)        (int16_t) (v)
657
641
#define INT32(v)        (int32_t) (v)
658
642
#define MYF(v)          (myf) (v)
659
643
 
672
656
 
673
657
/* Optimized store functions for Intel x86 */
674
658
#if defined(__i386__)
675
 
#define sint2korr(A)    (*((int16 *) (A)))
 
659
#define sint2korr(A)    (*((int16_t *) (A)))
676
660
#define sint3korr(A)    ((int32_t) ((((uchar) (A)[2]) & 128) ? \
677
661
                                  (((uint32_t) 255L << 24) | \
678
662
                                   (((uint32_t) (uchar) (A)[2]) << 16) |\
682
666
                                  (((uint32_t) (uchar) (A)[1]) << 8) | \
683
667
                                  ((uint32_t) (uchar) (A)[0])))
684
668
#define sint4korr(A)    (*((long *) (A)))
685
 
#define uint2korr(A)    (*((uint16 *) (A)))
 
669
#define uint2korr(A)    (*((uint16_t *) (A)))
686
670
#if defined(HAVE_purify)
687
671
#define uint3korr(A)    (uint32_t) (((uint32_t) ((uchar) (A)[0])) +\
688
672
                                  (((uint32_t) ((uchar) (A)[1])) << 8) +\
710
694
                         (((uint64_t) ((uchar) (A)[5])) << 40))
711
695
#define uint8korr(A)    (*((uint64_t *) (A)))
712
696
#define sint8korr(A)    (*((int64_t *) (A)))
713
 
#define int2store(T,A)  *((uint16*) (T))= (uint16) (A)
 
697
#define int2store(T,A)  *((uint16_t*) (T))= (uint16_t) (A)
714
698
#define int3store(T,A)  do { *(T)=  (uchar) ((A));\
715
699
                            *(T+1)=(uchar) (((uint) (A) >> 8));\
716
700
                            *(T+2)=(uchar) (((A) >> 16)); } while (0)
752
736
  We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines
753
737
  were done before)
754
738
*/
755
 
#define sint2korr(A)    (int16) (((int16) ((uchar) (A)[0])) +\
756
 
                                 ((int16) ((int16) (A)[1]) << 8))
 
739
#define sint2korr(A)    (int16_t) (((int16_t) ((uchar) (A)[0])) +\
 
740
                                 ((int16_t) ((int16_t) (A)[1]) << 8))
757
741
#define sint3korr(A)    ((int32_t) ((((uchar) (A)[2]) & 128) ? \
758
742
                                  (((uint32_t) 255L << 24) | \
759
743
                                   (((uint32_t) (uchar) (A)[2]) << 16) |\
765
749
#define sint4korr(A)    (int32_t) (((int32_t) ((uchar) (A)[0])) +\
766
750
                                (((int32_t) ((uchar) (A)[1]) << 8)) +\
767
751
                                (((int32_t) ((uchar) (A)[2]) << 16)) +\
768
 
                                (((int32_t) ((int16) (A)[3]) << 24)))
 
752
                                (((int32_t) ((int16_t) (A)[3]) << 24)))
769
753
#define sint8korr(A)    (int64_t) uint8korr(A)
770
 
#define uint2korr(A)    (uint16) (((uint16) ((uchar) (A)[0])) +\
771
 
                                  ((uint16) ((uchar) (A)[1]) << 8))
 
754
#define uint2korr(A)    (uint16_t) (((uint16_t) ((uchar) (A)[0])) +\
 
755
                                  ((uint16_t) ((uchar) (A)[1]) << 8))
772
756
#define uint3korr(A)    (uint32_t) (((uint32_t) ((uchar) (A)[0])) +\
773
757
                                  (((uint32_t) ((uchar) (A)[1])) << 8) +\
774
758
                                  (((uint32_t) ((uchar) (A)[2])) << 16))
904
888
 
905
889
#ifdef WORDS_BIGENDIAN
906
890
 
907
 
#define ushortget(V,M)  do { V = (uint16) (((uint16) ((uchar) (M)[1]))+\
908
 
                                 ((uint16) ((uint16) (M)[0]) << 8)); } while(0)
 
891
#define ushortget(V,M)  do { V = (uint16_t) (((uint16_t) ((uchar) (M)[1]))+\
 
892
                                 ((uint16_t) ((uint16_t) (M)[0]) << 8)); } while(0)
909
893
#define shortget(V,M)   do { V = (short) (((short) ((uchar) (M)[1]))+\
910
894
                                 ((short) ((short) (M)[0]) << 8)); } while(0)
911
895
#define longget(V,M)    do { int32_t def_temp;\