|
[patch #5709] Augmented Balanced Tree data structure: msg#00068statistics.pspp.devel
Update of patch #5709 (project pspp): Status: Ready For Test/Review => Works For Me Assigned to: jmd => blp _______________________________________________________ Follow-up Comment #1: Hey! This could be useful in some of my current research! I haven't tried it, but looking through the patch ... abt_init: might the aux parameter be better declared const? +struct abt_node * +abt_first (const struct abt *abt) +{ + struct abt_node *p = abt->root; + if (p != NULL) + while (p->down[0] != NULL) + p = p->down[0]; + return (struct abt_node *) p; +} Is this cast neccesary ? abt-test.c: This mangled line appears: This program is distributed in the hope that it wiabt be useful ^^^^ static unsigned factorial (unsigned n) { unsigned value = 1; I don't like qualifiers without a type. I thought gcc would have given a warning about this. +/* Reverses the order of the CNT integers starting at VALUES. */ +static void +reverse (int *values, size_t cnt) +{ + for (; cnt > 1; cnt -= 2, values++) + swap (values, &values[cnt - 1]); +} If I'm reading this correctly, then the comment doesn't agree with the code. It doesn't reverse the order of CNT integers, but reverses the order of each pair of integers. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/patch/?5709> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [patch #5709] Augmented Balanced Tree data structure: 00068, Ben Pfaff |
|---|---|
| Next by Date: | [patch #5709] Augmented Balanced Tree data structure: 00068, Ben Pfaff |
| Previous by Thread: | [patch #5709] Augmented Balanced Tree data structurei: 00068, Ben Pfaff |
| Next by Thread: | [patch #5709] Augmented Balanced Tree data structure: 00068, Ben Pfaff |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |