FreeBSD Bugzilla – Attachment 252444 Details for
Bug 280566
tree(3) man page: Fix example source code.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix the example source code in tree(3) man page EXAMPLES.
man3-tree.diff (text/plain), 1.05 KB, created by
Hodong
on 2024-08-02 04:33:40 UTC
(
hide
)
Description:
Fix the example source code in tree(3) man page EXAMPLES.
Filename:
MIME Type:
Creator:
Hodong
Created:
2024-08-02 04:33:40 UTC
Size:
1.05 KB
patch
obsolete
>diff --git a/share/man/man3/tree.3 b/share/man/man3/tree.3 >index e6d855c5ade0..2a66f4bf14cd 100644 >--- a/share/man/man3/tree.3 >+++ b/share/man/man3/tree.3 >@@ -675,6 +675,7 @@ To maintain the sum of the values in the tree, each element maintains > the sum of its value and the sums from its left and right subtrees. > Lastly, the internal structure of the tree is printed. > .Bd -literal -offset 3n >+#define RB_AUGMENT(entry) sumaug(entry) > #include <sys/tree.h> > #include <err.h> > #include <stdio.h> >@@ -699,8 +700,8 @@ sumaug(struct node *e) > e->sum += RB_LEFT(e, entry)->sum; > if (RB_RIGHT(e, entry) != NULL) > e->sum += RB_RIGHT(e, entry)->sum; >+ return e->sum; > } >-#define RB_AUGMENT(entry) sumaug(entry) > > RB_HEAD(inttree, node) head = RB_INITIALIZER(&head); > RB_GENERATE(inttree, node, entry, intcmp) >@@ -749,8 +750,9 @@ main(void) > printf("%d\en", n->i); > } > print_tree(RB_ROOT(&head)); >- printf("Sum of values = %d\n", RB_ROOT(&head)->sum); >- printf("\en"); >+ puts(""); >+ printf("Sum of values = %d\en", RB_ROOT(&head)->sum); >+ puts(""); > return (0); > } > .Ed
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 280566
: 252444 |
252471