From 1ef54e1402bcf17e34030e8be74434e085ee4637 Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Sun, 12 Aug 2018 17:39:57 +0200 Subject: [PATCH] free: not the static strings but all the others --- src/dwg.spec | 38 ++++++++++++++++++-------------------- src/free.c | 1 + src/out_dxf.c | 1 + src/out_dxfb.c | 1 + 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/dwg.spec b/src/dwg.spec index cce45c432d..61e0557dfa 100644 --- a/src/dwg.spec +++ b/src/dwg.spec @@ -335,10 +335,10 @@ DWG_ENTITY(BLOCK) DXF { Dwg_Bitcode_3RD pt = {0,0,0}; - VALUE_BL(0, 70); - VALUE_3BD(pt, 10); - FIELD_TV(name, 3); - VALUE_TV("", 1); + VALUE_BL (0, 70); + VALUE_3BD (pt, 10); + FIELD_TV (name, 3); + VALUE_TFF ("", 1); } DWG_ENTITY_END @@ -2397,8 +2397,8 @@ DWG_OBJECT(STYLE) (s = strstr(_buf, ".TTF"))) { *s = 0; - VALUE_TV ("ACAD", 1001); - VALUE_TV (_buf, 1000); + VALUE_TFF ("ACAD", 1001); + VALUE_TFF (_buf, 1000); VALUE_RL (34, 1071); } } @@ -3295,12 +3295,12 @@ DWG_OBJECT(MLINESTYLE) { #if defined(IS_DXF) && !defined(IS_ENCODE) switch (FIELD_VALUE(lines[rcount1].ltindex)) { - case 32767: VALUE_TV("BYLAYER", 6); break; /* default */ - case 32766: VALUE_TV("BYBLOCK", 6); break; - case 0: VALUE_TV("CONTINUOUS", 6); break; + case 32767: VALUE_TFF("BYLAYER", 6); break; /* default */ + case 32766: VALUE_TFF("BYBLOCK", 6); break; + case 0: VALUE_TFF("CONTINUOUS", 6); break; //else lookup on LTYPE_CONTROL list default: /*FIELD_HANDLE_NAME(ltype, 5, 6);*/ - VALUE_TV("", 6); break; + VALUE_TFF("", 6); break; } #else FIELD_BS (lines[rcount1].ltindex, 6); @@ -5056,7 +5056,7 @@ DWG_ENTITY(MULTILEADER) //DECODE_UNKNOWN_BITS SUBCLASS (AcDbMLeader) - DXF { VALUE_TV ("CONTEXT_DATA{", 300); } //AcDbObjectContextData + DXF { VALUE_TFF ("CONTEXT_DATA{", 300); } //AcDbObjectContextData SINCE(R_2010) { @@ -5078,7 +5078,7 @@ DWG_ENTITY(MULTILEADER) LOG_ERROR("Invalid MULTILEADER.ctx.num_leaders %d", _obj->ctx.num_leaders); return DWG_ERR_VALUEOUTOFBOUNDS; } - DXF { VALUE_TV ("LEADER{", 302); } + DXF { VALUE_TFF ("LEADER{", 302); } REPEAT(ctx.num_leaders, ctx.leaders, Dwg_Leader) { #define lnode ctx.leaders[rcount1] @@ -5102,15 +5102,15 @@ DWG_ENTITY(MULTILEADER) END_REPEAT(lnode.breaks); FIELD_BL (lnode.branch_index, 90); FIELD_BD (lnode.dogleg_length, 40); - DXF { VALUE_TV ("LEADER_LINE{", 304); } + DXF { VALUE_TFF ("LEADER_LINE{", 304); } FIELD_BL (lnode.num_lines, 0); - REPEAT2(lnode.num_lines, lnode.lines, Dwg_Leader_Line) + REPEAT2 (lnode.num_lines, lnode.lines, Dwg_Leader_Line) { #define lline lnode.lines[rcount2] FIELD_BL (lline.num_vertex, 0); FIELD_3BD (lline.vertex, 10); FIELD_BL (lline.num_breaks, 0); - REPEAT3(lline.num_breaks, lline.breaks, Dwg_Leader_Break) + REPEAT3 (lline.num_breaks, lline.breaks, Dwg_Leader_Break) { FIELD_3BD (lline.breaks[rcount3].start, 11); FIELD_3BD (lline.breaks[rcount3].end, 12); @@ -5135,11 +5135,11 @@ DWG_ENTITY(MULTILEADER) END_REPEAT(lnode.lines) SINCE (R_2010) FIELD_BS (lnode.attach_dir, 271); - DXF { VALUE_TV ("}", 305); } + DXF { VALUE_TFF ("}", 305); } } SET_PARENT_OBJ(ctx.leaders) END_REPEAT(ctx.leaders) - DXF { VALUE_TV ("}", 303); } + DXF { VALUE_TFF ("}", 303); } FIELD_BD (ctx.scale, 40); FIELD_3BD (ctx.content_base, 10); @@ -5207,7 +5207,7 @@ DWG_ENTITY(MULTILEADER) FIELD_BS (ctx.text_top, 273); FIELD_BS (ctx.text_bottom, 272); } - DXF { VALUE_TV ("}", 301); } //end CONTEXT_DATA + DXF { VALUE_TFF ("}", 301); } //end CONTEXT_DATA // END MLeaderAnnotContext FIELD_BL (flags, 90); // override flags @@ -6900,5 +6900,3 @@ DWG_OBJECT(CSACDOCUMENTOPTIONS) DWG_OBJECT_END #endif - - diff --git a/src/free.c b/src/free.c index 1b6f2b0bd1..b69ad5aba7 100644 --- a/src/free.c +++ b/src/free.c @@ -95,6 +95,7 @@ static Bit_Chain *dat = &pdat; } #define VALUE_TV(value,dxf) FREE_IF(value) #define VALUE_TF(value,dxf) FREE_IF(value) +#define VALUE_TFF(value,dxf) #define FIELD_TU(name,dxf) FIELD_TV(name,dxf) #define FIELD_TF(name,len,dxf) FIELD_TV(name,dxf) #define FIELD_TFF(name,len,dxf) {} diff --git a/src/out_dxf.c b/src/out_dxf.c index e21fef8604..5271c6bc50 100644 --- a/src/out_dxf.c +++ b/src/out_dxf.c @@ -84,6 +84,7 @@ static int dxf_3dsolid(Bit_Chain *restrict dat, fprintf(dat->fh, "\r\n"); \ } #endif +#define VALUE_TFF(str,dxf) VALUE_TV(str, dxf) #define VALUE_BINARY(value,size,dxf) \ { \ long len = size; \ diff --git a/src/out_dxfb.c b/src/out_dxfb.c index 180cd249ea..fb83718cd8 100644 --- a/src/out_dxfb.c +++ b/src/out_dxfb.c @@ -80,6 +80,7 @@ dxfb_common_entity_handle_data(Bit_Chain *restrict dat, fprintf(dat->fh, "%c%c", 0, 0); \ } #endif +#define VALUE_TFF(str,dxf) VALUE_TV(str, dxf) #define VALUE_BINARY(value,size,dxf) \ { \ long len = size; \