Browse code

bb12085: Converting some constants from enums to defines, because the enums may be evaluated as signed on some systems - notably solaris, causing issues if he value is greater than MAX_INT.

Micah Snyder (micasnyd) authored on 2018/04/27 11:17:24
Showing 2 changed files
... ...
@@ -42,6 +42,12 @@ struct cli_exe_section;
42 42
 struct DISASM_RESULT;
43 43
 #endif
44 44
 
45
+  /**
46
+\group_pe
47
+   * Invalid RVA specified
48
+   */
49
+#define PE_INVALID_RVA 0xFFFFFFFF
50
+
45 51
 /**
46 52
 \group_config
47 53
  * Specifies the bytecode type and how ClamAV executes it 
... ...
@@ -67,14 +73,6 @@ enum BytecodeKind {
67 67
     _BC_LAST_HOOK
68 68
 };
69 69
 
70
-enum {
71
-  /**
72
-\group_pe
73
-   * Invalid RVA specified
74
-   */
75
-  PE_INVALID_RVA = 0xFFFFFFFF
76
-};
77
-
78 70
 /**
79 71
 \group_config
80 72
  * LibClamAV functionality level constants
... ...
@@ -28,6 +28,10 @@
28 28
 #define VM_GLOBALMEMSIZE             0x2000
29 29
 #define VM_FIXEDGLOBALSIZE               64
30 30
 
31
+#define VM_FC 1
32
+#define VM_FZ 2
33
+#define VM_FS 0x80000000
34
+
31 35
 typedef enum rarvm_commands
32 36
 {
33 37
   VM_MOV,  VM_CMP,  VM_ADD,  VM_SUB,  VM_JZ,   VM_JNZ,  VM_INC,  VM_DEC,
... ...
@@ -44,12 +48,6 @@ typedef enum rarvm_standard_filters {
44 44
   VMSF_DELTA, VMSF_UPCASE
45 45
 } rarvm_standard_filters_t;
46 46
 
47
-enum VM_Flags {
48
-	VM_FC=1,
49
-	VM_FZ=2,
50
-	VM_FS=0x80000000
51
-};
52
-
53 47
 enum rarvm_op_type {
54 48
 	VM_OPREG,
55 49
 	VM_OPINT,