shithub: jbig2

Download patch

ref: c4921544fb9e703930007eab90e458dbf052c6ec
parent: 6bb88b8d16a0bd10387e06adbcf914a44cb766c6
author: Tor Andersson <tor.andersson@artifex.com>
date: Thu Mar 29 08:59:58 EDT 2018

Fix undeclared function warning.

--- a/jbig2_image_png.c
+++ b/jbig2_image_png.c
@@ -76,23 +76,6 @@
         fflush(f);
 }
 
-int
-jbig2_image_write_png_file(Jbig2Image *image, char *filename)
-{
-    FILE *out;
-    int error;
-
-    if ((out = fopen(filename, "wb")) == NULL) {
-        fprintf(stderr, "unable to open '%s' for writing\n", filename);
-        return 1;
-    }
-
-    error = jbig2_image_write_png(image, out);
-
-    fclose(out);
-    return (error);
-}
-
 /* write out an image struct in png format to an open file pointer */
 
 int
@@ -149,4 +132,21 @@
     png_destroy_write_struct(&png, &info);
 
     return 0;
+}
+
+int
+jbig2_image_write_png_file(Jbig2Image *image, char *filename)
+{
+    FILE *out;
+    int error;
+
+    if ((out = fopen(filename, "wb")) == NULL) {
+        fprintf(stderr, "unable to open '%s' for writing\n", filename);
+        return 1;
+    }
+
+    error = jbig2_image_write_png(image, out);
+
+    fclose(out);
+    return (error);
 }