summaryrefslogtreecommitdiff
path: root/libpipe/pq.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1998-10-20 08:38:41 +0000
committerRoland McGrath <roland@gnu.org>1998-10-20 08:38:41 +0000
commitfc40a731d23f893be2cb7699d7e078568d4c210c (patch)
tree9f1c90570e03a7c4082bee3fca2ced1755ac98a0 /libpipe/pq.c
parent6b0d5d23a26adea266903f285f7424a2f93863cb (diff)
Add braces to silence gcc warnings.
Diffstat (limited to 'libpipe/pq.c')
-rw-r--r--libpipe/pq.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/libpipe/pq.c b/libpipe/pq.c
index c48f90bd..9f8ab7ed 100644
--- a/libpipe/pq.c
+++ b/libpipe/pq.c
@@ -1,6 +1,6 @@
/* Packet queues
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -52,11 +52,13 @@ free_packets (struct packet *head)
if (head->ports)
free (head->ports);
if (head->buf_len > 0)
- if (head->buf_vm_alloced)
- vm_deallocate (mach_task_self (),
- (vm_address_t)head->buf, head->buf_len);
- else
- free (head->buf);
+ {
+ if (head->buf_vm_alloced)
+ vm_deallocate (mach_task_self (),
+ (vm_address_t)head->buf, head->buf_len);
+ else
+ free (head->buf);
+ }
free (head);
free_packets (next);
}
@@ -203,7 +205,7 @@ packet_extend (struct packet *packet, size_t new_len)
packet->buf_start = new_buf + (packet->buf_start - old_buf);
packet->buf_end = new_buf + (packet->buf_end - old_buf);
}
-
+
packet->buf_len = new_len;
return 1;
@@ -249,10 +251,12 @@ packet_realloc (struct packet *packet, size_t new_len)
/* And get rid of the old buffer. */
if (old_len > 0)
- if (packet->buf_vm_alloced)
- vm_deallocate (mach_task_self (), (vm_address_t)old_buf, old_len);
- else
- free (old_buf);
+ {
+ if (packet->buf_vm_alloced)
+ vm_deallocate (mach_task_self (), (vm_address_t)old_buf, old_len);
+ else
+ free (old_buf);
+ }
packet->buf = new_buf;
packet->buf_len = new_len;
@@ -267,7 +271,7 @@ packet_realloc (struct packet *packet, size_t new_len)
/* ---------------------------------------------------------------- */
/* If PACKET has any ports, deallocates them. */
-void
+void
packet_dealloc_ports (struct packet *packet)
{
unsigned i;
@@ -322,7 +326,7 @@ packet_read_ports (struct packet *packet,
/* Append the bytes in DATA, of length DATA_LEN, to what's already in PACKET,
and return the amount appended in AMOUNT. */
-error_t
+error_t
packet_write (struct packet *packet,
char *data, size_t data_len, size_t *amount)
{