26
26
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
27
* SUCH DAMAGE.
28
28
*
29
- * $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.c,v 1.3 2005/10 /1502:49:06 momjian Exp $
29
+ * $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.c,v 1.4 2007/07 /1523:57:13 tgl Exp $
30
30
*/
31
31
32
32
#include "postgres.h"
@@ -42,8 +42,8 @@ struct MBuf
42
42
uint8 * data_end ;
43
43
uint8 * read_pos ;
44
44
uint8 * buf_end ;
45
- int no_write : 1 ;
46
- int own_data : 1 ;
45
+ bool no_write ;
46
+ bool own_data ;
47
47
};
48
48
49
49
int
@@ -129,8 +129,8 @@ mbuf_create(int len)
129
129
mbuf -> data_end = mbuf -> data ;
130
130
mbuf -> read_pos = mbuf -> data ;
131
131
132
- mbuf -> no_write = 0 ;
133
- mbuf -> own_data = 1 ;
132
+ mbuf -> no_write = false ;
133
+ mbuf -> own_data = true ;
134
134
135
135
return mbuf ;
136
136
}
@@ -146,8 +146,8 @@ mbuf_create_from_data(const uint8 *data, int len)
146
146
mbuf -> data_end = mbuf -> data + len ;
147
147
mbuf -> read_pos = mbuf -> data ;
148
148
149
- mbuf -> no_write = 1 ;
150
- mbuf -> own_data = 0 ;
149
+ mbuf -> no_write = true ;
150
+ mbuf -> own_data = false ;
151
151
152
152
return mbuf ;
153
153
}
@@ -159,7 +159,7 @@ mbuf_grab(MBuf * mbuf, int len, uint8 **data_p)
159
159
if (len > mbuf_avail (mbuf ))
160
160
len = mbuf_avail (mbuf );
161
161
162
- mbuf -> no_write = 1 ;
162
+ mbuf -> no_write = true ;
163
163
164
164
* data_p = mbuf -> read_pos ;
165
165
mbuf -> read_pos += len ;
@@ -178,8 +178,8 @@ mbuf_steal_data(MBuf * mbuf, uint8 **data_p)
178
178
{
179
179
int len = mbuf_size (mbuf );
180
180
181
- mbuf -> no_write = 1 ;
182
- mbuf -> own_data = 0 ;
181
+ mbuf -> no_write = true ;
182
+ mbuf -> own_data = false ;
183
183
184
184
* data_p = mbuf -> data ;
185
185