[Forensics-changes] [yara] 245/415: Fix multiple warnings
Hilko Bengen
bengen at moszumanska.debian.org
Thu Apr 3 05:43:10 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 97fc885ac6119c5a0c3e3af9969efe99aad346e0
Author: Victor M. Alvarez <plusvic at gmail.com>
Date: Sun Nov 24 22:12:17 2013 +0100
Fix multiple warnings
---
libyara/ahocorasick.c | 2 +-
libyara/atoms.c | 4 ++--
libyara/exec.c | 6 ++++--
libyara/parser.c | 2 +-
libyara/re.h | 3 ++-
libyara/yara.h | 4 ++--
yara.c | 11 ++++++-----
yarac.c | 4 ++--
8 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/libyara/ahocorasick.c b/libyara/ahocorasick.c
index 5a1ccae..b8bf33c 100644
--- a/libyara/ahocorasick.c
+++ b/libyara/ahocorasick.c
@@ -636,7 +636,7 @@ void _yr_ac_print_automaton_state(
for (i = 0; i < state->depth + 1; i++)
printf(" ");
- printf("%s = ", match->string->identifier, match->backtrack);
+ printf("%s = ", match->string->identifier);
if (STRING_IS_HEX(match->string))
{
diff --git a/libyara/atoms.c b/libyara/atoms.c
index 15294dc..a0b9f74 100644
--- a/libyara/atoms.c
+++ b/libyara/atoms.c
@@ -421,8 +421,8 @@ uint8_t* _yr_atoms_case_combinations(
int atom_offset,
uint8_t* output_buffer)
{
- char c;
- char* new_atom;
+ uint8_t c;
+ uint8_t* new_atom;
if (atom_offset + 1 < atom_length)
output_buffer = _yr_atoms_case_combinations(
diff --git a/libyara/exec.c b/libyara/exec.c
index 7b805be..84cdc26 100644
--- a/libyara/exec.c
+++ b/libyara/exec.c
@@ -25,8 +25,10 @@ limitations under the License.
#define push(x) \
- if (sp < STACK_SIZE) stack[sp++] = (x); \
- else return ERROR_EXEC_STACK_OVERFLOW
+ do { \
+ if (sp < STACK_SIZE) stack[sp++] = (x); \
+ else return ERROR_EXEC_STACK_OVERFLOW; \
+ } while(0)
#define pop(x) x = stack[--sp]
diff --git a/libyara/parser.c b/libyara/parser.c
index c9076b1..54dbbf4 100644
--- a/libyara/parser.c
+++ b/libyara/parser.c
@@ -323,7 +323,7 @@ YR_STRING* yr_parser_reduce_string_declaration(
else
{
string->g_flags |= STRING_GFLAGS_LITERAL;
- literal_string = str->c_string;
+ literal_string = (uint8_t*) str->c_string;
literal_string_len = str->length;
compiler->last_result = yr_atoms_extract_from_string(
diff --git a/libyara/re.h b/libyara/re.h
index 5e68a90..d1711db 100644
--- a/libyara/re.h
+++ b/libyara/re.h
@@ -112,7 +112,8 @@ struct RE {
const char* error_message;
int error_code;
- int8_t* literal_string;
+ uint8_t* literal_string;
+
int literal_string_len;
int literal_string_max;
};
diff --git a/libyara/yara.h b/libyara/yara.h
index edeffd2..2acb72e 100644
--- a/libyara/yara.h
+++ b/libyara/yara.h
@@ -444,7 +444,7 @@ typedef struct _YARA_RULES_FILE_HEADER
DECLARE_REFERENCE(YR_RULE*, rules_list_head);
DECLARE_REFERENCE(YR_EXTERNAL_VARIABLE*, externals_list_head);
- DECLARE_REFERENCE(int8_t*, code_start);
+ DECLARE_REFERENCE(uint8_t*, code_start);
DECLARE_REFERENCE(YR_AC_AUTOMATON*, automaton);
} YARA_RULES_FILE_HEADER;
@@ -569,7 +569,7 @@ typedef struct _YR_MEMORY_BLOCK
typedef struct _YR_RULES {
int threads_count;
- int8_t* code_start;
+ uint8_t* code_start;
mutex_t mutex;
YR_ARENA* arena;
diff --git a/yara.c b/yara.c
index b370171..53faf20 100644
--- a/yara.c
+++ b/yara.c
@@ -34,6 +34,7 @@ limitations under the License.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include <yara.h>
#include "threading.h"
@@ -685,7 +686,7 @@ int process_cmd_line(
switch (c)
{
case 'v':
- printf("%s (rev:%s)\n", PACKAGE_STRING, REVISION);
+ printf("%s\n", PACKAGE_STRING);
return 0;
case 'r':
@@ -724,7 +725,7 @@ int process_cmd_line(
}
else
{
- fprintf (stderr, "Not enough memory.\n", optopt);
+ fprintf(stderr, "Not enough memory.\n");
return 0;
}
break;
@@ -741,7 +742,7 @@ int process_cmd_line(
}
else
{
- fprintf (stderr, "Not enough memory.\n", optopt);
+ fprintf(stderr, "Not enough memory.\n");
return 0;
}
break;
@@ -758,7 +759,7 @@ int process_cmd_line(
}
else
{
- fprintf (stderr, "Not enough memory.\n", optopt);
+ fprintf(stderr, "Not enough memory.\n");
return 0;
}
@@ -858,7 +859,7 @@ int main(
result == ERROR_CORRUPT_FILE)
{
print_scanning_error(result);
- return;
+ return 0;
}
if (result == ERROR_SUCCESS)
diff --git a/yarac.c b/yarac.c
index 28a67be..0fbbfb3 100644
--- a/yarac.c
+++ b/yarac.c
@@ -31,10 +31,10 @@ limitations under the License.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include <yara.h>
#include "config.h"
-#include "REVISION"
#ifndef MAX_PATH
#define MAX_PATH 255
@@ -79,7 +79,7 @@ int process_cmd_line(
switch (c)
{
case 'v':
- printf("%s (rev:%s)\n", PACKAGE_STRING, REVISION);
+ printf("%s\n", PACKAGE_STRING);
return 0;
case 'd':
--
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