goplus / c2go

Convert C to Go
Apache License 2.0
306 stars 21 forks source link

compileStringLiteral: support wide int32 string #155

Closed visualfc closed 1 year ago

visualfc commented 2 years ago

support L"" wide string to int32 array C code

L"\\\a\b\f\n\r\t\v\e\x1\x0104中A+-@\"\'123abcABC";

Go code

(*int32)(unsafe.Pointer(&[28]int32{'\\', '\a', '\b', '\f', '\n', '\r', '\t', '\v', '\x1b', '\x01', 'Ą', '中', 'A', '+', '-', '@', '"', '\'', '1', '2', '3', 'a', 'b', 'c', 'A', 'B', 'C', '\x00'}))
codecov-commenter commented 2 years ago

Codecov Report

Base: 89.09% // Head: 89.04% // Decreases project coverage by -0.05% :warning:

Coverage data is based on head (d0efadc) compared to base (1d2ab8d). Patch coverage: 86.90% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #155 +/- ## ========================================== - Coverage 89.09% 89.04% -0.06% ========================================== Files 10 10 Lines 3431 3514 +83 ========================================== + Hits 3057 3129 +72 - Misses 294 302 +8 - Partials 80 83 +3 ``` | [Impacted Files](https://codecov.io/gh/goplus/c2go/pull/155?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goplus) | Coverage Δ | | |---|---|---| | [cl/codebuild.go](https://codecov.io/gh/goplus/c2go/pull/155/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goplus#diff-Y2wvY29kZWJ1aWxkLmdv) | `87.10% <64.70%> (-0.79%)` | :arrow_down: | | [cl/expr.go](https://codecov.io/gh/goplus/c2go/pull/155/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goplus#diff-Y2wvZXhwci5nbw==) | `91.05% <92.53%> (+0.17%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goplus). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goplus)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.