]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Add const attribute
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 Jun 2020 19:48:30 +0000 (20:48 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 Jun 2020 19:48:30 +0000 (20:48 +0100)
config.h.in
src/libutil/expression.c

index adb7998640d9a603284a7c1854d7978112b3edf4..b4e16ead99df604a74981d2da5481a716c0c40b4 100644 (file)
@@ -430,6 +430,12 @@ extern uint64_t ottery_rand_uint64(void);
   #error incompatible compiler found, need gcc > 2.7 or clang
 #endif
 
+#ifdef __GNUC__
+#define RSPAMD_CONST_FUNCTION __attribute__ ((const))
+#else
+#define RSPAMD_CONST_FUNCTION
+#endif
+
 #define HAVE_OPENSSL             1
 #define HAVE_MATH_H              1
 
index eeee40b75016ce6254c4e251d04f91f65cb57aac..6d4b33b5beb590a4a02feedbc28352731b298bcd 100644 (file)
@@ -96,6 +96,8 @@ rspamd_expr_quark (void)
        return g_quark_from_static_string ("rspamd-expression");
 }
 
+static const gchar * RSPAMD_CONST_FUNCTION
+rspamd_expr_op_to_str (enum rspamd_expression_op op);
 static const gchar *
 rspamd_expr_op_to_str (enum rspamd_expression_op op)
 {
@@ -210,6 +212,8 @@ rspamd_expr_stack_peek (struct rspamd_expression *expr)
 /*
  * Return operation priority
  */
+static gint RSPAMD_CONST_FUNCTION
+rspamd_expr_logic_priority (enum rspamd_expression_op op);
 static gint
 rspamd_expr_logic_priority (enum rspamd_expression_op op)
 {
@@ -251,6 +255,9 @@ rspamd_expr_logic_priority (enum rspamd_expression_op op)
        return ret;
 }
 
+static guint RSPAMD_CONST_FUNCTION
+rspamd_expr_op_flags (enum rspamd_expression_op op);
+
 static guint
 rspamd_expr_op_flags (enum rspamd_expression_op op)
 {
@@ -295,6 +302,8 @@ rspamd_expr_op_flags (enum rspamd_expression_op op)
  * Return FALSE if symbol is not operation symbol (operand)
  * Return TRUE if symbol is operation symbol
  */
+static gboolean RSPAMD_CONST_FUNCTION
+rspamd_expr_is_operation_symbol (gchar a);
 static gboolean
 rspamd_expr_is_operation_symbol (gchar a)
 {