aboutsummaryrefslogtreecommitdiffhomepage
path: root/util.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2005-10-11 02:12:55 +1000
committerGravatar axel <axel@liljencrantz.se>2005-10-11 02:12:55 +1000
commit0a4b983afa4137da9392b2bb198a02f6d1df38f7 (patch)
tree95665607a674516da39f418fac0c983658a65221 /util.c
parentb6e7133ba6bd965efee507e1c5843dba8f9ab540 (diff)
Multiple portability fixes
darcs-hash:20051010161255-ac50b-e732f18c1dfa610e34b56bb4ff1a3d4d2ef078a1.gz
Diffstat (limited to 'util.c')
-rw-r--r--util.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/util.c b/util.c
index 31ccf7b4..14e841bf 100644
--- a/util.c
+++ b/util.c
@@ -72,20 +72,20 @@ int maxi( int a,
/* Queue functions */
-void q_init( queue_t *q )
+void q_init( dyn_queue_t *q )
{
q->start = (void **)malloc( sizeof(void*)*1 );
q->stop = &q->start[1];
q->put_pos = q->get_pos = q->start;
}
-void q_destroy( queue_t *q )
+void q_destroy( dyn_queue_t *q )
{
free( q->start );
}
/*
- static q_print( queue_t *q )
+ static q_print( dyn_queue_t *q )
{
int i;
int size = (q->stop-q->start);
@@ -106,7 +106,7 @@ void q_destroy( queue_t *q )
/**
Reallocate the queue_t
*/
-static int q_realloc( queue_t *q )
+static int q_realloc( dyn_queue_t *q )
{
void **old_start = q->start;
void **old_stop = q->stop;
@@ -131,7 +131,7 @@ static int q_realloc( queue_t *q )
return 1;
}
-int q_put( queue_t *q, void *e )
+int q_put( dyn_queue_t *q, void *e )
{
*q->put_pos = e;
@@ -144,7 +144,7 @@ int q_put( queue_t *q, void *e )
return 1;
}
-void *q_get( queue_t *q)
+void *q_get( dyn_queue_t *q)
{
void *e = *q->get_pos;
if( ++q->get_pos == q->stop )
@@ -152,12 +152,12 @@ void *q_get( queue_t *q)
return e;
}
-void *q_peek( queue_t *q )
+void *q_peek( dyn_queue_t *q )
{
return *q->get_pos;
}
-int q_empty( queue_t *q )
+int q_empty( dyn_queue_t *q )
{
// fprintf( stderr, "Queue %d is %s\n", q, (q->put_pos == q->get_pos)?"empty":"non-empty" );
return q->put_pos == q->get_pos;