[Forensics-changes] [yara] 31/415: Fix warnings when compiling in 64 bits

Hilko Bengen bengen at moszumanska.debian.org
Thu Apr 3 05:42:40 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository yara.

commit 3e2a5b81358bbb2474b662b68367026861c32960
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Tue Sep 15 20:36:07 2009 +0000

    Fix warnings when compiling in 64 bits
---
 ChangeLog    |  2 ++
 libyara/pe.h | 11 +++--------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 695bdcc..909ec6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,3 +35,5 @@ version 1.2.1 (14/04/2009)
 	* BUGFIX: Memory leak
 	* BUGFIX: Access violation on xxcompare functions
 	
+version 1.2.2 
+	
diff --git a/libyara/pe.h b/libyara/pe.h
index e53d836..8e49784 100644
--- a/libyara/pe.h
+++ b/libyara/pe.h
@@ -1,20 +1,15 @@
 
 #include <stdint.h>
+#include <stdlib.h>
 
 typedef uint8_t 	BYTE;
 typedef uint16_t	WORD;
 typedef uint32_t	DWORD;
 typedef	int32_t		LONG;
 typedef uint32_t	ULONG;
-typedef LONG		LONG_PTR;
-typedef ULONG		ULONG_PTR;
 
-//
-// TYPE_ALIGNMENT will return the alignment requirements of a given type for
-// the current platform.
-//
 
-#define FIELD_OFFSET(type, field)    ((LONG)(LONG_PTR)&(((type *)0)->field))
+#define FIELD_OFFSET(type, field)    ((size_t)&(((type *)0)->field))
 
 #ifndef _MAC
 
@@ -181,7 +176,7 @@ typedef struct _IMAGE_NT_HEADERS {
 // IMAGE_FIRST_SECTION doesn't need 32/64 versions since the file header is the same either way.
 
 #define IMAGE_FIRST_SECTION( ntheader ) ((PIMAGE_SECTION_HEADER)        \
-    ((ULONG_PTR)ntheader +                                              \
+    ((BYTE*)ntheader +                                              \
      FIELD_OFFSET( IMAGE_NT_HEADERS, OptionalHeader ) +                 \
      ((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader   \
     ))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list