1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Use inttypes.h

This commit is contained in:
Alasdair Kergon 2001-11-15 14:14:03 +00:00
parent 79b5666abe
commit 5389c987a3
3 changed files with 5 additions and 17 deletions

View File

@ -50,10 +50,10 @@ static inline int list_empty(struct list *head) {
for (v = (head)->n; v != head; v = v->n)
#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 */
#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

View File

@ -10,19 +10,7 @@
#include "list.h"
#include <sys/types.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
#include <inttypes.h>
struct str_list {
struct list list;

View File

@ -50,10 +50,10 @@ static inline int list_empty(struct list *head) {
for (v = (head)->n; v != head; v = v->n)
#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 */
#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