mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
Make clang-format place func names at line start
This commit is contained in:
1 parent
8a6e177701
commit
d73353024c
3 files changed
+212
-197
No files matched your search
@@ -738,7 +738,10 @@ func (g *gen) writeCppImpls(b *buffer) error {
|
||||
|
||||
structID := n.QID()[1]
|
||||
structName := structID.Str(g.tm)
|
||||
b.printf("inline void %s%s::check_wuffs_version(size_t sizeof_star_self, uint64_t wuffs_version) {\n",
|
||||
// The empty // comment makes clang-format place the function name
|
||||
// at the start of a line.
|
||||
b.writes("inline void //\n")
|
||||
b.printf("%s%s::check_wuffs_version(size_t sizeof_star_self, uint64_t wuffs_version) {\n",
|
||||
g.pkgPrefix, structName)
|
||||
b.printf("%s%s__check_wuffs_version(this, sizeof_star_self, wuffs_version);\n",
|
||||
g.pkgPrefix, structName)
|
||||
|
||||
@@ -99,6 +99,12 @@ func (g *gen) writeFuncSignature(b *buffer, n *a.Func, cpp uint32) error {
|
||||
return fmt.Errorf("TODO: multiple return values")
|
||||
}
|
||||
|
||||
if cpp != cppInsideStruct {
|
||||
// The empty // comment makes clang-format place the function name at
|
||||
// the start of a line.
|
||||
b.writes("//\n")
|
||||
}
|
||||
|
||||
switch cpp {
|
||||
case cppNone:
|
||||
b.writes(g.funcCName(n))
|
||||
|
||||
Reference in new issue
Block a user