diff src/audacious/tuple_compiler.c @ 3809:17fb5e598cfc trunk

Branch merge.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 19 Oct 2007 12:14:04 +0300
parents b5d550755bad db6cb4048a74
children e307e455aca0
line wrap: on
line diff
--- a/src/audacious/tuple_compiler.c	Sun Oct 14 05:54:54 2007 +0300
+++ b/src/audacious/tuple_compiler.c	Fri Oct 19 12:14:04 2007 +0300
@@ -33,6 +33,10 @@
 #include <stdarg.h>
 #include "tuple_compiler.h"
 
+#define MAX_STR		(256)
+#define MIN_ALLOC_NODES (8)
+#define MIN_ALLOC_BUF	(64)
+
 
 void tuple_error(const char *fmt, ...)
 {
@@ -583,9 +587,10 @@
       }
       break;
     default:
-      break;
+      tmps = NULL;
+      tmpi = 0;
   }
-
+  
   return type;
 }
 
@@ -608,6 +613,7 @@
   
   while (curr) {
     const gchar *str = NULL;
+
     switch (curr->opcode) {
       case OP_RAW:
         str = curr->text;
@@ -654,7 +660,7 @@
       case OP_GT: case OP_GTEQ:
         var0 = ctx->variables[curr->var[0]];
         var1 = ctx->variables[curr->var[1]];
-
+        
         type0 = tf_get_var(&tmps0, &tmpi0, var0, tuple);
         type1 = tf_get_var(&tmps1, &tmpi1, var1, tuple);
         
@@ -751,6 +757,8 @@
   assert(ctx != NULL);
   assert(tuple != NULL);
   
+  if (!expr) return res;
+  
   tuple_formatter_eval_do(ctx, expr, tuple, &res, &resmax, &reslen);
   
   return res;