From 838baf3f99ec5ab81b063eb5449a3381d860f377 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 11 Jun 2011 04:58:26 +0000 Subject: TQt4 port kdegames This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kpat/freecell-solver/pqueue.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'kpat/freecell-solver/pqueue.h') diff --git a/kpat/freecell-solver/pqueue.h b/kpat/freecell-solver/pqueue.h index cf5f5372..d4cfd7a3 100644 --- a/kpat/freecell-solver/pqueue.h +++ b/kpat/freecell-solver/pqueue.h @@ -11,8 +11,8 @@ http://www.geocities.com/jheyesjones/astar.html */ -#ifndef FC_SOLVE__PQUEUE_H -#define FC_SOLVE__PQUEUE_H +#ifndef FC_SOLVE__PTQUEUE_H +#define FC_SOLVE__PTQUEUE_H #ifdef __cplusplus extern "C" { @@ -22,7 +22,7 @@ extern "C" { #include "jhjtypes.h" -#define PQUEUE_MaxRating INT_MAX +#define PTQUEUE_MaxRating INT_MAX typedef int32 pq_rating_t; @@ -32,35 +32,35 @@ typedef struct struct_pq_element_t pq_rating_t rating; } pq_element_t; -typedef struct _PQUEUE +typedef struct _PTQUEUE { int32 MaxSize; int32 CurrentSize; pq_element_t * Elements; /* pointer to void pointers */ pq_rating_t MaxRating; /* biggest element possible */ -} PQUEUE; +} PTQUEUE; /* given an index to any element in a binary tree stored in a linear array with the root at 1 and a "sentinel" value at 0 these macros are useful in making the code clearer */ -/* the parent is always given by index/2 */ -#define PQ_PARENT_INDEX(i) ((i)>>1) -#define PQ_FIRST_ENTRY (1) +/* the tqparent is always given by index/2 */ +#define PTQ_PARENT_INDEX(i) ((i)>>1) +#define PTQ_FIRST_ENTRY (1) -/* left and right children are index * 2 and (index * 2) +1 respectively */ -#define PQ_LEFT_CHILD_INDEX(i) ((i)<<1) -#define PQ_RIGHT_CHILD_INDEX(i) (((i)<<1)+1) +/* left and right tqchildren are index * 2 and (index * 2) +1 respectively */ +#define PTQ_LEFT_CHILD_INDEX(i) ((i)<<1) +#define PTQ_RIGHT_CHILD_INDEX(i) (((i)<<1)+1) void freecell_solver_PQueueInitialise( - PQUEUE *pq, + PTQUEUE *pq, int32 MaxElements ); -void freecell_solver_PQueueFree( PQUEUE *pq ); +void freecell_solver_PQueueFree( PTQUEUE *pq ); -int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t); +int freecell_solver_PQueuePush( PTQUEUE *pq, void *item, pq_rating_t); -void *freecell_solver_PQueuePop( PQUEUE *pq); +void *freecell_solver_PQueuePop( PTQUEUE *pq); #define PGetRating(elem) ((elem).rating) @@ -68,4 +68,4 @@ void *freecell_solver_PQueuePop( PQUEUE *pq); } #endif -#endif /* #ifdef FC_SOLVE__PQUEUE_H */ +#endif /* #ifdef FC_SOLVE__PTQUEUE_H */ -- cgit v1.2.1