Skip to content

Commit c1adcb6

Browse files
committed
spec: use signed VERTEX_PFACE_FACE.vertind [BSd]
e.g. -5 instead of 65531
1 parent e83083c commit c1adcb6

File tree

9 files changed

+35
-23
lines changed

9 files changed

+35
-23
lines changed

doc/dynapi.texi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4741,7 +4741,7 @@ struct _dwg_object_entity*
47414741
@item flag
47424742
RC, DXF 70
47434743
@item vertind
4744-
BS, DXF 71
4744+
BSd, DXF 71
47454745

47464746
@end vtable
47474747
@end indentedblock

include/dwg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2409,7 +2409,7 @@ typedef struct _dwg_entity_VERTEX_PFACE_FACE
24092409
struct _dwg_object_entity *parent;
24102410

24112411
BITCODE_RC flag;
2412-
BITCODE_BS vertind[4];
2412+
BITCODE_BSd vertind[4];
24132413
} Dwg_Entity_VERTEX_PFACE_FACE;
24142414

24152415
#define COMMON_ENTITY_POLYLINE \

include/dwg_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8999,11 +8999,11 @@ extern "C"
89998999
********************************************************************/
90009000

90019001
// Get/Set vertind of a vertex_pface_face entity
9002-
EXPORT BITCODE_BS dwg_ent_vertex_pface_face_get_vertind (
9002+
EXPORT BITCODE_BSd dwg_ent_vertex_pface_face_get_vertind (
90039003
const dwg_ent_vert_pface_face *face) _deprecated_dynapi_getter;
90049004

90059005
EXPORT void dwg_ent_vertex_pface_face_set_vertind (
9006-
dwg_ent_vert_pface_face *restrict face, const BITCODE_BS vertind[4])
9006+
dwg_ent_vert_pface_face *restrict face, const BITCODE_BSd vertind[4])
90079007
__nonnull ((2)) _deprecated_dynapi_setter;
90089008

