[ovs-dev] [kernel-reload 5/8] ovsdb-client: Break table formatting into new library.

Ethan Jackson ethan at nicira.com
Tue Feb 8 21:27:48 UTC 2011


Looks Good.  Some minor comments below.

> @@ -0,0 +1,518 @@
> +/*
> + * Copyright (c) 2009, 2010, 2011 Nicira Networks.
> + *
Should this only be 2011?

+static const char *
+cell_to_text(const struct cell *cell_, const struct table_style *style)
+{
+    struct cell *cell = (struct cell *) cell_;

I don't see a reason to make cell_ const as nothing relies on it being const
and it is not in-fact const in this context.

+ *     cell actually contains OVSDB data because 'text' cannot be formatted
+ *     according to the table style; it is always output verbatim.
+ */
"output verbatim" -> "outputted verbatim"


+            if (length > widths[x])
+                widths[x] = length;

This should have braces.

diff --git a/lib/table.h b/lib/table.h
new file mode 100644
index 0000000..c826bfb
--- /dev/null
+++ b/lib/table.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2009, 2010, 2011 Nicira Networks.
+ *

Same here, 2011.

+struct cell *table_add_cell(struct table *table);
I think this should be: struct cell *table_add_cell(struct table *);




More information about the dev mailing list