[Forensics-changes] [yara] 237/407: Fix warnings
Hilko Bengen
bengen at moszumanska.debian.org
Sat Jul 1 10:28:30 UTC 2017
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag v3.3.0
in repository yara.
commit d23f8840b10a0f4c05249430ea79ba67c7c83626
Author: Victor Manuel Alvarez <vmalvarez at virustotal.com>
Date: Mon Dec 1 12:34:29 2014 +0100
Fix warnings
---
libyara/include/yara/exec.h | 2 +-
libyara/include/yara/modules.h | 15 +++++++++++----
libyara/mem.c | 2 ++
libyara/proc.c | 2 ++
4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/libyara/include/yara/exec.h b/libyara/include/yara/exec.h
index 0dbce42..4c8ebac 100644
--- a/libyara/include/yara/exec.h
+++ b/libyara/include/yara/exec.h
@@ -24,7 +24,7 @@ limitations under the License.
#define UNDEFINED 0xFFFABADAFABADAFFLL
-#define IS_UNDEFINED(x) ((uint64_t)(x) == UNDEFINED)
+#define IS_UNDEFINED(x) ((size_t)(uint64_t)(x) == (size_t) UNDEFINED)
#define OP_HALT 255
diff --git a/libyara/include/yara/modules.h b/libyara/include/yara/modules.h
index e25539d..cc55740 100644
--- a/libyara/include/yara/modules.h
+++ b/libyara/include/yara/modules.h
@@ -218,10 +218,17 @@ limitations under the License.
YR_OBJECT_FUNCTION* __function_obj)
-#define sized_string_argument(n) ((SIZED_STRING*)((int64_t*) __args)[n-1])
-#define string_argument(n) (sized_string_argument(n)->c_string)
-#define integer_argument(n) (((int64_t*) __args)[n-1])
-#define regexp_argument(n) ((RE_CODE)((int64_t*) __args)[n-1])
+#define sized_string_argument(n) \
+ ((SIZED_STRING*)(size_t)((int64_t*) __args)[n-1])
+
+#define string_argument(n) \
+ (sized_string_argument(n)->c_string)
+
+#define integer_argument(n) \
+ (((int64_t*) __args)[n-1])
+
+#define regexp_argument(n) \
+ ((RE_CODE)((int64_t*) __args)[n-1])
#define module() yr_object_get_root((YR_OBJECT*) __function_obj)
diff --git a/libyara/mem.c b/libyara/mem.c
index 5a71cd5..fa52024 100644
--- a/libyara/mem.c
+++ b/libyara/mem.c
@@ -100,6 +100,8 @@ char* yr_strndup(const char *str, size_t n)
#else
+#define _GNU_SOURCE
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
diff --git a/libyara/proc.c b/libyara/proc.c
index 318fec5..ee13bef 100644
--- a/libyara/proc.c
+++ b/libyara/proc.c
@@ -140,6 +140,8 @@ int yr_process_get_memory(
#else
+#define _XOPEN_SOURCE 500
+
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
--
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