mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
Use inttypes.h
This commit is contained in:
parent
79b5666abe
commit
5389c987a3
@ -50,10 +50,10 @@ static inline int list_empty(struct list *head) {
|
|||||||
for (v = (head)->n; v != head; v = v->n)
|
for (v = (head)->n; v != head; v = v->n)
|
||||||
|
|
||||||
#define list_item(v, t) \
|
#define list_item(v, t) \
|
||||||
((t *)((char *)(v) - (unsigned int) &((t *) 0)->list))
|
((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->list))
|
||||||
|
|
||||||
/* Given a known element in a known structure, locate the struct list */
|
/* Given a known element in a known structure, locate the struct list */
|
||||||
#define list_head(v, t, e) \
|
#define list_head(v, t, e) \
|
||||||
(((t *)((char *)(v) - (unsigned int) &((t *) 0)->e))->list)
|
(((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->e))->list)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -10,19 +10,7 @@
|
|||||||
#include "list.h"
|
#include "list.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <inttypes.h>
|
||||||
typedef __uint8_t uint8_t;
|
|
||||||
typedef __uint16_t uint16_t;
|
|
||||||
typedef __uint32_t uint32_t;
|
|
||||||
typedef __uint64_t uint64_t;
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
typedef __int8_t int8_t;
|
|
||||||
typedef __int16_t int16_t;
|
|
||||||
typedef __int32_t int32_t;
|
|
||||||
typedef __int64_t int64_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
struct str_list {
|
struct str_list {
|
||||||
struct list list;
|
struct list list;
|
||||||
|
@ -50,10 +50,10 @@ static inline int list_empty(struct list *head) {
|
|||||||
for (v = (head)->n; v != head; v = v->n)
|
for (v = (head)->n; v != head; v = v->n)
|
||||||
|
|
||||||
#define list_item(v, t) \
|
#define list_item(v, t) \
|
||||||
((t *)((char *)(v) - (unsigned int) &((t *) 0)->list))
|
((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->list))
|
||||||
|
|
||||||
/* Given a known element in a known structure, locate the struct list */
|
/* Given a known element in a known structure, locate the struct list */
|
||||||
#define list_head(v, t, e) \
|
#define list_head(v, t, e) \
|
||||||
(((t *)((char *)(v) - (unsigned int) &((t *) 0)->e))->list)
|
(((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->e))->list)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user