tabs->spaces
This commit is contained in:
@@ -17,13 +17,13 @@ extern "C" {
|
||||
typedef struct GBuf GBuf;
|
||||
struct GBuf {
|
||||
/** Allocated buffer length.*/
|
||||
size_t len;
|
||||
size_t len;
|
||||
/** Used space in the buffer */
|
||||
size_t used;
|
||||
size_t used;
|
||||
/** Reference count */
|
||||
size_t ref_cnt;
|
||||
/** The data */
|
||||
void *buf;
|
||||
void *buf;
|
||||
};
|
||||
|
||||
/** Allocate a new GBuf.
|
||||
|
||||
@@ -40,13 +40,13 @@ extern "C" {
|
||||
typedef struct DBuf DBuf;
|
||||
struct DBuf {
|
||||
/** Start of user data */
|
||||
unsigned char *start;
|
||||
unsigned char *start;
|
||||
/** End of user data */
|
||||
unsigned char *end;
|
||||
unsigned char *end;
|
||||
/** Start of underlying buffer. Internal use.*/
|
||||
unsigned char *bufstart;
|
||||
unsigned char *bufstart;
|
||||
/** End of underlying buffer. Internal use.*/
|
||||
unsigned char *bufend;
|
||||
unsigned char *bufend;
|
||||
};
|
||||
/** Free the internals of a DBuf, does not free buf itself.
|
||||
* Does nothing if buf == NULL
|
||||
|
||||
@@ -12,7 +12,7 @@ typedef int (*uc_hs_cmp)(const void *, const void *);
|
||||
|
||||
void
|
||||
uc_heapsort(void *base, size_t count, size_t width,
|
||||
uc_hs_cmp cmp);
|
||||
uc_hs_cmp cmp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -22,15 +22,15 @@ uc_phi_64(uint64_t N);
|
||||
static inline uint32_t
|
||||
uc_nextpow2(uint32_t x)
|
||||
{
|
||||
x--;
|
||||
x |= x >> 1;
|
||||
x |= x >> 2;
|
||||
x |= x >> 4;
|
||||
x |= x >> 8;
|
||||
x |= x >> 16;
|
||||
x++;
|
||||
|
||||
return x;
|
||||
x--;
|
||||
x |= x >> 1;
|
||||
x |= x >> 2;
|
||||
x |= x >> 4;
|
||||
x |= x >> 8;
|
||||
x |= x >> 16;
|
||||
x++;
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -7,23 +7,23 @@ extern "C" {
|
||||
|
||||
typedef enum RBColor RBColor;
|
||||
enum RBColor {
|
||||
Red,
|
||||
Black
|
||||
Red,
|
||||
Black
|
||||
};
|
||||
|
||||
typedef struct RBNode RBNode;
|
||||
struct RBNode {
|
||||
unsigned char color; //Red/Black
|
||||
RBNode *parent;
|
||||
RBNode *right;
|
||||
RBNode *left;
|
||||
void *data;
|
||||
unsigned char color; //Red/Black
|
||||
RBNode *parent;
|
||||
RBNode *right;
|
||||
RBNode *left;
|
||||
void *data;
|
||||
};
|
||||
|
||||
typedef struct RBTree RBTree;
|
||||
struct RBTree {
|
||||
RBNode *node;
|
||||
int (*compare)(const RBNode *a, const RBNode *b);
|
||||
RBNode *node;
|
||||
int (*compare)(const RBNode *a, const RBNode *b);
|
||||
};
|
||||
|
||||
/** Remove a node from the tree.
|
||||
|
||||
+10
-10
@@ -26,13 +26,13 @@ extern "C" {
|
||||
*
|
||||
*/
|
||||
struct uc_threadmsg{
|
||||
/**
|
||||
* A message type the application can use to
|
||||
/**
|
||||
* A message type the application can use to
|
||||
* discriminate different messages.
|
||||
* A negative value will cause a uc_threadmsg to
|
||||
* be added to the head of a queue.
|
||||
*/
|
||||
long msgtype;
|
||||
*/
|
||||
long msgtype;
|
||||
|
||||
/**
|
||||
* Internal pointer used by the uc_thread_queue.
|
||||
@@ -100,22 +100,22 @@ struct uc_threadqueue {
|
||||
* Number of elements in the queue.
|
||||
* Use #threadqueue_length to read it.
|
||||
*/
|
||||
unsigned int num_elements;
|
||||
unsigned int num_elements;
|
||||
|
||||
/** Max number of elements this queue will hold */
|
||||
unsigned int max_elements;
|
||||
/**
|
||||
* Mutex for the queue.
|
||||
*/
|
||||
pthread_mutex_t mutex;
|
||||
pthread_mutex_t mutex;
|
||||
/**
|
||||
* Condition variable for readers on the queue.
|
||||
*/
|
||||
pthread_cond_t read_cond;
|
||||
pthread_cond_t read_cond;
|
||||
/**
|
||||
* Condition variable for writers on the queue (if the queue is full).
|
||||
*/
|
||||
pthread_cond_t write_cond;
|
||||
pthread_cond_t write_cond;
|
||||
/**
|
||||
* Number of threads blocking on writing to the queue
|
||||
*/
|
||||
@@ -128,7 +128,7 @@ struct uc_threadqueue {
|
||||
/**
|
||||
* Internal pointers for the messages in the queue.
|
||||
*/
|
||||
struct uc_threadmsg *first,**last;
|
||||
struct uc_threadmsg *first,**last;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -192,7 +192,7 @@ static inline int uc_thread_queue_add(struct uc_threadqueue *queue, struct uc_th
|
||||
*
|
||||
* struct timespec is defined as:
|
||||
* @code
|
||||
* struct timespec {
|
||||
* struct timespec {
|
||||
* long tv_sec; // seconds
|
||||
* long tv_nsec; // nanoseconds
|
||||
* };
|
||||
|
||||
+622
-622
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user