[Forensics-changes] [yara] 133/135: Replace WIN32 with _WIN32

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:27:40 UTC 2017


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

bengen pushed a commit to annotated tag v3.1.0
in repository yara.

commit ffc0a3320ad61f7d3fc3e79fd7690ddbed44d09f
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Tue Aug 26 12:52:07 2014 +0200

    Replace WIN32 with _WIN32
---
 libyara/hex_lexer.c            |  8 ++---
 libyara/hex_lexer.l            |  8 ++---
 libyara/include/yara/filemap.h |  4 +--
 libyara/lexer.c                | 70 +++++++++++++++++++++---------------------
 libyara/lexer.l                |  4 +--
 libyara/re_lexer.c             |  8 ++---
 libyara/re_lexer.l             |  8 ++---
 7 files changed, 55 insertions(+), 55 deletions(-)

diff --git a/libyara/hex_lexer.c b/libyara/hex_lexer.c
index eb64437..ed91564 100644
--- a/libyara/hex_lexer.c
+++ b/libyara/hex_lexer.c
@@ -488,7 +488,7 @@ limitations under the License.
 
 #include "hex_grammar.h"
 
-#ifdef WIN32
+#ifdef _WIN32
 #define snprintf _snprintf
 #endif
 
@@ -2083,7 +2083,7 @@ void hex_yyfree (void * ptr , yyscan_t yyscanner)
 
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <windows.h>
 extern DWORD recovery_state_key;
 #else
