Commit 161285f96eacbbe34d7de14eb49f9989e072df63

Thomas de Grivel 2024-07-03T19:58:19

move var declaration to top

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/libc3/data.c b/libc3/data.c
index c237816..358588a 100644
--- a/libc3/data.c
+++ b/libc3/data.c
@@ -14,6 +14,7 @@
 
 sw data_buf_inspect (const s_sym *type, s_buf *buf, const void *data)
 {
+  s_struct s = {0};
   const s_struct_type *st;
   if (type == &g_sym_Array ||
       sym_is_array_type(type))
@@ -85,7 +86,6 @@ sw data_buf_inspect (const s_sym *type, s_buf *buf, const void *data)
   if (! struct_type_find(type, &st))
     return -1;
   if (st) {
-    s_struct s = {0};
     s.type = st;
     s.data = (void *) data;
     return buf_inspect_struct(buf, &s);