[Forensics-changes] [yara] 335/368: Fix warnings
Hilko Bengen
bengen at moszumanska.debian.org
Sat Jul 1 10:30:55 UTC 2017
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag v3.5.0
in repository yara.
commit b11898bf78336a1ee770e8162a1ac21114ffab88
Author: plusvic <plusvic at gmail.com>
Date: Mon Jun 20 12:31:17 2016 +0200
Fix warnings
---
libyara/hex_lexer.c | 10 +++++-----
libyara/lexer.c | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libyara/hex_lexer.c b/libyara/hex_lexer.c
index b977b34..ebfb74b 100644
--- a/libyara/hex_lexer.c
+++ b/libyara/hex_lexer.c
@@ -243,7 +243,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- int yy_n_chars;
+ yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -575,7 +575,7 @@ struct yyguts_t
size_t yy_buffer_stack_max; /**< capacity of stack. */
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
char yy_hold_char;
- int yy_n_chars;
+ yy_size_t yy_n_chars;
yy_size_t yyleng_r;
char *yy_c_buf_p;
int yy_init;
@@ -1274,9 +1274,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
- int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) hex_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
@@ -1676,7 +1676,7 @@ static void hex_yyensure_buffer_stack (yyscan_t yyscanner)
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
- num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
+ num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
yyg->yy_buffer_stack = (struct yy_buffer_state**)hex_yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
diff --git a/libyara/lexer.c b/libyara/lexer.c
index ef515a5..65b87a7 100644
--- a/libyara/lexer.c
+++ b/libyara/lexer.c
@@ -783,7 +783,7 @@ with noyywrap then we can remove this pragma.
} \
else \
{ \
- str->length = (str_len); \
+ str->length = (uint32_t) (str_len); \
str->flags = 0; \
} \
--
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