summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/stellar_plugin/simple_stellar_plugin.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/stellar_plugin/simple_stellar_plugin.c b/examples/stellar_plugin/simple_stellar_plugin.c
index a9cc0ee..aa6bc37 100644
--- a/examples/stellar_plugin/simple_stellar_plugin.c
+++ b/examples/stellar_plugin/simple_stellar_plugin.c
@@ -1,3 +1,5 @@
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+
#include "stellar/stellar.h"
#include "stellar/packet.h"
#include "stellar/session.h"
@@ -161,7 +163,7 @@ void simple_plugin_packet_get_exdata(struct packet *pkt, unsigned char ip_proto
{
struct simple_stellar_plugin_env *env = (struct simple_stellar_plugin_env *)plugin_env;
struct simple_stellar_plugin_env *exdata = (struct simple_stellar_plugin_env *)packet_exdata_get(pkt, env->packet_exdata_idx);
- assert(memcmp(env, exdata, sizeof(struct simple_stellar_plugin_env)) == 0);
+ if(memcmp(env, exdata, sizeof(struct simple_stellar_plugin_env)) != 0)abort();
return;
}
@@ -178,7 +180,7 @@ static void simple_plugin_packet_exdata_free(int idx, void *ex_ptr, void *arg)
struct simple_stellar_plugin_env *env = (struct simple_stellar_plugin_env *)arg;
assert(env);
struct simple_stellar_plugin_env *exdata = (struct simple_stellar_plugin_env *)ex_ptr;
- assert(memcmp(env, exdata, sizeof(struct simple_stellar_plugin_env)) == 0);
+ if(memcmp(env, exdata, sizeof(struct simple_stellar_plugin_env)) != 0)abort();
}
static void simple_plugin_packet_msg_free(void *msg, void *msg_free_arg)
@@ -186,7 +188,7 @@ static void simple_plugin_packet_msg_free(void *msg, void *msg_free_arg)
struct simple_stellar_plugin_env *env = (struct simple_stellar_plugin_env *)msg_free_arg;
assert(env);
struct simple_stellar_plugin_env *exdata = (struct simple_stellar_plugin_env *)msg;
- assert(memcmp(env, exdata, sizeof(struct simple_stellar_plugin_env)) == 0);
+ if(memcmp(env, exdata, sizeof(struct simple_stellar_plugin_env)) != 0)abort();
}
static void simple_plugin_on_packet_msg_cb(struct packet *pkt, int topic_id, const void *msg, void *plugin_env)
@@ -194,7 +196,7 @@ static void simple_plugin_on_packet_msg_cb(struct packet *pkt, int topic_id, con
struct simple_stellar_plugin_env *env = (struct simple_stellar_plugin_env *)plugin_env;
assert(env);
struct simple_stellar_plugin_env *exdata = (struct simple_stellar_plugin_env *)msg;
- assert(memcmp(env, exdata, sizeof(struct simple_stellar_plugin_env)) == 0);
+ if(memcmp(env, exdata, sizeof(struct simple_stellar_plugin_env)) != 0)abort();
}
void *simple_session_packet_plugin_init(struct stellar *st)