Use gslices and build-time api version
authorMyhailo Danylenko <isbear@ukrpost.net>
Sun, 22 Jul 2012 16:08:05 +0300
changeset 20 d6b68c5fb1c1
parent 19 78535784faa7
child 21 e453791d6ca8
Use gslices and build-time api version
yaubil.c
--- a/yaubil.c	Thu Jun 30 16:25:27 2011 +0300
+++ b/yaubil.c	Sun Jul 22 16:08:05 2012 +0300
@@ -36,9 +36,9 @@
 
 #define DESCRIPTION ( "Yet Another Useless Built-In Language\nProvides commands /multi, /if, /then, /else, /eval, /let" )
 
-static module_info_t info_yaubil_dev = {
-	.branch      = "dev",
-	.api         = 20,
+module_info_t info_yaubil = {
+	.branch      = MCABBER_BRANCH,
+	.api         = MCABBER_API_VERSION,
 	.version     = PROJECT_VERSION,
 	.description = DESCRIPTION,
 	.requires    = NULL,
@@ -47,17 +47,6 @@
 	.next        = NULL,
 };
 
-module_info_t info_yaubil = {
-	.branch      = "0.10.1",
-	.api         = 1,
-	.version     = PROJECT_VERSION,
-	.description = DESCRIPTION,
-	.requires    = NULL,
-	.init        = yaubil_init,
-	.uninit      = yaubil_uninit,
-	.next        = &info_yaubil_dev,
-};
-
 #ifdef MCABBER_API_HAVE_CMD_ID
 static gpointer yaubil_multi_cmid = NULL;
 static gpointer yaubil_if_cmid    = NULL;
@@ -598,7 +587,7 @@
 {
 	if (value->str_value)
 		g_free (value->str_value);
-	g_free (value);
+	g_slice_free (value_t, value);
 }
 
 static value_t *process_expression (const char *str, gsize *len)
@@ -790,7 +779,7 @@
 
 	{ // return value
 		*len = p - str;
-		value_t *rval = g_new (value_t, 1);
+		value_t *rval = g_slice_new (value_t);
 
 		rval->type      = val.type;
 		rval->int_value = val.int_value;