[Pkg-libvirt-commits] [libguestfs] 38/54: java: Split long lines in generated output, and add other whitespace.

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 9 11:21:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository libguestfs.

commit 026c6b5caa15692d30faa62638e59876941cb907
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Mar 7 14:01:28 2014 +0000

    java: Split long lines in generated output, and add other whitespace.
    
    No functional change.
    
    (cherry picked from commit 8c219636a272c4288f22392ff27b9c04580aecb4)
---
 generator/java.ml | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/generator/java.ml b/generator/java.ml
index db08956..9f68eb1 100644
--- a/generator/java.ml
+++ b/generator/java.ml
@@ -1160,20 +1160,24 @@ and generate_java_struct_return typ jtyp cols =
 and generate_java_struct_list_return typ jtyp cols =
   pr "  cl = (*env)->FindClass (env, \"com/redhat/et/libguestfs/%s\");\n" jtyp;
   pr "  jr = (*env)->NewObjectArray (env, r->len, cl, NULL);\n";
+  pr "\n";
   pr "  for (i = 0; i < r->len; ++i) {\n";
   pr "    jfl = (*env)->AllocObject (env, cl);\n";
+  pr "\n";
   List.iter (
     function
     | name, FString ->
         pr "    fl = (*env)->GetFieldID (env, cl, \"%s\", \"Ljava/lang/String;\");\n" name;
-        pr "    (*env)->SetObjectField (env, jfl, fl, (*env)->NewStringUTF (env, r->val[i].%s));\n" name;
+        pr "    (*env)->SetObjectField (env, jfl, fl,\n";
+        pr "                            (*env)->NewStringUTF (env, r->val[i].%s));\n" name;
     | name, FUUID ->
         pr "    {\n";
         pr "      char s[33];\n";
         pr "      memcpy (s, r->val[i].%s, 32);\n" name;
         pr "      s[32] = 0;\n";
         pr "      fl = (*env)->GetFieldID (env, cl, \"%s\", \"Ljava/lang/String;\");\n" name;
-        pr "      (*env)->SetObjectField (env, jfl, fl, (*env)->NewStringUTF (env, s));\n";
+        pr "      (*env)->SetObjectField (env, jfl, fl,\n";
+        pr "                              (*env)->NewStringUTF (env, s));\n";
         pr "    }\n";
     | name, FBuffer ->
         pr "    {\n";
@@ -1182,7 +1186,8 @@ and generate_java_struct_list_return typ jtyp cols =
         pr "      memcpy (s, r->val[i].%s, len);\n" name;
         pr "      s[len] = 0;\n";
         pr "      fl = (*env)->GetFieldID (env, cl, \"%s\", \"Ljava/lang/String;\");\n" name;
-        pr "      (*env)->SetObjectField (env, jfl, fl, (*env)->NewStringUTF (env, s));\n";
+        pr "      (*env)->SetObjectField (env, jfl, fl,\n";
+        pr "                              (*env)->NewStringUTF (env, s));\n";
         pr "    }\n";
     | name, (FBytes|FUInt64|FInt64) ->
         pr "    fl = (*env)->GetFieldID (env, cl, \"%s\", \"J\");\n" name;
@@ -1197,8 +1202,10 @@ and generate_java_struct_list_return typ jtyp cols =
         pr "    fl = (*env)->GetFieldID (env, cl, \"%s\", \"C\");\n" name;
         pr "    (*env)->SetLongField (env, jfl, fl, r->val[i].%s);\n" name;
   ) cols;
+  pr "\n";
   pr "    (*env)->SetObjectArrayElement (env, jr, i, jfl);\n";
   pr "  }\n";
+  pr "\n";
   pr "  guestfs_free_%s_list (r);\n" typ;
   pr "  return jr;\n"
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list