[poppler] poppler/poppler: Error.h, 1.3, 1.4 GlobalParams.cc, 1.2, 1.3 PSOutputDev.cc, 1.2, 1.3 PSOutputDev.h, 1.2, 1.3 TextOutputDev.cc, 1.5, 1.6 poppler-config.h.in, 1.1.1.1, 1.2

Kristian Hogsberg krh at freedesktop.org
Thu Jul 28 16:32:00 EST 2005


Update of /cvs/poppler/poppler/poppler
In directory gabe:/tmp/cvs-serv9738/poppler

Modified Files:
	Error.h GlobalParams.cc PSOutputDev.cc PSOutputDev.h 
	TextOutputDev.cc poppler-config.h.in 
Log Message:
2005-07-28  Kristian Høgsberg  <krh at redhat.com>

        * poppler/poppler-config.h.in: Add GCC_PRINTF_FORMAT macro to
        annotate printf-like functions (#3638).

        * poppler/Error.h: Add GCC_PRINTF_FORMAT to error().

        * poppler/PSOutputDev.h: Add GCC_PRINTF_FORMAT to
        PSOutputDev::writePSFmt().

        * poppler/PSOutputDev.cc, poppler/GlobalParams.cc: Quiet new
        printf warnings.



Index: Error.h
===================================================================
RCS file: /cvs/poppler/poppler/poppler/Error.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Error.h	26 Jun 2005 00:01:39 -0000	1.3
+++ Error.h	28 Jul 2005 06:31:57 -0000	1.4
@@ -16,7 +16,7 @@
 #include <stdarg.h>
 #include "poppler-config.h"
 
-extern void CDECL error(int pos, char *msg, ...);
+extern void CDECL error(int pos, char *msg, ...) GCC_PRINTF_FORMAT (2, 3);
 
 void setErrorFunction(void (* f)(int , char *, va_list args));
 

Index: GlobalParams.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/GlobalParams.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- GlobalParams.cc	28 Apr 2005 23:03:06 -0000	1.2
+++ GlobalParams.cc	28 Jul 2005 06:31:57 -0000	1.3
@@ -530,7 +530,8 @@
       sscanf(tok1, "%x", &u);
       nameToUnicode->add(tok2, u);
     } else {
-      error(-1, "Bad line in 'nameToUnicode' file (%s:%d)", name, line2);
+      error(-1, "Bad line in 'nameToUnicode' file (%s:%d)",
+	    name->getCString(), line2);
     }
     ++line2;
   }

Index: PSOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/PSOutputDev.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- PSOutputDev.cc	27 Jul 2005 19:21:08 -0000	1.2
+++ PSOutputDev.cc	28 Jul 2005 06:31:57 -0000	1.3
@@ -2909,8 +2909,7 @@
 	if (i > 0) {
 	  writePS(" ");
 	}
-	writePSFmt("0 1", colorMap->getDecodeLow(i),
-		   colorMap->getDecodeHigh(i));
+	writePSFmt("0 1");
       }
     } else {
       numComps = colorMap->getNumPixelComps();

Index: PSOutputDev.h
===================================================================
RCS file: /cvs/poppler/poppler/poppler/PSOutputDev.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- PSOutputDev.h	27 Jul 2005 19:21:08 -0000	1.2
+++ PSOutputDev.h	28 Jul 2005 06:31:57 -0000	1.3
@@ -237,7 +237,7 @@
 #endif
   void writePSChar(char c);
   void writePS(char *s);
-  void writePSFmt(const char *fmt, ...);
+  void writePSFmt(const char *fmt, ...) GCC_PRINTF_FORMAT(2, 3);
   void writePSString(GooString *s);
   void writePSName(char *s);
   GooString *filterPSName(GooString *name);

Index: TextOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/TextOutputDev.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- TextOutputDev.cc	28 Jul 2005 05:52:43 -0000	1.5
+++ TextOutputDev.cc	28 Jul 2005 06:31:57 -0000	1.6
@@ -3243,7 +3243,8 @@
 }
 
 void TextWord::visitSelection(TextSelectionVisitor *visitor,
-			      PDFRectangle *selection) {
+			      PDFRectangle *selection)
+{
   int i, begin, end;
   double mid;
 
@@ -3303,6 +3304,11 @@
 
   begin = NULL;
   end = NULL;
+  start_x = selection->x1;
+  start_y = selection->y1;
+  stop_x = selection->x2;
+  stop_y = selection->y2;
+  
   for (p = lines; p != NULL; p = p->next) {
     if (selection->x1 < p->xMax && selection->y1 < p->yMax && 
 	selection->x2 < p->xMax && selection->y2 < p->yMax && begin == NULL) {
@@ -3369,6 +3375,11 @@
 
   begin = nBlocks;
   end = 0;
+  start_x = selection->x1;
+  start_y = selection->y1;
+  stop_x = selection->x2;
+  stop_y = selection->y2;
+
   for (i = 0; i < nBlocks; i++) {
     b = blocks[i];
 

Index: poppler-config.h.in
===================================================================
RCS file: /cvs/poppler/poppler/poppler/poppler-config.h.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- poppler-config.h.in	3 Mar 2005 19:46:01 -0000	1.1.1.1
+++ poppler-config.h.in	28 Jul 2005 06:31:57 -0000	1.2
@@ -142,4 +142,16 @@
 #define CDECL
 #endif
 
+//------------------------------------------------------------------------
+// Compiler
+//------------------------------------------------------------------------
+
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#define GCC_PRINTF_FORMAT(fmt_index, va_index) \
+	__attribute__((__format__(__printf__, fmt_index, va_index)))
+#else
+#define GCC_PRINTF_FORMAT (fmt_index, va_index)
+#endif
+
+
 #endif /* POPPLER_CONFIG_H */



More information about the poppler mailing list