Python plugin: fix compiler warning
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 14 Aug 2016 17:51:34 +0000 (19:51 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 14 Aug 2016 17:51:34 +0000 (19:51 +0200)
python.c:397:25: warning: comparison of integers of different signs:
'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
                        for (size_t i = 0; i < num; ++i) {
                                           ~ ^ ~~~

src/python.c

index 884bb05..05a44aa 100644 (file)
@@ -389,12 +389,11 @@ static int cpy_write_callback(const data_set_t *ds, const value_list_t *value_li
                }
                dict = PyDict_New();  /* New reference. */
                if (value_list->meta) {
-                       int num;
                        char **table;
                        meta_data_t *meta = value_list->meta;
 
-                       num = meta_data_toc(meta, &table);
-                       for (size_t i = 0; i < num; ++i) {
+                       int num = meta_data_toc(meta, &table);
+                       for (int i = 0; i < num; ++i) {
                                int type;
                                char *string;
                                int64_t si;