@@ -2098,7 +2098,7 @@ void yyfatal(
 {
   jmp_buf* recovery_state;
 
-  #ifdef WIN32
+  #ifdef _WIN32
   recovery_state = TlsGetValue(recovery_state_key) ;
   #else
   recovery_state = pthread_getspecific(recovery_state_key);
@@ -2142,7 +2142,7 @@ int yr_parse_hex_string(
   lex_env.last_error_code = ERROR_SUCCESS;
   lex_env.inside_or = 0;
 
-  #ifdef WIN32
+  #ifdef _WIN32
   TlsSetValue(recovery_state_key, (LPVOID) &recovery_state);
   #else
   pthread_setspecific(recovery_state_key, (void*) &recovery_state);
diff --git a/libyara/hex_lexer.l b/libyara/hex_lexer.l
index 81f8573..17cea91 100644
--- a/libyara/hex_lexer.l
+++ b/libyara/hex_lexer.l
@@ -30,7 +30,7 @@ limitations under the License.
 
 #include "hex_grammar.h"
 
-#ifdef WIN32
+#ifdef _WIN32
 #define snprintf _snprintf
 #endif
 
@@ -138,7 +138,7 @@ hexdigit      [a-fA-F0-9]
 %%
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <windows.h>
 extern DWORD recovery_state_key;
 #else
@@ -153,7 +153,7 @@ void yyfatal(
 {
   jmp_buf* recovery_state;
 
-  #ifdef WIN32
+  #ifdef _WIN32
   recovery_state = TlsGetValue(recovery_state_key) ;
   #else
   recovery_state = pthread_getspecific(recovery_state_key);
@@ -197,7 +197,7 @@ int yr_parse_hex_string(
   lex_env.last_error_code = ERROR_SUCCESS;
   lex_env.inside_or = 0;
 
-  #ifdef WIN32
+  #ifdef _WIN32
   TlsSetValue(recovery_state_key, (LPVOID) &recovery_state);
   #else
   pthread_setspecific(recovery_state_key, (void*) &recovery_state);
diff --git a/libyara/include/yara/filemap.h b/libyara/include/yara/filemap.h
index 3b5a2ff..8ae773c 100755
--- a/libyara/include/yara/filemap.h
+++ b/libyara/include/yara/filemap.h
@@ -17,7 +17,7 @@ limitations under the License.
 #ifndef YR_FILEMAP_H
 #define YR_FILEMAP_H
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <windows.h>
 #define FILE_DESCRIPTOR         HANDLE
 #else
@@ -33,7 +33,7 @@ typedef struct _YR_MAPPED_FILE
   FILE_DESCRIPTOR     file;
   size_t              size;
   uint8_t*            data;
-  #ifdef WIN32
+  #ifdef _WIN32
   HANDLE              mapping;
   #endif
 
diff --git a/libyara/lexer.c b/libyara/lexer.c
index 59b6145..8d114c8 100644
--- a/libyara/lexer.c
+++ b/libyara/lexer.c
@@ -34,7 +34,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types. 
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -51,7 +51,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -181,7 +181,7 @@ typedef size_t yy_size_t;
 
     /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
      *       access to the local variable yy_act. Since yyless() is a macro, it would break
-     *       existing scanners that call yyless() from OUTSIDE yara_yylex.
+     *       existing scanners that call yyless() from OUTSIDE yara_yylex. 
      *       One obvious solution it to make yy_act a global. I tried that, and saw
      *       a 5% performance hit in a non-yylineno scanner, because yy_act is
      *       normally declared as a register variable-- so it is not worth it.
@@ -193,7 +193,7 @@ typedef size_t yy_size_t;
                     if ( yytext[yyl] == '\n' )\
                         --yylineno;\
             }while(0)
-
+    
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
 	do \
@@ -250,7 +250,7 @@ struct yy_buffer_state
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-
+    
 	/* Whether to try to fill the input buffer when we reach the
 	 * end of it.
 	 */
@@ -604,9 +604,9 @@ static yyconst flex_int16_t yy_chk[412] =
 /* Table of booleans, true if rule could match eol. */
 static yyconst flex_int32_t yy_rule_can_match_eol[76] =
     {   0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0,     };
 
 /* The intent behind this definition is that it'll catch
@@ -670,7 +670,7 @@ limitations under the License.
       } \
     }
 
-#ifdef WIN32
+#ifdef _WIN32
 #define snprintf _snprintf
 #endif
 
@@ -741,7 +741,7 @@ static int yy_init_globals (yyscan_t yyscanner );
     /* This must go here because YYSTYPE and YYLTYPE are included
      * from bison output in section 1.*/
     #    define yylval yyg->yylval_r
-
+    
 int yara_yylex_init (yyscan_t* scanner);
 
 int yara_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
@@ -997,7 +997,7 @@ yy_find_action:
 			yy_size_t yyl;
 			for ( yyl = 0; yyl < yyleng; ++yyl )
 				if ( yytext[yyl] == '\n' )
-
+					   
     do{ yylineno++;
         yycolumn=0;
     }while(0)
@@ -1287,7 +1287,7 @@ YY_RULE_SETUP
     // make included file path relative to current source file
     s = strrchr(buffer, '/');
 
-    #ifdef WIN32
+    #ifdef _WIN32
     b = strrchr(buffer, '\\'); // in Windows both path delimiters are accepted
     #endif
 
@@ -2137,7 +2137,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 	yyg->yy_hold_char = *++yyg->yy_c_buf_p;
 
 	if ( c == '\n' )
-
+		   
     do{ yylineno++;
         yycolumn=0;
     }while(0)
@@ -2220,7 +2220,7 @@ static void yara_yy_load_buffer_state  (yyscan_t yyscanner)
     YY_BUFFER_STATE yara_yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
 {
 	YY_BUFFER_STATE b;
-
+    
 	b = (YY_BUFFER_STATE) yara_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
 	if ( ! b )
 		YY_FATAL_ERROR( "out of dynamic memory in yara_yy_create_buffer()" );
@@ -2264,7 +2264,7 @@ static void yara_yy_load_buffer_state  (yyscan_t yyscanner)
 #ifndef __cplusplus
 extern int isatty (int );
 #endif /* __cplusplus */
-
+    
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a yara_yyrestart() or at EOF.
@@ -2290,7 +2290,7 @@ extern int isatty (int );
     }
 
         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-
+    
 	errno = oerrno;
 }
 
@@ -2396,9 +2396,9 @@ static void yara_yyensure_buffer_stack (yyscan_t yyscanner)
 								, yyscanner);
 		if ( ! yyg->yy_buffer_stack )
 			YY_FATAL_ERROR( "out of dynamic memory in yara_yyensure_buffer_stack()" );
-
+								  
 		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
+				
 		yyg->yy_buffer_stack_max = num_to_alloc;
 		yyg->yy_buffer_stack_top = 0;
 		return;
@@ -2427,12 +2427,12 @@ static void yara_yyensure_buffer_stack (yyscan_t yyscanner)
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
  * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object. 
  */
 YY_BUFFER_STATE yara_yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
 {
 	YY_BUFFER_STATE b;
-
+    
 	if ( size < 2 ||
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -2468,7 +2468,7 @@ YY_BUFFER_STATE yara_yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yy
  */
 YY_BUFFER_STATE yara_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
 {
-
+    
 	return yara_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
 }
 
@@ -2484,7 +2484,7 @@ YY_BUFFER_STATE yara_yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes
 	YY_BUFFER_STATE b;
 	char *buf;
 	yy_size_t n, i;
-
+    
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
 	buf = (char *) yara_yyalloc(n ,yyscanner );
@@ -2552,10 +2552,10 @@ YY_EXTRA_TYPE yara_yyget_extra  (yyscan_t yyscanner)
 int yara_yyget_lineno  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+    
         if (! YY_CURRENT_BUFFER)
             return 0;
-
+    
     return yylineno;
 }
 
@@ -2565,10 +2565,10 @@ int yara_yyget_lineno  (yyscan_t yyscanner)
 int yara_yyget_column  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+    
         if (! YY_CURRENT_BUFFER)
             return 0;
-
+    
     return yycolumn;
 }
 
@@ -2629,8 +2629,8 @@ void yara_yyset_lineno (int  line_number , yyscan_t yyscanner)
 
         /* lineno is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "yara_yyset_lineno called with no buffer" , yyscanner);
-
+           yy_fatal_error( "yara_yyset_lineno called with no buffer" , yyscanner); 
+    
     yylineno = line_number;
 }
 
@@ -2644,8 +2644,8 @@ void yara_yyset_column (int  column_no , yyscan_t yyscanner)
 
         /* column is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "yara_yyset_column called with no buffer" , yyscanner);
-
+           yy_fatal_error( "yara_yyset_column called with no buffer" , yyscanner); 
+    
     yycolumn = column_no;
 }
 
@@ -2740,20 +2740,20 @@ int yara_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals
         errno = EINVAL;
         return 1;
     }
-
+	
     *ptr_yy_globals = (yyscan_t) yara_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-
+	
     if (*ptr_yy_globals == NULL){
         errno = ENOMEM;
         return 1;
     }
-
+    
     /* By setting to 0xAA, we expose bugs in
     yy_init_globals. Leave at 0x00 for releases. */
     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
+    
     yara_yyset_extra (yy_user_defined, *ptr_yy_globals);
-
+    
     return yy_init_globals ( *ptr_yy_globals );
 }
 
diff --git a/libyara/lexer.l b/libyara/lexer.l
index 42cee69..25c948e 100644
--- a/libyara/lexer.l
+++ b/libyara/lexer.l
@@ -53,7 +53,7 @@ limitations under the License.
       } \
     }
 
