[Forensics-changes] [yara] 45/135: Rename token SIZE to FILESIZE to avoid conflicts with windef.h in Windows

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:27:31 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 82b2c61a8ccca0f9df8b6fbda9535541be3af580
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Fri Jul 4 12:30:00 2014 +0200

    Rename token SIZE to FILESIZE to avoid conflicts with windef.h in Windows
---
 libyara/exec.c              | 2 +-
 libyara/grammar.c           | 8 ++++----
 libyara/grammar.h           | 4 ++--
 libyara/grammar.y           | 6 +++---
 libyara/include/yara/exec.h | 2 +-
 libyara/lexer.c             | 2 +-
 libyara/lexer.l             | 2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/libyara/exec.c b/libyara/exec.c
index e6627b5..ae26494 100644
--- a/libyara/exec.c
+++ b/libyara/exec.c
@@ -618,7 +618,7 @@ int yr_execute_code(
 
         break;
 
-      case OP_SIZE:
+      case OP_FILESIZE:
         push(context->file_size);
         break;
 
diff --git a/libyara/grammar.c b/libyara/grammar.c
index 1732058..afcc15c 100644
--- a/libyara/grammar.c
+++ b/libyara/grammar.c
@@ -94,7 +94,7 @@
      NOCASE = 275,
      FULLWORD = 276,
      AT = 277,
-     SIZE = 278,
+     FILESIZE = 278,
      ENTRYPOINT = 279,
      ALL = 280,
      ANY = 281,
@@ -148,7 +148,7 @@
 #define NOCASE 275
 #define FULLWORD 276
 #define AT 277
-#define SIZE 278
+#define FILESIZE 278
 #define ENTRYPOINT 279
 #define ALL 280
 #define ANY 281
@@ -655,7 +655,7 @@ static const char *const yytname[] =
   "STRINGS", "CONDITION", "IDENTIFIER", "STRING_IDENTIFIER",
   "STRING_COUNT", "STRING_OFFSET", "STRING_IDENTIFIER_WITH_WILDCARD",
   "NUMBER", "TEXT_STRING", "HEX_STRING", "REGEXP", "ASCII", "WIDE",
-  "NOCASE", "FULLWORD", "AT", "SIZE", "ENTRYPOINT", "ALL", "ANY", "IN",
+  "NOCASE", "FULLWORD", "AT", "FILESIZE", "ENTRYPOINT", "ALL", "ANY", "IN",
   "OF", "FOR", "THEM", "INT8", "INT16", "INT32", "UINT8", "UINT16",
   "UINT32", "MATCHES", "CONTAINS", "IMPORT", "_TRUE_", "_FALSE_", "OR",
   "AND", "'&'", "'|'", "'^'", "IS", "NEQ", "EQ", "GE", "GT", "LE", "LT",
@@ -3130,7 +3130,7 @@ yyreduce:
 #line 1411 "grammar.y"
     {
         compiler->last_result = yr_parser_emit(
-            yyscanner, OP_SIZE, NULL);
+            yyscanner, OP_FILESIZE, NULL);
 
         (yyval.expression_type) = EXPRESSION_TYPE_INTEGER;
 
diff --git a/libyara/grammar.h b/libyara/grammar.h
index 04dbe86..17a073e 100644
--- a/libyara/grammar.h
+++ b/libyara/grammar.h
@@ -59,7 +59,7 @@
      NOCASE = 275,
      FULLWORD = 276,
      AT = 277,
-     SIZE = 278,
+     FILESIZE = 278,
      ENTRYPOINT = 279,
      ALL = 280,
      ANY = 281,
@@ -113,7 +113,7 @@
 #define NOCASE 275
 #define FULLWORD 276
 #define AT 277
-#define SIZE 278
+#define FILESIZE 278
 #define ENTRYPOINT 279
 #define ALL 280
 #define ANY 281
diff --git a/libyara/grammar.y b/libyara/grammar.y
index c09a8dc..8ab5246 100644
--- a/libyara/grammar.y
+++ b/libyara/grammar.y
@@ -113,7 +113,7 @@ limitations under the License.
 %token NOCASE
 %token FULLWORD
 %token AT
-%token SIZE
+%token FILESIZE
 %token ENTRYPOINT
 %token ALL
 %token ANY
@@ -1407,10 +1407,10 @@ primary_expression
       {
         $$ = $2;
       }
-    | SIZE
+    | FILESIZE
       {
         compiler->last_result = yr_parser_emit(
-            yyscanner, OP_SIZE, NULL);
+            yyscanner, OP_FILESIZE, NULL);
 
         $$ = EXPRESSION_TYPE_INTEGER;
 
diff --git a/libyara/include/yara/exec.h b/libyara/include/yara/exec.h
index eac53a1..9b1624f 100644
--- a/libyara/include/yara/exec.h
+++ b/libyara/include/yara/exec.h
@@ -72,7 +72,7 @@ limitations under the License.
 #define OP_SWAPUNDEF      42
 #define OP_JNUNDEF        43
 #define OP_JLE            44
-#define OP_SIZE           45
+#define OP_FILESIZE       45
 #define OP_ENTRYPOINT     46
 #define OP_INT8           47
 #define OP_INT16          48
diff --git a/libyara/lexer.c b/libyara/lexer.c
index 0634c00..1767ee4 100644
--- a/libyara/lexer.c
+++ b/libyara/lexer.c
@@ -1173,7 +1173,7 @@ YY_RULE_SETUP
 case 32:
 YY_RULE_SETUP
 #line 116 "lexer.l"
-{ return SIZE;        }
+{ return FILESIZE;    }
 	YY_BREAK
 case 33:
 YY_RULE_SETUP
diff --git a/libyara/lexer.l b/libyara/lexer.l
index b546953..e83e2cd 100644
--- a/libyara/lexer.l
+++ b/libyara/lexer.l
@@ -113,7 +113,7 @@ hexdigit      [a-fA-F0-9]
 "all"                   { return ALL;         }
 "any"                   { return ANY;         }
 "entrypoint"            { return ENTRYPOINT;  }
-"filesize"              { return SIZE;        }
+"filesize"              { return FILESIZE;    }
 "uint8"                 { return UINT8;       }
 "uint16"                { return UINT16;      }
 "uint32"                { return UINT32;      }

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