< prev index next >

src/java.desktop/unix/native/common/awt/CUPSfuncs.c

Print this page

        

@@ -369,21 +369,21 @@
 {
     ppd_file_t *ppd;
     ppd_option_t *option;
     ppd_choice_t *choice;
     ppd_size_t *size;
+    const char *filename = NULL;
+    int i;
+    jobjectArray sizeArray = NULL;
+    jfloat *dims;
 
     const char *name = (*env)->GetStringUTFChars(env, printer, NULL);
     if (name == NULL) {
         (*env)->ExceptionClear(env);
         JNU_ThrowOutOfMemoryError(env, "Could not create printer name");
         return NULL;
     }
-    const char *filename;
-    int i;
-    jobjectArray sizeArray = NULL;
-    jfloat *dims;
 
     // NOTE: cupsGetPPD returns a pointer to a filename of a temporary file.
     // unlink() must be called to remove the file after using it.
     filename = j2d_cupsGetPPD(name);
     (*env)->ReleaseStringUTFChars(env, printer, name);

@@ -468,10 +468,12 @@
     int defx = 0, defy = 0;
     int resx = 0, resy = 0;
     jclass intCls, cls;
     jmethodID intCtr, arrListAddMID;
     int i;
+    const char *name = NULL;
+    const char *filename = NULL;
 
     intCls = (*env)->FindClass(env, "java/lang/Integer");
     CHECK_NULL(intCls);
     intCtr = (*env)->GetMethodID(env, intCls, "<init>", "(I)V");
     CHECK_NULL(intCtr);

@@ -479,17 +481,17 @@
     CHECK_NULL(cls);
     arrListAddMID =
         (*env)->GetMethodID(env, cls, "add", "(Ljava/lang/Object;)Z");
     CHECK_NULL(arrListAddMID);
 
-    const char *name = (*env)->GetStringUTFChars(env, printer, NULL);
+    name = (*env)->GetStringUTFChars(env, printer, NULL);
     if (name == NULL) {
         (*env)->ExceptionClear(env);
         JNU_ThrowOutOfMemoryError(env, "Could not create printer name");
         return;
     }
-    const char *filename;
+    
 
     // NOTE: cupsGetPPD returns a pointer to a filename of a temporary file.
     // unlink() must be called to remove the file after using it.
     filename = j2d_cupsGetPPD(name);
     (*env)->ReleaseStringUTFChars(env, printer, name);
< prev index next >