Ethereal-dev: Re: [Ethereal-dev] Patch: Add wiretap support for Endace ERF files(updated)

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Jesper Peterson <jesper@xxxxxxxxxx>
Date: Wed, 27 Aug 2003 10:04:57 +1200

It might help if I had actually attached the patch. Here it is.

Jesper Peterson wrote:
Graham Bloice wrote:

erf.c doesn't compile on Win32 with VC 6.0  It doesn't like the 0xULL
constants on lines 305 & 306


I don't have VC6 to test against, so does the attached patch help? It casts to guint64 rather than using long long constants.

Thanks.




--
Jesper Peterson, Senior Software Developer
http://www.endace.com, +64 7 839 0540

Index: erf.c
===================================================================
RCS file: /cvsroot/ethereal/wiretap/erf.c,v
retrieving revision 1.1
diff -u -r1.1 erf.c
--- erf.c	26 Aug 2003 07:10:38 -0000	1.1
+++ erf.c	26 Aug 2003 22:00:33 -0000
@@ -302,8 +302,8 @@
 		guint64 ts = pletohll(&erf_header->ts);
 
 		phdr->ts.tv_sec = ts >> 32;
-		ts = ((ts &  0xffffffffULL) * 1000 * 1000);
-		ts += (ts & 0x80000000ULL) << 1; /* rounding */
+		ts = ((ts &  (guint64)0xffffffff) * 1000 * 1000);
+		ts += (ts & (guint64)0x80000000) << 1; /* rounding */
 		phdr->ts.tv_usec = ts >> 32;		
 		if (phdr->ts.tv_usec >= 1000000) {
 			phdr->ts.tv_usec -= 1000000;