]> granicus.if.org Git - strace/commitdiff
mpers.awk: prepare for adding support of multidimensional arrays
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 4 Apr 2017 01:39:56 +0000 (01:39 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 4 Apr 2017 02:42:26 +0000 (02:42 +0000)
* mpers.awk (what_is) <case "structure_type", case "union_type">:
Move formatting of array upper_bound ...
<case "array_type">: ... here.

mpers.awk

index 2283b966ef0c93e9f7c2dc5db4f52c5c50ac447f..b9805421496ed8fe2a37fe267c371c0136db6daa 100644 (file)
--- a/mpers.awk
+++ b/mpers.awk
@@ -104,7 +104,7 @@ function what_is(what_idx, type_idx, special, item, \
                if ("" == to_return)
                        to_return = 0
                returned_size = to_return * returned_size
-               return leave(what_idx, to_return)
+               return leave(what_idx, "[" to_return "]")
                break
        case "structure_type":
                print "struct {"
@@ -125,11 +125,7 @@ function what_is(what_idx, type_idx, special, item, \
                                prev_location = location
                                returned = what_is(item)
                                prev_returned_size = returned_size
-                               printf("%s", array[item]["name"])
-                               if ("" != returned) {
-                                       printf("[%s]", returned)
-                               }
-                               print ";"
+                               printf("%s%s;\n", array[item]["name"], returned)
                        }
                }
                returned_size = array_get(what_idx, "byte_size")
@@ -146,11 +142,7 @@ function what_is(what_idx, type_idx, special, item, \
                        if ("parent" in array[item] && \
                                array_get(item, "parent") == what_idx) {
                                returned = what_is(item)
-                               printf("%s", array[item]["name"])
-                               if ("" != returned) {
-                                       printf("[%s]", returned)
-                               }
-                               print ";"
+                               printf("%s%s;\n", array[item]["name"], returned)
                        }
                }
                printf("} ")