Description: Fix implicit declarations
Author: Mathieu Malaterre <malat@debian.org>
Forwarded: not-needed

Index: pvrg-jpeg-1.2.1+dfsg1/io.c
===================================================================
--- pvrg-jpeg-1.2.1+dfsg1.orig/io.c	2013-10-08 16:36:24.000000000 +0200
+++ pvrg-jpeg-1.2.1+dfsg1/io.c	2013-10-08 16:36:26.000000000 +0200
@@ -39,6 +39,8 @@
 #include <sys/stat.h>
 
 #include <errno.h>
+#include <stdlib.h>
+#include <string.h>
 
 /* Functions which are local and which are exported. */
 
@@ -267,13 +269,13 @@
 
   if (Iob)
     {
-      printf("*** Iob ID: %x ***\n",Iob);
+      printf("*** Iob ID: %p ***\n",(void*)Iob);
       printf("Number of Buffers: %d  Width: %d  Height: %d\n",
 	     Iob->num,Iob->width,Iob->height);
       printf("hpos: %d  vpos: %d  hor-freq: %d  ver-freq: %d\n",
 	     Iob->hpos,Iob->vpos,Iob->hor,Iob->ver);
-      printf("filed: %d  flags: %d  BufferListId: %x\n",
-	     Iob->file,Iob->flags,Iob->blist);
+      printf("filed: %d  flags: %d  BufferListId: %p\n",
+	     Iob->file,Iob->flags,(void*)Iob->blist);
     }
   else
     {
@@ -640,8 +642,8 @@
   if (Loud > MUTE)
     {
       WHEREAMI();
-      printf("%x  Moving To [Horizontal:Vertical] [%d:%d] \n",
-	     Iob,Iob->hpos,Iob->vpos);
+      printf("%p  Moving To [Horizontal:Vertical] [%d:%d] \n",
+	     (void*)Iob,Iob->hpos,Iob->vpos);
     }
   horizontal =  Iob->hpos * BlockWidth;    /* Calculate actual */
   vertical = Iob->vpos * BlockHeight;      /* Pixel position */
@@ -733,7 +735,7 @@
   int i;
 
   if (Loud > MUTE)
-    printf("IOB: %x  Flushing buffers\n",Iob);
+    printf("IOB: %p  Flushing buffers\n",(void*)Iob);
   switch(Iob->type)
     {
     case IOB_BLOCK:
@@ -1132,8 +1134,8 @@
   if (Loud > MUTE)
     {
       WHEREAMI();
-      printf("%x  Moving To [Horizontal:Vertical] [%d:%d] \n",
-	     Iob,Iob->hpos,Iob->vpos);
+      printf("%p  Moving To [Horizontal:Vertical] [%d:%d] \n",
+	     (void*)Iob,Iob->hpos,Iob->vpos);
     }
   horizontal =  Iob->hpos;
   vertical = Iob->vpos;
@@ -1198,7 +1200,7 @@
   rsize = read(Iob->file, timage, tsize);
   if(rsize != tsize) {
     WHEREAMI();
-    printf("Read failure in InstallHeaderIob (r %d != t %d, fd %d)\n", rsize, tsize, Iob->file);
+    printf("Read failure in InstallHeaderIob (r %zu != t %zu, fd %d)\n", rsize, tsize, Iob->file);
     perror("Error:");
     exit(1); 
   }
Index: pvrg-jpeg-1.2.1+dfsg1/jpeg.c
===================================================================
--- pvrg-jpeg-1.2.1+dfsg1.orig/jpeg.c	2013-10-08 16:36:24.000000000 +0200
+++ pvrg-jpeg-1.2.1+dfsg1/jpeg.c	2013-10-08 16:36:26.000000000 +0200
@@ -36,6 +36,8 @@
 #ifdef SYSV
 #include <sys/fcntl.h>
 #endif
+#include <stdlib.h>
+#include <string.h>
 
 /*
   Define the functions to be used with ANSI prototyping.
@@ -102,7 +104,7 @@
 /* Define the support/utility variables.*/
 int ErrorValue=0;             /* Holds error upon return */
 int Loud=MUTE;                /* Loudness gives level of debug traces */
-int HuffmanTrace=NULL;        /* When set, dumps Huffman statistics */
+int HuffmanTrace=0;        /* When set, dumps Huffman statistics */
 int Notify=1;                 /* When set, gives image size feedback */
 int Robust=0;
 static int LargeQ=0;          /* When set, large quantization is enabled */
@@ -1742,7 +1744,7 @@
   BEGIN("PrintImage");
   int i;
 
-  printf("*** Image ID: %x ***\n",CImage);
+  printf("*** Image ID: %p ***\n",(void*)CImage);
   if (CImage)
     {
       if (CImage->StreamFileName)
@@ -1792,14 +1794,14 @@
   BEGIN("PrintFrame");
   int i;
 
-  printf("*** Frame ID: %x *** (TYPE: %d)\n",CFrame,CFrame->Type);
+  printf("*** Frame ID: %p *** (TYPE: %d)\n",(void*)CFrame,CFrame->Type);
   if (CFrame)
     {
       printf("DataPrecision: %d  ResyncInterval: %d\n",
 	     CFrame->DataPrecision,CFrame->ResyncInterval);
       printf("Height: %d   Width: %d\n",
 	     CFrame->GlobalHeight,CFrame->GlobalWidth);
-      printf("BufferSize: %d  Image: %x\n",CFrame->BufferSize,CFrame->Image);
+      printf("BufferSize: %d  Image: %p\n",CFrame->BufferSize,(void*)CFrame->Image);
       printf("NumberComponents %d\n",
 	     CFrame->GlobalNumberComponents);
       for(i=0;i<CFrame->GlobalNumberComponents;i++)
@@ -1830,7 +1832,7 @@
   BEGIN("PrintScan");
   int i;
 
-  printf("*** Scan ID: %x ***\n",CScan);
+  printf("*** Scan ID: %p ***\n",(void*)CScan);
   if (CScan)
     {
       printf("NumberComponents %d\n",
@@ -1841,8 +1843,8 @@
 		 i,CScan->ci[i]);
 	  printf("DC Huffman Table: %d  AC Huffman Table: %d\n",
 		 CScan->td[i],CScan->ta[i]);
-	  printf("LastDC: %d  Iob: %x\n",
-		 *(CScan->LastDC[i]),CScan->Iob[i]);
+	  printf("LastDC: %d  Iob: %p\n",
+		 *(CScan->LastDC[i]),(void*)CScan->Iob[i]);
 	}
       printf("NumberACSend: %d  NumberDCSend: %d  NumberQSend: %d\n",
 	     CScan->NumberACTablesSend,
Index: pvrg-jpeg-1.2.1+dfsg1/stream.c
===================================================================
--- pvrg-jpeg-1.2.1+dfsg1.orig/stream.c	2013-10-08 16:36:17.000000000 +0200
+++ pvrg-jpeg-1.2.1+dfsg1/stream.c	2013-10-08 16:36:26.000000000 +0200
@@ -32,6 +32,7 @@
 #include "globals.h"
 #include "marker.h"
 #include "stream.h"
+#include <stdlib.h>
 
 /*PUBLIC*/
 
@@ -675,7 +676,7 @@
   read_position= -1;                    /* Make sure we are byte-flush. */
   while(marker_read_byte==MARKER_FIL)   /* Get rid of FIL markers */
     {
-#ifdef VERSION_1.0
+#ifdef VERSION_1_0
       if ((marker_read_byte = bgetc())!=MARKER_MARKER)
 	{
 	  WHEREAMI();
Index: pvrg-jpeg-1.2.1+dfsg1/transform.c
===================================================================
--- pvrg-jpeg-1.2.1+dfsg1.orig/transform.c	2013-10-08 16:36:17.000000000 +0200
+++ pvrg-jpeg-1.2.1+dfsg1/transform.c	2013-10-08 16:36:26.000000000 +0200
@@ -33,6 +33,7 @@
 #include "globals.h"
 #include "dct.h"
 #include <math.h>
+#include <stdlib.h>
 
 /*PUBLIC*/
 
Index: pvrg-jpeg-1.2.1+dfsg1/marker.c
===================================================================
--- pvrg-jpeg-1.2.1+dfsg1.orig/marker.c	2013-10-08 16:36:23.000000000 +0200
+++ pvrg-jpeg-1.2.1+dfsg1/marker.c	2013-10-08 16:36:26.000000000 +0200
@@ -38,6 +38,8 @@
 #ifdef SYSV
 #include <sys/fcntl.h>
 #endif
+#include <stdlib.h>
+#include <string.h>
 
 /*PUBLIC*/
 extern void WriteSoi();
Index: pvrg-jpeg-1.2.1+dfsg1/huffman.c
===================================================================
--- pvrg-jpeg-1.2.1+dfsg1.orig/huffman.c	2013-10-08 16:36:20.000000000 +0200
+++ pvrg-jpeg-1.2.1+dfsg1/huffman.c	2013-10-08 16:36:26.000000000 +0200
@@ -33,6 +33,8 @@
 
 #include "globals.h"
 #include "stream.h"
+#include <stdlib.h>
+#include <string.h>
 
 /*PUBLIC*/
 
@@ -543,7 +545,7 @@
   else
     {
       WHEREAMI();
-      printf("Huffman read error: l=%d code=%d\n");
+      printf("Huffman read error: l=%d code=%d\n", l, code);
       Resync();
       ErrorValue = ERROR_HUFFMAN_READ;
       return(0);
@@ -773,7 +775,7 @@
 
   if (Xhuff)
     {
-      printf("Xhuff ID: %x\n",Xhuff);
+      printf("Xhuff ID: %p\n",(void*)Xhuff);
       printf("Bits: [length:number]\n");
       for(i=1;i<9;i++)
 	{
@@ -791,7 +793,7 @@
     }
   if (Ehuff)
     {
-      printf("Ehuff ID: %x\n",Ehuff);
+      printf("Ehuff ID: %p\n",(void*)Ehuff);
       printf("Ehufco:\n");
       PrintTable(Ehuff->ehufco);
       printf("Ehufsi:\n");
@@ -799,7 +801,7 @@
     }
   if (Dhuff)
     {
-      printf("Dhuff ID: %x\n",Dhuff);
+      printf("Dhuff ID: %p\n",(void*)Dhuff);
       printf("MaxLength: %d\n",Dhuff->ml);
       printf("[index:MaxCode:MinCode:ValPtr]\n");
       for(i=1;i<5;i++)
