~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/include/mach0data.ic

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-06-21 15:31:05 UTC
  • mfrom: (1.1.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20100621153105-pbbz3t6nyrf9t2zq
Tags: upstream-5.1.48
ImportĀ upstreamĀ versionĀ 5.1.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        ulint   n)      /*!< in: ulint integer to be stored, >= 0, < 256 */
37
37
{
38
38
        ut_ad(b);
39
 
        ut_ad(n <= 0xFFUL);
 
39
        ut_ad((n | 0xFFUL) <= 0xFFUL);
40
40
 
41
41
        b[0] = (byte)n;
42
42
}
65
65
        ulint   n)      /*!< in: ulint integer to be stored */
66
66
{
67
67
        ut_ad(b);
68
 
        ut_ad(n <= 0xFFFFUL);
 
68
        ut_ad((n | 0xFFFFUL) <= 0xFFFFUL);
69
69
 
70
70
        b[0] = (byte)(n >> 8);
71
71
        b[1] = (byte)(n);
81
81
/*=============*/
82
82
        const byte*     b)      /*!< in: pointer to 2 bytes */
83
83
{
84
 
        ut_ad(b);
85
 
        return( ((ulint)(b[0]) << 8)
86
 
                + (ulint)(b[1])
87
 
                );
 
84
        return(((ulint)(b[0]) << 8) | (ulint)(b[1]));
88
85
}
89
86
 
90
87
/********************************************************//**
129
126
        ulint   n)      /*!< in: ulint integer to be stored */
130
127
{
131
128
        ut_ad(b);
132
 
        ut_ad(n <= 0xFFFFFFUL);
 
129
        ut_ad((n | 0xFFFFFFUL) <= 0xFFFFFFUL);
133
130
 
134
131
        b[0] = (byte)(n >> 16);
135
132
        b[1] = (byte)(n >> 8);
148
145
{
149
146
        ut_ad(b);
150
147
        return( ((ulint)(b[0]) << 16)
151
 
                + ((ulint)(b[1]) << 8)
152
 
                + (ulint)(b[2])
 
148
                | ((ulint)(b[1]) << 8)
 
149
                | (ulint)(b[2])
153
150
                );
154
151
}
155
152
 
183
180
{
184
181
        ut_ad(b);
185
182
        return( ((ulint)(b[0]) << 24)
186
 
                + ((ulint)(b[1]) << 16)
187
 
                + ((ulint)(b[2]) << 8)
188
 
                + (ulint)(b[3])
 
183
                | ((ulint)(b[1]) << 16)
 
184
                | ((ulint)(b[2]) << 8)
 
185
                | (ulint)(b[3])
189
186
                );
190
187
}
191
188
 
721
718
/*===========================*/
722
719
        const byte*     buf)            /*!< in: from where to read */
723
720
{
724
 
        return((ulint)(*buf) + ((ulint)(*(buf + 1))) * 256);
 
721
        return((ulint)(buf[0]) | ((ulint)(buf[1]) << 8));
725
722
}
726
723
 
727
724
/*********************************************************//**