Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused macros #1057

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions src/dec_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -1160,22 +1160,6 @@
dxf) \
} \
}
#define SUB_FIELD_VECTOR_N(o, nam, type, csize, dxf) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's the needed allocating variant

if (csize > 0) \
{ \
SUB_VECTOR_CHKCOUNT (o, nam, type, csize, dat) \
_obj->o.nam \
= (BITCODE_##type *)calloc (csize, sizeof (BITCODE_##type)); \
if (!_obj->o.nam) \
return DWG_ERR_OUTOFMEM; \
for (vcount = 0; vcount < (BITCODE_BL)csize; vcount++) \
{ \
_obj->o.nam[vcount] = bit_read_##type (dat); \
LOG_TRACE (#nam "[%ld]: " FORMAT_##type " [" #type " %d]", \
(long)vcount, _obj->o.nam[vcount], dxf) \
LOG_POS \
} \
}
#define SUB_FIELD_VECTOR(o, name, type, sizefield, dxf) \
if (_obj->o.sizefield > 0) \
{ \
Expand Down Expand Up @@ -1215,19 +1199,6 @@
LOG_TRACE ("} [*" #type "]") \
LOG_POS \
}
// inlined, with const size and without malloc
#define SUB_FIELD_VECTOR_INL(o, nam, type, csize, dxf) \
if (csize > 0) \
{ \
_VECTOR_CHKCOUNT_STATIC (nam, csize, TYPE_MAXELEMSIZE (type), dat) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and that's the variant with the bounds check

for (vcount = 0; vcount < (BITCODE_BL)csize; vcount++) \
{ \
_obj->o.nam[vcount] = bit_read_##type (dat); \
LOG_TRACE (#nam "[%ld]: " FORMAT_##type " [" #type " %d]", \
(long)vcount, _obj->o.nam[vcount], dxf) \
LOG_POS \
} \
}
#define FIELD_VECTOR_T(name, type, size, dxf) \
if (_obj->size > 0) \
{ \
Expand Down
Loading