-#ifdef WIN32
+#ifdef _WIN32
 #define snprintf _snprintf
 #endif
 
@@ -171,7 +171,7 @@ include[ \t]+\"         {
     // make included file path relative to current source file
     s = strrchr(buffer, '/');
 
-    #ifdef WIN32
+    #ifdef _WIN32
     b = strrchr(buffer, '\\'); // in Windows both path delimiters are accepted
     #endif
 
diff --git a/libyara/re_lexer.c b/libyara/re_lexer.c
index 2508391..1b6820b 100644
--- a/libyara/re_lexer.c
+++ b/libyara/re_lexer.c
@@ -514,7 +514,7 @@ limitations under the License.
 #include <yara/re_lexer.h>
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #define snprintf _snprintf
 #endif
 
@@ -2443,7 +2443,7 @@ uint8_t read_escaped_char(yyscan_t yyscanner)
 
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <windows.h>
 extern DWORD recovery_state_key;
 #else
@@ -2457,7 +2457,7 @@ void yyfatal(
 {
   jmp_buf* recovery_state;
 
-  #ifdef WIN32
+  #ifdef _WIN32
   recovery_state = TlsGetValue(recovery_state_key) ;
   #else
   recovery_state = pthread_getspecific(recovery_state_key);
@@ -2501,7 +2501,7 @@ int yr_parse_re_string(
 
   lex_env.last_error_code = ERROR_SUCCESS;
 
-  #ifdef WIN32
+  #ifdef _WIN32
   TlsSetValue(recovery_state_key, (LPVOID) &recovery_state);
   #else
   pthread_setspecific(recovery_state_key, (void*) &recovery_state);
diff --git a/libyara/re_lexer.l b/libyara/re_lexer.l
index e62d7c5..3507955 100644
--- a/libyara/re_lexer.l
+++ b/libyara/re_lexer.l
@@ -30,7 +30,7 @@ limitations under the License.
 #include <yara/re_lexer.h>
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #define snprintf _snprintf
 #endif
 
@@ -449,7 +449,7 @@ uint8_t read_escaped_char(yyscan_t yyscanner)
 
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <windows.h>
 extern DWORD recovery_state_key;
 #else
@@ -463,7 +463,7 @@ void yyfatal(
 {
   jmp_buf* recovery_state;
 
-  #ifdef WIN32
+  #ifdef _WIN32
   recovery_state = TlsGetValue(recovery_state_key) ;
   #else
   recovery_state = pthread_getspecific(recovery_state_key);
@@ -507,7 +507,7 @@ int yr_parse_re_string(
 
   lex_env.last_error_code = ERROR_SUCCESS;
 
-  #ifdef WIN32
+  #ifdef _WIN32
   TlsSetValue(recovery_state_key, (LPVOID) &recovery_state);
   #else
   pthread_setspecific(recovery_state_key, (void*) &recovery_state);

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