90099009
/********************************************************************

src/dwg.spec

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,14 +1289,14 @@ DWG_ENTITY (VERTEX_PFACE_FACE)
12891289
VALUE_3BD (pt, 10)
12901290
}
12911291
VALUE_RC ((BITCODE_RC)128, 70);
1292-
FIELD_BS (vertind[0], 71);
1293-
FIELD_BS (vertind[1], 72);
1294-
FIELD_BS (vertind[2], 73);
1295-
FIELD_BS0 (vertind[3], 74);
1292+
FIELD_BSd (vertind[0], 71);
1293+
FIELD_BSd (vertind[1], 72);
1294+
FIELD_BSd (vertind[2], 73);
1295+
FIELD_BSd0 (vertind[3], 74);
12961296
}
12971297
#elif defined IS_JSON
12981298
FIELD_RC (flag, 0);
1299-
FIELD_VECTOR_INL (vertind, BS, 4, 71);
1299+
FIELD_VECTOR_INL (vertind, BSd, 4, 71);
13001300
#else
13011301
//FIELD_VALUE (pt) = { 0.0, 0.0, 0.0 };
13021302
PRE (R_13b1)
@@ -1306,24 +1306,24 @@ DWG_ENTITY (VERTEX_PFACE_FACE)
13061306
LOG_FLAG_VERTEX
13071307
}
13081308
if (R11OPTS (OPTS_R11_VERTEX_HAS_INDEX1)) {
1309-
FIELD_RS (vertind[0], 71);
1309+
FIELD_RSd (vertind[0], 71);
13101310
}
13111311
if (R11OPTS (OPTS_R11_VERTEX_HAS_INDEX2)) {
1312-
FIELD_RS (vertind[1], 72);
1312+
FIELD_RSd (vertind[1], 72);
13131313
}
13141314
if (R11OPTS (OPTS_R11_VERTEX_HAS_INDEX3)) {
1315-
FIELD_RS (vertind[2], 73);
1315+
FIELD_RSd (vertind[2], 73);
13161316
}
13171317
if (R11OPTS (OPTS_R11_VERTEX_HAS_INDEX4)) {
1318-
FIELD_RS (vertind[3], 74);
1318+
FIELD_RSd (vertind[3], 74);
13191319
}
13201320
}
13211321
LATER_VERSIONS {
13221322
FIELD_VALUE (flag) = 128;
1323-
FIELD_BS (vertind[0], 71);
1324-
FIELD_BS (vertind[1], 72);
1325-
FIELD_BS (vertind[2], 73);
1326-
FIELD_BS (vertind[3], 74);
1323+
FIELD_BSd (vertind[0], 71);
1324+
FIELD_BSd (vertind[1], 72);
1325+
FIELD_BSd (vertind[2], 73);
1326+
FIELD_BSd (vertind[3], 74);
13271327
}
13281328
#endif
13291329
//TODO R13 has color_r11 and ltype_r11 for all vertices, not in DXF

src/dwg_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18471,7 +18471,7 @@ dwg_ent_mline_get_verts (const dwg_ent_mline *restrict mline,
1847118471

1847218472
/** Returns vertex_pface vertind
1847318473
*/
18474-
EXPORT BITCODE_BS
18474+
EXPORT BITCODE_BSd
1847518475
dwg_ent_vertex_pface_face_get_vertind (const dwg_ent_vert_pface_face *face)
1847618476
{
1847718477
if (face)
@@ -18489,7 +18489,7 @@ dwg_ent_vertex_pface_face_get_vertind (const dwg_ent_vert_pface_face *face)
1848918489
*/
1849018490
EXPORT void
1849118491
dwg_ent_vertex_pface_face_set_vertind (dwg_ent_vert_pface_face *restrict face,
18492-
const BITCODE_BS vertind[4])
18492+
const BITCODE_BSd vertind[4])
1849318493
{
1849418494
if (face
1849518495
# ifndef HAVE_NONNULL

src/dynapi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4122,7 +4122,7 @@ static const Dwg_DYNAPI_field _dwg_VERTEX_PFACE_FACE_fields[] = {
41224122
1,1,0, 0 },
41234123
{ "flag", "RC", sizeof (BITCODE_RC), OFF (struct _dwg_entity_VERTEX_PFACE_FACE, flag),
41244124
0,0,0, 70 },
4125-
{ "vertind", "BS", 4 * sizeof (BITCODE_BS), OFF (struct _dwg_entity_VERTEX_PFACE_FACE, vertind),
4125+
{ "vertind", "BSd", 4 * sizeof (BITCODE_BSd), OFF (struct _dwg_entity_VERTEX_PFACE_FACE, vertind),
41264126
0,0,0, 71 },
41274127
{NULL, NULL, 0, 0, 0,0,0, 0},
41284128
};

src/out_dxf.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,12 @@ dxf_print_rd (Bit_Chain *dat, BITCODE_RD value, int dxf)
664664
if (_obj->nam != 0) \
665665
FIELD_BS (nam, dxf) \
666666
}
667+
#define FIELD_BSd0(nam, dxf) \
668+
if (dxf) \
669+
{ \
670+
if (_obj->nam != 0) \
671+
FIELD_BSd (nam, dxf) \
672+
}
667673
#define FIELD_BS1(nam, dxf) \
668674
if (dxf) \
669675
{ \

src/out_dxfb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ static int dxfb_3dsolid (Bit_Chain *restrict dat,
255255
if (_obj->nam != 0) \
256256
FIELD_BS (nam, dxf) \
257257
}
258+
#define FIELD_BSd0(nam, dxf) \
259+
{ \
260+
if (_obj->nam != 0) \
261+
FIELD_BSd (nam, dxf) \
262+
}
258263
#define FIELD_BS1(nam, dxf) \
259264
{ \
260265
if (_obj->nam != 1) \
@@ -389,6 +394,7 @@ static int dxfb_3dsolid (Bit_Chain *restrict dat,
389394
#define FIELD_BB(nam, dxf) FIELD_RC (nam, dxf)
390395
#define FIELD_3B(nam, dxf) FIELD_RC (nam, dxf)
391396
#define FIELD_BS(nam, dxf) FIELD_RS (nam, dxf)
397+
#define FIELD_BSd(nam, dxf) FIELD_RS (nam, dxf)
392398
#define FIELD_BL(nam, dxf) FIELD_RL (nam, dxf)
393399
#define HEADER_BLL(nam, dxf) HEADER_RLL (nam, dxf)
394400
#define FIELD_BD(nam, dxf) FIELD_RD (nam, dxf)

test/unit-testing/dynapi_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25755,12 +25755,12 @@ static int test_VERTEX_PFACE_FACE (const Dwg_Object *obj)
2575525755
fail ("VERTEX_PFACE_FACE.parent [struct _dwg_object_entity*]");
2575625756
}
2575725757
{
25758-
BITCODE_BS vertind[4];
25758+
BITCODE_BSd vertind[4];
2575925759
if (dwg_dynapi_entity_value (vertex_pface_face, "VERTEX_PFACE_FACE", "vertind", &vertind, NULL)
25760-
&& !memcmp (&vertind, &vertex_pface_face->vertind, sizeof (BITCODE_BS)))
25760+
&& !memcmp (&vertind, &vertex_pface_face->vertind, sizeof (BITCODE_BSd)))
2576125761
pass ();
2576225762
else
25763-
fail ("VERTEX_PFACE_FACE.vertind [BS]");
25763+
fail ("VERTEX_PFACE_FACE.vertind [BSd]");
2576425764
}
2576525765
if (failed && (is_class_unstable ("VERTEX_PFACE_FACE") || is_class_debugging ("VERTEX_PFACE_FACE")))
2576625766
{

0 commit comments

Comments
 (0)