[Pcre-svn] [357] code/trunk: Added two (int) casts to pcregr…

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [357] code/trunk: Added two (int) casts to pcregrep.
Revision: 357
          http://vcs.pcre.org/viewvc?view=rev&revision=357
Author:   ph10
Date:     2008-07-08 15:18:28 +0100 (Tue, 08 Jul 2008)


Log Message:
-----------
Added two (int) casts to pcregrep.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcregrep.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2008-07-08 14:14:34 UTC (rev 356)
+++ code/trunk/ChangeLog    2008-07-08 14:18:28 UTC (rev 357)
@@ -29,7 +29,10 @@


6. Minor bugfix in pcrecpp.cc (change "" == ... to NULL == ...).

+7.  Added two (int) casts to pcregrep when printing the difference of two
+    pointers, in case they are 64-bit values.


+
Version 7.7 07-May-08
---------------------


Modified: code/trunk/pcregrep.c
===================================================================
--- code/trunk/pcregrep.c    2008-07-08 14:14:34 UTC (rev 356)
+++ code/trunk/pcregrep.c    2008-07-08 14:18:28 UTC (rev 357)
@@ -1054,10 +1054,10 @@
         if (printname != NULL) fprintf(stdout, "%s:", printname);
         if (number) fprintf(stdout, "%d:", linenumber);
         if (line_offsets)
-          fprintf(stdout, "%d,%d", matchptr + offsets[0] - ptr,
+          fprintf(stdout, "%d,%d", (int)(matchptr + offsets[0] - ptr),
             offsets[1] - offsets[0]);
         else if (file_offsets)
-          fprintf(stdout, "%d,%d", filepos + matchptr + offsets[0] - ptr,
+          fprintf(stdout, "%d,%d", (int)(filepos + matchptr + offsets[0] - ptr),
             offsets[1] - offsets[0]);
         else
           fwrite(matchptr + offsets[0], 1, offsets[1] - offsets[0], stdout);