Skip to content

Commit

Permalink
magic formatting is consistent with TL - always 8 digits (#30)
Browse files Browse the repository at this point in the history
* magic formatting is consistent with TL - always 8 digits

* caonincal magic formatting in cpp
  • Loading branch information
hrissan authored Jun 19, 2024
1 parent bb42217 commit 5c968b1
Show file tree
Hide file tree
Showing 38 changed files with 118 additions and 118 deletions.
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

0 comments on commit 5c968b1

Please sign in to comment.