{ \
Type ## Node **node = prefix ## nfd(self, key, cmp); \
\
- if (! *node) \
+ if (!*node) \
return NULL; \
\
return trans ? trans((*node)->dat) : (*node)->dat; \
{ \
Type ## Node **node = prefix ## nfd(self, key, cmp); \
\
- if (! *node) \
+ if (!*node) \
return false; \
\
if (call) \
void flag_slp(Flag *flag)
{
pthread_mutex_lock(&flag->mtx);
- if (! flag->set)
+ if (!flag->set)
pthread_cond_wait(&flag->cnd, &flag->mtx);
pthread_mutex_unlock(&flag->mtx);
}
pthread_rwlock_rdlock(&map->clk);
- if ((success = ! map->cnl)) {
+ if ((success = !map->cnl)) {
if (write)
pthread_rwlock_wrlock(&map->tlk);
else
#define WRAP_TREE_FUNC(type, name, write, CallbackType, null) \
type map_ ## name(Map *map, void *dat, Comparator cmp, CallbackType func) \
{ \
- if (! get_lock(map, write)) \
+ if (!get_lock(map, write)) \
return null; \
\
type ret = tree_ ## name(&map->tre, dat, cmp, func); \
void map_trv(Map *map, Iterator iter, void *arg, Transformer trans, TreeTraversionOrder order)
{
- if (! get_lock(map, false))
+ if (!get_lock(map, false))
return;
tree_trv(&map->tre, iter, arg, trans, order);
bool success = false;
pthread_mutex_lock(&queue->mtx);
- if (! queue->fin) {
+ if (!queue->fin) {
success = true;
list_apd(&queue->lst, dat);
pthread_cond_signal(&queue->cnd);
void *dat = NULL;
pthread_mutex_lock(&queue->mtx);
- while (! queue->cnl && ! dat) {
+ while (!queue->cnl && !dat) {
ListNode **node = &queue->lst.fst;
if (*node) {
dat = (*node)->dat;
unsigned short count = --rc->cnt;
pthread_mutex_unlock(&rc->mtx);
- if (! count)
+ if (!count)
rc->del(rc->obj);
}
bool is_finished()
{
- ITER_FLAGS if (! flags[i].set)
+ ITER_FLAGS if (!flags[i].set)
return false;
return true;
pthread_t thread;
pthread_create(&thread, NULL, &start_thread, NULL);
- while (! is_finished()) {
+ while (!is_finished()) {
int i = rand() % NUM_FLAGS;
printf("setting flag %d\n", i);
static void *thread_create(unsigned int *result)
{
- while (! cancel) {
+ while (!cancel) {
DataObject *obj = malloc(sizeof *obj);
obj->id = rand_id();
{
DataObject *objs[NUM_OBJS] = {NULL};
- while (! cancel) {
+ while (!cancel) {
int i = rand() % NUM_OBJS;
if (objs[i]) {
objs[i] = NULL;
}
- while (! objs[i] && ! cancel) {
+ while (!objs[i] && !cancel) {
int id = rand_id();
objs[i] = map_get(&map, &id, &data_object_compare_id, &refcount_grb);
}
static void *thread_delete(unsigned int *result)
{
- while (! cancel) {
+ while (!cancel) {
unsigned int id = rand_id();
if (map_del(&map, &id, &data_object_compare_id, &refcount_drp))
static inline TreeNode **search(TreeNode **node, void *key, Comparator cmp)
{
- if (! *node)
+ if (!*node)
return node;
int rel = cmp((*node)->dat, key);
static inline void traverse(TreeNode *node, Iterator iter, void *arg, Transformer trans, TreeTraversionOrder order, int delete)
{
- if (! node)
+ if (!node)
return;
if (iter && order == TRAVERSION_PREORDER ) iter(trans ? trans(node->dat) : node->dat, arg);