Commit 6cb36a1e authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

kcmp: Cleanup sources

 - switch to use uintX type (just to drop uX finally,
   it doesn't worth to carry this type)

 - instead of including huge util.h rather include the
   files which are really needed: log, xmalloc, compiler
   and bug
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent d6ec8347
#ifndef __CR_KCMP_IDS_H__
#define __CR_KCMP_IDS_H__
#include <stdint.h>
#include "kcmp.h"
struct kid_tree {
......@@ -23,7 +25,7 @@ struct kid_elem {
unsigned idx;
};
extern u32 kid_generate_gen(struct kid_tree *tree,
struct kid_elem *elem, int *new_id);
extern uint32_t kid_generate_gen(struct kid_tree *tree,
struct kid_elem *elem, int *new_id);
#endif /* __CR_KCMP_IDS_H__ */
......@@ -2,8 +2,13 @@
#include <stdlib.h>
#include <sys/syscall.h>
#include "log.h"
#include "xmalloc.h"
#include "common/compiler.h"
#include "common/bug.h"
#include "rbtree.h"
#include "util.h"
#include "kcmp-ids.h"
/*
......@@ -52,7 +57,7 @@ struct kid_entry {
struct rb_root subtree_root;
struct rb_node subtree_node;
u32 subid; /* subid is always unique */
uint32_t subid; /* subid is always unique */
struct kid_elem elem;
} __aligned(sizeof(long));
......@@ -79,7 +84,7 @@ err:
return e;
}
static u32 kid_generate_sub(struct kid_tree *tree, struct kid_entry *e,
static uint32_t kid_generate_sub(struct kid_tree *tree, struct kid_entry *e,
struct kid_elem *elem, int *new_id)
{
struct rb_node *node = e->subtree_root.rb_node;
......@@ -119,7 +124,7 @@ static u32 kid_generate_sub(struct kid_tree *tree, struct kid_entry *e,
return sub->subid;
}
u32 kid_generate_gen(struct kid_tree *tree,
uint32_t kid_generate_gen(struct kid_tree *tree,
struct kid_elem *elem, int *new_id)
{
struct rb_node *node = tree->root.rb_node;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment