mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: convert dive.c to C++
Long term project: convert core to C++ so that we can use higer-level constructs, notably std::vector<>. This does not change any code - only fixes compile issues. Mostly casting of (void *) to the proper type. Also designated initialization of the sample struct had to be rearranged. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
096e49e15b
commit
52e6a098aa
4 changed files with 121 additions and 121 deletions
|
|
@ -13,17 +13,17 @@
|
|||
} \
|
||||
}
|
||||
|
||||
#define STRUCTURED_LIST_COPY(_type, _first, _dest, _cpy) \
|
||||
{ \
|
||||
_type *_sptr = _first; \
|
||||
_type **_dptr = &_dest; \
|
||||
while (_sptr) { \
|
||||
*_dptr = malloc(sizeof(_type)); \
|
||||
_cpy(_sptr, *_dptr); \
|
||||
_sptr = _sptr->next; \
|
||||
_dptr = &(*_dptr)->next; \
|
||||
} \
|
||||
*_dptr = 0; \
|
||||
#define STRUCTURED_LIST_COPY(_type, _first, _dest, _cpy) \
|
||||
{ \
|
||||
_type *_sptr = _first; \
|
||||
_type **_dptr = &_dest; \
|
||||
while (_sptr) { \
|
||||
*_dptr = (_type *)malloc(sizeof(_type)); \
|
||||
_cpy(_sptr, *_dptr); \
|
||||
_sptr = _sptr->next; \
|
||||
_dptr = &(*_dptr)->next; \
|
||||
} \
|
||||
*_dptr = 0; \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue