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

magic formatting is consistent with TL - always 8 digits #30

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/tlcodegen/qt_factory.qtpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func init() {
{%- for _, wr := range typeWrappers -%}
{%- if wr.tlTag == 0 || !wr.IsTopLevel() -%} {%- continue -%} {%- endif -%}
{%- if fun, ok := wr.trw.(*TypeRWStruct); ok && len(wr.NatParams) == 0-%}
{%- code tlTag := fmt.Sprintf("%#08x", wr.tlTag) -%}
{%- code tlTag := fmt.Sprintf("0x%08x", wr.tlTag) -%}
{%- if wr.unionParent != nil && wr.unionParent.IsEnum -%}
meta.SetGlobalFactoryCreateForEnumElement({%s tlTag %})
{%- continue -%}
Expand Down
2 changes: 1 addition & 1 deletion internal/tlcodegen/qt_factory.qtpl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/tlcodegen/qt_meta.qtpl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func init() {
{%- endif -%}
"{%= wr.tlName.String() %}#{%s= fmt.Sprintf("%08x", wr.tlTag) %}",
{%q= fmt.Sprintf("#%08x", wr.tlTag) %},
&TLItem{tag: {%s= fmt.Sprintf("%#x", wr.tlTag) %}, annotations: {%s= fmt.Sprintf("%#x", wr.AnnotationsMask()) %}, tlName: "{%= wr.tlName.String() %}"})
&TLItem{tag: {%s= fmt.Sprintf("0x%08x", wr.tlTag) %}, annotations: {%s= fmt.Sprintf("0x%x", wr.AnnotationsMask()) %}, tlName: "{%= wr.tlName.String() %}"})
{%- endif -%}
{%- endstripspace -%}

Expand Down
4 changes: 2 additions & 2 deletions internal/tlcodegen/qt_meta.qtpl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/tlcodegen/qt_namespace.qtpl
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ switch tag {
{%- for _, wr := range types -%}
{%- if fun, ok := wr.trw.(*TypeRWStruct); ok && fun.ResultType != nil -%}
{%- code
tlTag := fmt.Sprintf("%#08x", wr.tlTag)
tlTag := fmt.Sprintf("0x%08x", wr.tlTag)
funcTypeString := wr.TypeString2(false, directImports, nil, true, true)
tlName := wr.tlName.String()
-%}
Expand Down
2 changes: 1 addition & 1 deletion internal/tlcodegen/qt_namespace.qtpl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/tlcodegen/qt_struct.qtpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{%- func (struct_ *TypeRWStruct)GenerateCode(bytesVersion bool, directImports *DirectImports) -%}
{%- code
goName := addBytes(struct_.wr.goGlobalName, bytesVersion)
tlTag := fmt.Sprintf("%#x", struct_.wr.tlTag)
tlTag := fmt.Sprintf("0x%08x", struct_.wr.tlTag)
natArgsDecl := formatNatArgsDecl(struct_.wr.NatParams)
natArgsCall := formatNatArgsDeclCall(struct_.wr.NatParams)
writeNeedsError := struct_.wr.hasErrorInWriteMethods
Expand Down
2 changes: 1 addition & 1 deletion internal/tlcodegen/qt_struct.qtpl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/tlcodegen/qt_union.qtpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (item*{%s= goName %}) ReadBoxed(w []byte{%s= natArgsDecl %}) (_ []byte, err
}
switch tag {
{%- for i, field := range union.Fields -%}
case {%s= fmt.Sprintf("%#x", field.t.tlTag) %}:
case {%s= fmt.Sprintf("0x%08x", field.t.tlTag) %}:
item.index = {%d i %}
{%- if field.t.IsTrueType() -%}
return w, nil
Expand Down Expand Up @@ -487,7 +487,7 @@ func (item *{%s= goGlobalName %}) Set{%s= field.goName %}(value {%s= fieldTypeSt
var _{%s= goName %} = [{%d len(union.Fields) %}]{%s= union.wr.gen.InternalPrefix()%}UnionElement{
{%- for _, x := range union.Fields -%}
{%- code
tlTag := fmt.Sprintf("%#x", x.t.tlTag )
tlTag := fmt.Sprintf("0x%08x", x.t.tlTag )
tlString := fmt.Sprintf("%s#%08x", x.t.tlName, x.t.tlTag)
tlName := x.t.tlName.String()
-%}
Expand Down
4 changes: 2 additions & 2 deletions internal/tlcodegen/qt_union.qtpl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/tlcodegen/test/gen/cases/meta/meta.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading