summaryrefslogtreecommitdiff
path: root/2005/flow-accounting-ols2005/OLS2005/EXAMPLE/complexCode/Figures/example.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-10-25 21:00:20 +0100
committerHarald Welte <laforge@gnumonks.org>2015-10-25 21:00:20 +0100
commitfca59bea770346cf1c1f9b0e00cb48a61b44a8f3 (patch)
treea2011270df48d3501892ac1a56015c8be57e8a7d /2005/flow-accounting-ols2005/OLS2005/EXAMPLE/complexCode/Figures/example.c
import of old now defunct presentation slides svn repo
Diffstat (limited to '2005/flow-accounting-ols2005/OLS2005/EXAMPLE/complexCode/Figures/example.c')
-rw-r--r--2005/flow-accounting-ols2005/OLS2005/EXAMPLE/complexCode/Figures/example.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/2005/flow-accounting-ols2005/OLS2005/EXAMPLE/complexCode/Figures/example.c b/2005/flow-accounting-ols2005/OLS2005/EXAMPLE/complexCode/Figures/example.c
new file mode 100644
index 0000000..34d1726
--- /dev/null
+++ b/2005/flow-accounting-ols2005/OLS2005/EXAMPLE/complexCode/Figures/example.c
@@ -0,0 +1,18 @@
+typedef struct QuadTree {
+ double Data;
+ struct QuadTree *Children[4];
+} QT;
+
+void Sum3rdChildren(QT *T,
+ double *Result) {
+ double Ret;
+ if (T == 0) { Ret = 0;
+ } else {
+ QT *Child3 =
+ T[0].Children[3];
+ double V;
+ Sum3rdChildren(Child3, &V);
+ Ret = V + T[0].Data;
+ }
+ *Result = Ret;
+}
personal git repositories of Harald Welte. Your mileage may vary