-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix file corruption in TTeXDump #69
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The current implementation of TTeXDump uses TVirtualPS::PrintFast based methods to output TeX markup with automatic linewraps. Yet these methods are optimized for PostScript format where there are a lot of space characters that are used for newline placement. Current TTeXDump::DrawPolyMarker would often produce a long contiguous lines that trigger a forceful linewrap that can happen in the middle of real number constant (ignored by latex) or even in the middle of latex command (producing incorrect file). One solution would be to rewrite TTeXDump using only PrintRaw (that you can't mix with PrintStr/PrintFast/WriteReal). The other would be to fix PrintFast to not introduce forced newline. The third option is less intrusive and just adds additional spaces to provide clues for the proper line wrapping (this is the one implemented in this change).
Thanks. It is now applied on master. |
amadio
added a commit
to amadio/root
that referenced
this pull request
Jul 12, 2017
Warning: root/core/rootcling_stage1/src/rootcling_stage1.cxx(38): warning root-project#69: integer conversion resulted in truncation auto dummyVal = (int)(long)&usedToIdentifyRootClingByDlSym; ^^^ The method above uses a cast to long, followed by a cast to int, which results in a truncation. That is harmless, since the value is never used, but generates a compiler warning with ICC 17. This commit avoids the warning by storing the address of the same symbol in a static variable instead.
amadio
added a commit
to amadio/root
that referenced
this pull request
Jul 12, 2017
Warning: root/core/rootcling_stage1/src/rootcling_stage1.cxx(38): warning root-project#69: integer conversion resulted in truncation auto dummyVal = (int)(long)&usedToIdentifyRootClingByDlSym; ^^^ The method above uses a cast to long, followed by a cast to int, which results in a truncation. That is harmless, since the value is never used, but generates a compiler warning with ICC 17. This commit avoids the warning by storing the address of the same symbol in a static variable instead.
amadio
added a commit
to amadio/root
that referenced
this pull request
Jul 12, 2017
Warning: root/core/rootcling_stage1/src/rootcling_stage1.cxx(38): warning root-project#69: integer conversion resulted in truncation auto dummyVal = (int)(long)&usedToIdentifyRootClingByDlSym; ^^^ The method above uses a cast to long, followed by a cast to int, which results in a truncation. That is harmless, since the value is never used, but generates a compiler warning with ICC 17. This commit avoids the warning by storing the address of the same symbol in a static variable instead.
amadio
added a commit
that referenced
this pull request
Jul 13, 2017
Warning: root/core/rootcling_stage1/src/rootcling_stage1.cxx(38): warning #69: integer conversion resulted in truncation auto dummyVal = (int)(long)&usedToIdentifyRootClingByDlSym; ^^^ The method above uses a cast to long, followed by a cast to int, which results in a truncation. That is harmless, since the value is never used, but generates a compiler warning with ICC 17. This commit avoids the warning by storing the address of the same symbol in a static variable instead.
adriansev
pushed a commit
to adriansev/root
that referenced
this pull request
Sep 12, 2017
Warning: root/core/rootcling_stage1/src/rootcling_stage1.cxx(38): warning root-project#69: integer conversion resulted in truncation auto dummyVal = (int)(long)&usedToIdentifyRootClingByDlSym; ^^^ The method above uses a cast to long, followed by a cast to int, which results in a truncation. That is harmless, since the value is never used, but generates a compiler warning with ICC 17. This commit avoids the warning by storing the address of the same symbol in a static variable instead.
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a bug that would lead to producing corrupted files when saving plots as TeX.