[Forensics-changes] [yara] 82/407: Fix multiple warnings when compiling as C++

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:28:12 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 c2a36b64e55340913985c6f987f81156af068b67
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Tue Oct 7 16:31:16 2014 +0200

    Fix multiple warnings when compiling as C++
---
 libyara/grammar.c   | 4 ++--
 libyara/grammar.y   | 4 ++--
 libyara/hex_lexer.c | 4 ++--
 libyara/hex_lexer.l | 4 ++--
 libyara/re_lexer.c  | 6 +++---
 libyara/re_lexer.l  | 6 +++---
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/libyara/grammar.c b/libyara/grammar.c
index cca0f5e..598de5c 100644
--- a/libyara/grammar.c
+++ b/libyara/grammar.c
@@ -1966,7 +1966,7 @@ yyreduce:
             break;
           }
 
-          tag_name = yr_arena_next_address(
+          tag_name = (char*) yr_arena_next_address(
               yyget_extra(yyscanner)->sz_arena,
               tag_name,
               tag_length + 1);
@@ -2403,7 +2403,7 @@ yyreduce:
   case 45:
 #line 758 "grammar.y"
     {
-        (yyval.c_string) = yr_malloc(MAX_FUNCTION_ARGS + 1);
+        (yyval.c_string) = (char*) yr_malloc(MAX_FUNCTION_ARGS + 1);
 
         switch((yyvsp[(1) - (1)].expression).type)
         {
diff --git a/libyara/grammar.y b/libyara/grammar.y
index a7c8b98..f32ac6d 100644
--- a/libyara/grammar.y
+++ b/libyara/grammar.y
@@ -367,7 +367,7 @@ tag_list
             break;
           }
 
-          tag_name = yr_arena_next_address(
+          tag_name = (char*) yr_arena_next_address(
               yyget_extra(yyscanner)->sz_arena,
               tag_name,
               tag_length + 1);
@@ -756,7 +756,7 @@ arguments_list
       }
     | expression
       {
-        $$ = yr_malloc(MAX_FUNCTION_ARGS + 1);
+        $$ = (char*) yr_malloc(MAX_FUNCTION_ARGS + 1);
 
         switch($1.type)
         {
diff --git a/libyara/hex_lexer.c b/libyara/hex_lexer.c
index cf28566..151fe72 100644
--- a/libyara/hex_lexer.c
+++ b/libyara/hex_lexer.c
@@ -2092,9 +2092,9 @@ void yyfatal(
   jmp_buf* recovery_state;
 
   #ifdef _WIN32
-  recovery_state = TlsGetValue(recovery_state_key) ;
+  recovery_state = (jmp_buf*) TlsGetValue(recovery_state_key) ;
   #else
-  recovery_state = pthread_getspecific(recovery_state_key);
+  recovery_state = (jmp_buf*) pthread_getspecific(recovery_state_key);
   #endif
 
   longjmp(*recovery_state, 1);
diff --git a/libyara/hex_lexer.l b/libyara/hex_lexer.l
index 81e445e..378c9b6 100644
--- a/libyara/hex_lexer.l
+++ b/libyara/hex_lexer.l
@@ -155,9 +155,9 @@ void yyfatal(
   jmp_buf* recovery_state;
 
   #ifdef _WIN32
-  recovery_state = TlsGetValue(recovery_state_key) ;
+  recovery_state = (jmp_buf*) TlsGetValue(recovery_state_key) ;
   #else
-  recovery_state = pthread_getspecific(recovery_state_key);
+  recovery_state = (jmp_buf*) pthread_getspecific(recovery_state_key);
   #endif
 
   longjmp(*recovery_state, 1);
diff --git a/libyara/re_lexer.c b/libyara/re_lexer.c
index e36f2de..2de51e7 100644
--- a/libyara/re_lexer.c
+++ b/libyara/re_lexer.c
@@ -1043,7 +1043,7 @@ YY_RULE_SETUP
 
   int i;
 
-  yylval->class_vector = yr_malloc(32);
+  yylval->class_vector = (uint8_t*) yr_malloc(32);
   memcpy(yylval->class_vector, LEX_ENV->class_vector, 32);
 
   if (LEX_ENV->negated_class)
@@ -2452,9 +2452,9 @@ void yyfatal(
   jmp_buf* recovery_state;
 
   #ifdef _WIN32
-  recovery_state = TlsGetValue(recovery_state_key) ;
+  recovery_state = (jmp_buf*) TlsGetValue(recovery_state_key) ;
   #else
-  recovery_state = pthread_getspecific(recovery_state_key);
+  recovery_state = (jmp_buf*) pthread_getspecific(recovery_state_key);
   #endif
 
   longjmp(*recovery_state, 1);
diff --git a/libyara/re_lexer.l b/libyara/re_lexer.l
index f2fa94e..ff52d17 100644
--- a/libyara/re_lexer.l
+++ b/libyara/re_lexer.l
@@ -216,7 +216,7 @@ hex_digit     [0-9a-fA-F]
 
   int i;
 
-  yylval->class_vector = yr_malloc(32);
+  yylval->class_vector = (uint8_t*) yr_malloc(32);
   memcpy(yylval->class_vector, LEX_ENV->class_vector, 32);
 
   if (LEX_ENV->negated_class)
@@ -466,9 +466,9 @@ void yyfatal(
   jmp_buf* recovery_state;
 
   #ifdef _WIN32
-  recovery_state = TlsGetValue(recovery_state_key) ;
+  recovery_state = (jmp_buf*) TlsGetValue(recovery_state_key) ;
   #else
-  recovery_state = pthread_getspecific(recovery_state_key);
+  recovery_state = (jmp_buf*) pthread_getspecific(recovery_state_key);
   #endif
 
   longjmp(*recovery_state, 1);

-- 
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