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

Split objfreespace and second header #929

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michal-josef-spacek
Copy link
Contributor

There is possibility of second header and without objfreespace in AC1012. This mean, that we need to split.

@michal-josef-spacek
Copy link
Contributor Author

@rurban First version, with error, which I don't see

In file included from encode.c:53:
encode.c: In function ‘encode_template’:
common.h:446:6: error: this condition has identical branches [-Werror=duplicated-branches]
  446 |   if (dat->version >= v)
      |      ^
encode.c:2506:3: note: in expansion of macro ‘SINCE’
 2506 |   SINCE (R_2004)
      |   ^~~~~

@rurban
Copy link
Contributor

rurban commented Jan 29, 2024

No, we don't. If the objfreespace address is zero, as in sample_2000, this section is omitted, but the 2nd header not

@michal-josef-spacek
Copy link
Contributor Author

Ha, another case.

AC1012 - some versions do have not objfreespace record in the header, the section doesn't exist.
other AC1012/AC1013/AC1014/AC1015 < AutoCAD 2005 - has objfreespace record in the header, section exists
AC1015 > AutoCAD 2005 - has objfreespace record in the header with 0 size, section doesn't exist.

@rurban
Copy link
Contributor

rurban commented Jan 30, 2024

section 3 often does not exist, i.e. empty address and size, but often the 2ndheader is still attached to it. My latest fixes work now. I don't want to split it, as it confuses the section number logic. (dwg->header.sections)

@rurban rurban self-requested a review January 30, 2024 12:13
@rurban rurban self-assigned this Jan 30, 2024
@rurban rurban added the bug Something isn't working label Jan 30, 2024
include/dwg.h Outdated
SECTION_AUXHEADER_R2000 = 5,
SECTION_THUMBNAIL_R13 = 6,
SECTION_OBJFREESPACE_R13 = 3,
SECTION_SECOND_HEADER_R13 = 4,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nope this confuses our section numbering even more. I'd like it keeping attached to the ObjFreeSpace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need to look again.

@michal-josef-spacek michal-josef-spacek changed the title WIP: Split objfreespace and second header Split objfreespace and second header Jan 31, 2024
@michal-josef-spacek
Copy link
Contributor Author

@rurban I updated PR.
See comment #860 (comment)

@rurban
Copy link
Contributor

rurban commented Feb 4, 2024

For the time being I did it simplier for 0.13, as your patch with my fixes filled up my hard disc.

@michal-josef-spacek
Copy link
Contributor Author

Hm, there is some memory issue.

@rurban
Copy link
Contributor

rurban commented Feb 9, 2024

But we should fix this better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants