projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
psppire-var-sheet: Hard-code size of pixbuf cells.
[pspp]
/
src
/
libpspp
/
ll.h
diff --git
a/src/libpspp/ll.h
b/src/libpspp/ll.h
index 65ecf55f2cad759a50085a85e90f1e3c79cf7f02..9e6e35f04ad72ee4af7264883cf080bc49359ad0 100644
(file)
--- a/
src/libpspp/ll.h
+++ b/
src/libpspp/ll.h
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006
, 2009, 2011
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-50,6
+50,7
@@
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
+#include "libpspp/cast.h"
/* Embedded, circular doubly linked list.
/* Embedded, circular doubly linked list.
@@
-108,8
+109,9
@@
/* Returns the data structure corresponding to the given node LL,
assuming that LL is embedded as the given MEMBER name in data
type STRUCT. */
/* Returns the data structure corresponding to the given node LL,
assuming that LL is embedded as the given MEMBER name in data
type STRUCT. */
-#define ll_data(LL, STRUCT, MEMBER) \
- ((STRUCT *) ((char *) (LL) - offsetof (STRUCT, MEMBER)))
+#define ll_data(LL, STRUCT, MEMBER) \
+ (CHECK_POINTER_HAS_TYPE(LL, struct ll *), \
+ UP_CAST(LL, STRUCT, MEMBER))
/* Linked list node. */
struct ll
/* Linked list node. */
struct ll
@@
-378,7
+380,7
@@
ll_tail (const struct ll_list *list)
static inline struct ll *
ll_null (const struct ll_list *list)
{
static inline struct ll *
ll_null (const struct ll_list *list)
{
- return
(struct ll *) &list->null
;
+ return
CONST_CAST (struct ll *, &list->null)
;
}
/* Returns the node following LL in its list,
}
/* Returns the node following LL in its list,