XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 11, 15
    • hotspot

      There were remaining assignments that were tricker to get to, now I've updated my script:

      {
              macros[1] = "NSK_VERIFY"
              macros[2] = "NSK_JNI_VERIFY"
              macros[3] = "NSK_JVMTI_VERIFY"

              indentation = gensub(/([ ]*).*/, "\\1" , "g", $0)
              #print "Indent: " indentation "-"

              pattern = ".*NULL)(.*)"
              suffix = gensub(pattern, "\\1" , "g", $0)

              comparator = gensub(/.* (..) NULL.*/, "\\1", "g", $0)

              for (m in macros) {
                      macro = macros[m]

                      pattern = macro "((.* = .* .. NULL))"
                      if ($0 ~ pattern) {
                              pattern = "(.*" macro "\\().*"
                              prefix = gensub(pattern, "\\1", "g", $0)

                              #print "Prefix: " prefix

                              pattern = ".*" macro "\\([^\\(]*\\((.*)\\) .. NULL)).*"
                              assignment = gensub(pattern, "\\1" , "g", $0)

                              #print "Assignment: " assignment

                              dest = gensub(/(.*) =.*/, "\\1" , "g", assignment)

                              print indentation assignment ";"
                              print prefix dest " " comparator " NULL)" suffix
                              next
                      }
              }

              if ($0 ~ "((.* = .* .. NULL))") {
                      assignment = gensub(/.*\(\((.*)) .. NULL).*/, "\\1" , "g", $0)
                      prefix = gensub(/(.*if \().*/, "\\1", "g", $0)

                      dest = gensub(/(.*) =.*/, "\\1" , "g", assignment)

                      print indentation assignment ";"
                      print prefix dest " " comparator " NULL)" suffix
                      next
              }

              # No macro...
              print $0
      }

            Unassigned Unassigned
            jcbeyler Jean Christophe Beyler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: