Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 37e347a

Browse files
committed
Get rid of overly cute, unportable, probably not very efficient substitute
for 'bool'. Per buildfarm warnings.
1 parent 93624bc commit 37e347a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

contrib/pgcrypto/mbuf.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.c,v 1.3 2005/10/15 02:49:06 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.c,v 1.4 2007/07/15 23:57:13 tgl Exp $
3030
*/
3131

3232
#include "postgres.h"
@@ -42,8 +42,8 @@ struct MBuf
4242
uint8 *data_end;
4343
uint8 *read_pos;
4444
uint8 *buf_end;
45-
int no_write:1;
46-
int own_data:1;
45+
bool no_write;
46+
bool own_data;
4747
};
4848

4949
int
@@ -129,8 +129,8 @@ mbuf_create(int len)
129129
mbuf->data_end = mbuf->data;
130130
mbuf->read_pos = mbuf->data;
131131

132-
mbuf->no_write = 0;
133-
mbuf->own_data = 1;
132+
mbuf->no_write = false;
133+
mbuf->own_data = true;
134134

135135
return mbuf;
136136
}
@@ -146,8 +146,8 @@ mbuf_create_from_data(const uint8 *data, int len)
146146
mbuf->data_end = mbuf->data + len;
147147
mbuf->read_pos = mbuf->data;
148148

149-
mbuf->no_write = 1;
150-
mbuf->own_data = 0;
149+
mbuf->no_write = true;
150+
mbuf->own_data = false;
151151

152152
return mbuf;
153153
}
@@ -159,7 +159,7 @@ mbuf_grab(MBuf * mbuf, int len, uint8 **data_p)
159159
if (len > mbuf_avail(mbuf))
160160
len = mbuf_avail(mbuf);
161161

162-
mbuf->no_write = 1;
162+
mbuf->no_write = true;
163163

164164
*data_p = mbuf->read_pos;
165165
mbuf->read_pos += len;
@@ -178,8 +178,8 @@ mbuf_steal_data(MBuf * mbuf, uint8 **data_p)
178178
{
179179
int len = mbuf_size(mbuf);
180180

181-
mbuf->no_write = 1;
182-
mbuf->own_data = 0;
181+
mbuf->no_write = true;
182+
mbuf->own_data = false;
183183

184184
*data_p = mbuf->data;
185185

0 commit comments

Comments
 (0)