Re: [ovs-dev] [PATCH] json: Use unnamed embedded union.

2018-08-07 Thread Flavio Leitner
On Mon, Aug 06, 2018 at 04:47:22PM -0700, Ben Pfaff wrote:
> On Thu, Aug 02, 2018 at 06:52:55PM -0300, Flavio Leitner wrote:
> > On Thu, Aug 02, 2018 at 06:44:10PM -0300, Flavio Leitner wrote:
> > > Otherwise the code does not build.
> > > 
> > > Fixes: fa37affad362 ("Embrace anonymous unions.")
> > > Signed-off-by: Flavio Leitner 
> > 
> > This needs to go in branch-2.10 as well.
> 
> Apparently I never build this code (oops!).
> 
> I applied this to master and branch-2.10.  I didn't actually build or
> test it or anything though.

Thanks Ben, works for me!

-- 
Flavio

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] json: Use unnamed embedded union.

2018-08-06 Thread Ben Pfaff
On Thu, Aug 02, 2018 at 06:52:55PM -0300, Flavio Leitner wrote:
> On Thu, Aug 02, 2018 at 06:44:10PM -0300, Flavio Leitner wrote:
> > Otherwise the code does not build.
> > 
> > Fixes: fa37affad362 ("Embrace anonymous unions.")
> > Signed-off-by: Flavio Leitner 
> 
> This needs to go in branch-2.10 as well.

Apparently I never build this code (oops!).

I applied this to master and branch-2.10.  I didn't actually build or
test it or anything though.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] json: Use unnamed embedded union.

2018-08-02 Thread Flavio Leitner
On Thu, Aug 02, 2018 at 06:44:10PM -0300, Flavio Leitner wrote:
> Otherwise the code does not build.
> 
> Fixes: fa37affad362 ("Embrace anonymous unions.")
> Signed-off-by: Flavio Leitner 

This needs to go in branch-2.10 as well.

-- 
Flavio

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] json: Use unnamed embedded union.

2018-08-02 Thread Flavio Leitner
Otherwise the code does not build.

Fixes: fa37affad362 ("Embrace anonymous unions.")
Signed-off-by: Flavio Leitner 
---
 python/ovs/_json.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/python/ovs/_json.c b/python/ovs/_json.c
index 7067ce26a..8b8402025 100644
--- a/python/ovs/_json.c
+++ b/python/ovs/_json.c
@@ -106,7 +106,7 @@ json_to_python(struct json *json)
 if (dict == NULL) {
 return PyErr_NoMemory();
 }
-SHASH_FOR_EACH(node, json->u.object) {
+SHASH_FOR_EACH (node, json->object) {
 PyObject *key = PyUnicode_FromString(node->name);
 PyObject *val = json_to_python(node->data);
 
@@ -124,13 +124,13 @@ json_to_python(struct json *json)
 }
 case JSON_ARRAY:{
 int i;
-PyObject *arr = PyList_New(json->u.array.n);
+PyObject *arr = PyList_New(json->array.n);
 
 if (arr == NULL) {
 return PyErr_NoMemory();
 }
-for (i = 0; i < json->u.array.n; i++) {
-PyObject *item = json_to_python(json->u.array.elems[i]);
+for (i = 0; i < json->array.n; i++) {
+PyObject *item = json_to_python(json->array.elems[i]);
 
 if (!item || PyList_SetItem(arr, i, item)) {
 Py_XDECREF(arr);
@@ -140,18 +140,18 @@ json_to_python(struct json *json)
 return arr;
 }
 case JSON_REAL:
-if (json->u.real != 0) {
-return PyFloat_FromDouble(json->u.real);
+if (json->real != 0) {
+return PyFloat_FromDouble(json->real);
 } /* fall through to treat 0 as int */
 case JSON_INTEGER:
 #ifdef IS_PY3K
-return PyLong_FromLong((long) json->u.integer);
+return PyLong_FromLong((long) json->integer);
 #else
-return PyInt_FromLong((long) json->u.integer);
+return PyInt_FromLong((long) json->integer);
 #endif
 
 case JSON_STRING:
-return PyUnicode_FromString(json->u.string);
+return PyUnicode_FromString(json->string);
 default:
 return NULL;
 }
-- 
2.14.4


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev