summaryrefslogtreecommitdiffstats
path: root/gst/goom
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2008-02-23 03:10:55 +0000
committerBastien Nocera <hadess@hadess.net>2008-02-23 03:10:55 +0000
commit9b2e72cabdb5f7765e150ab5b3ca2d17213d773a (patch)
tree454447e3e7eb049444dee790098937cda79686e5 /gst/goom
parente8ef50ac94938ee230dd15642b86a332d365a1f4 (diff)
gst/goom/Makefile.am: Don't compile lex or yacc outputs with warnings, but add other CFLAGS
Original commit message from CVS: * gst/goom/Makefile.am: Don't compile lex or yacc outputs with warnings, but add other CFLAGS * gst/goom/goomsl.c (gsl_instr_set_namespace), (gsl_instr_add_param), (iflow_execute), (gsl_enternamespace), (calculate_labels), (gsl_read_file): * gst/goom/goomsl_lex.l: * gst/goom/goomsl_yacc.y: * gst/goom/plugin_info.c: Remove a few live printf, and fprintf, replace exit() calls with g_assert_not_reached() if it not optimal for a library
Diffstat (limited to 'gst/goom')
-rw-r--r--gst/goom/Makefile.am2
-rw-r--r--gst/goom/goomsl_lex.l2
-rw-r--r--gst/goom/goomsl_yacc.y35
-rw-r--r--gst/goom/plugin_info.c2
4 files changed, 38 insertions, 3 deletions
diff --git a/gst/goom/Makefile.am b/gst/goom/Makefile.am
index 703426f6..02bb6b26 100644
--- a/gst/goom/Makefile.am
+++ b/gst/goom/Makefile.am
@@ -68,9 +68,11 @@ noinst_LTLIBRARIES = libgstgoomconfigparse.la
# uncomment these lines to dist the generated sources
#BUILT_SOURCES = goomsl_yacc.h goomsl_yacc.c goomsl_lex.c
#libgstgoomconfigparse_la_SOURCES = goomsl_lex.c goomsl_yacc.c goomsl_yacc.h
+#libgstgoomconfigparse_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GOOM_FILTER_CFLAGS) $(LIBOIL_CFLAGS) $(ARCH_CFLAGS)
# uncomment these lines to _NOT_ dist the generated sources
nodist_libgstgoomconfigparse_la_SOURCES = goomsl_lex.c goomsl_yacc.c
+libgstgoomconfigparse_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GOOM_FILTER_CFLAGS) $(LIBOIL_CFLAGS) $(ARCH_CFLAGS)
CLEANFILES=goomsl_yacc.c goomsl_lex.c goomsl_yacc.h
EXTRA_DIST += goomsl_yacc.y goomsl_lex.l
diff --git a/gst/goom/goomsl_lex.l b/gst/goom/goomsl_lex.l
index 3079c022..7a7de290 100644
--- a/gst/goom/goomsl_lex.l
+++ b/gst/goom/goomsl_lex.l
@@ -35,7 +35,7 @@ ID [a-zA-Z_@&][a-zA-Z0-9_\.]*
<C_COMMENT,LINE_COMMENT>. { /* eat up comment */ }
<INITIAL>"#RST_LINE#" { currentGoomSL->num_lines = 0; }
-<INITIAL>"#FILE ".*"#" { currentGoomSL->num_lines = 0; printf("%s\n", yytext); }
+<INITIAL>"#FILE ".*"#" { currentGoomSL->num_lines = 0; /* printf("%s\n", yytext); */ }
<INITIAL>"#"[^\n]* { /* ignore preprocessor lines */ }
<INITIAL>"/*" { BEGIN C_COMMENT; }
diff --git a/gst/goom/goomsl_yacc.y b/gst/goom/goomsl_yacc.y
index c424a50a..078933c2 100644
--- a/gst/goom/goomsl_yacc.y
+++ b/gst/goom/goomsl_yacc.y
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+ #include <glib.h>
#include "goomsl.h"
#include "goomsl_private.h"
@@ -232,9 +233,12 @@
{
GSL_StructField *field = gsl_new_struct_field(name, gsl_get_struct_id(type));
if (field->type < 0) {
+ g_assert_not_reached ();
+#if 0
fprintf(stderr, "ERROR: Line %d, Unknown structure: '%s'\n",
currentGoomSL->num_lines, type);
exit(1);
+#endif
}
return field;
}
@@ -279,9 +283,11 @@
space = goom_heap_malloc_with_alignment(currentGoomSL->data_heap,
sizeof(int), sizeof(int));
break;
+#if 0
case -1:
fprintf(stderr, "What the fuck!\n");
exit(1);
+#endif
default: /* On a un struct_id */
space = goom_heap_malloc_with_alignment_prefixed(currentGoomSL->data_heap,
currentGoomSL->gsl_struct[type]->size, STRUCT_ALIGNMENT, sizeof(int));
@@ -498,9 +504,12 @@
gsl_int_decl_global(stmp);
}
else if (type == -1) {
+ g_assert_not_reached ();
+#if 0
fprintf(stderr, "ERROR: Line %d, Could not find variable '%s'\n",
expr->line_number, expr->unode.opr.op[0]->str);
exit(1);
+#endif
}
else { /* type is a struct_id */
sprintf(stmp,"_s_tmp_%i",allocateTemp());
@@ -576,30 +585,42 @@
else if (expr->type == CONST_FLOAT_NODE)
zeroConst = new_constFloat("0.0", currentGoomSL->num_lines);
else if (expr->type == CONST_PTR_NODE) {
+ g_assert_not_reached ();
+#if 0
fprintf(stderr, "ERROR: Line %d, Could not negate const pointer.\n",
currentGoomSL->num_lines);
exit(1);
+#endif
}
else {
int type = gsl_type_of_var(expr->vnamespace, expr->str);
if (type == INSTR_FLOAT)
zeroConst = new_constFloat("0.0", currentGoomSL->num_lines);
else if (type == INSTR_PTR) {
+ g_assert_not_reached ();
+#if 0
fprintf(stderr, "ERROR: Line %d, Could not negate pointer.\n",
currentGoomSL->num_lines);
exit(1);
+#endif
}
else if (type == INSTR_INT)
zeroConst = new_constInt("0", currentGoomSL->num_lines);
else if (type == -1) {
+ g_assert_not_reached ();
+#if 0
fprintf(stderr, "ERROR: Line %d, Could not find variable '%s'\n",
expr->line_number, expr->unode.opr.op[0]->str);
exit(1);
+#endif
}
else { /* type is a struct_id */
+ g_assert_not_reached ();
+#if 0
fprintf(stderr, "ERROR: Line %d, Could not negate struct '%s'\n",
expr->line_number, expr->str);
exit(1);
+#endif
}
}
return new_expr2("sub", OPR_SUB, zeroConst, expr);
@@ -628,7 +649,7 @@
NodeType *node = new_expr1(name, OPR_CALL_EXPR, call);
node->vnamespace = gsl_find_namespace(name);
if (node->vnamespace == NULL)
- fprintf(stderr, "ERROR: Line %d, No return type for: '%s'\n", currentGoomSL->num_lines, name);
+ /* fprintf(stderr, "ERROR: Line %d, No return type for: '%s'\n", currentGoomSL->num_lines, name); */
return node;
}
static void precommit_call_expr(NodeType *call) {
@@ -648,9 +669,12 @@
gsl_int_decl_global(stmp);
}
else if (type == -1) {
+ g_assert_not_reached ();
+#if 0
fprintf(stderr, "ERROR: Line %d, Could not find variable '%s'\n",
call->line_number, call->str);
exit(1);
+#endif
}
else { /* type is a struct_id */
sprintf(stmp,"_s_tmp_%i",allocateTemp());
@@ -936,9 +960,12 @@
fval = goom_hash_get(currentGoomSL->functions, name);
}
if (!fval) {
+ g_assert_not_reached ();
+#if 0
fprintf(stderr, "ERROR: Line %d, Could not find function %s\n", currentGoomSL->num_lines, name);
exit(1);
return NULL;
+#endif
}
else {
ExternalFunctionStruct *gef = (ExternalFunctionStruct*)fval->ptr;
@@ -1158,8 +1185,11 @@
NodeType *node = nodeNew(str, VAR_NODE, line_number); /* {{{ */
node->vnamespace = gsl_find_namespace(str);
if (node->vnamespace == 0) {
+ g_assert_not_reached ();
+#if 0
fprintf(stderr, "ERROR: Line %d, Variable not found: '%s'\n", line_number, str);
exit(1);
+#endif
}
return node;
} /* }}} */
@@ -1398,8 +1428,11 @@ opt_nl: '\n' | ;
void yyerror(char *str)
{ /* {{{ */
+ g_assert_not_reached ();
+#if 0
fprintf(stderr, "ERROR: Line %d, %s\n", currentGoomSL->num_lines, str);
currentGoomSL->compilationOK = 0;
exit(1);
+#endif
} /* }}} */
diff --git a/gst/goom/plugin_info.c b/gst/goom/plugin_info.c
index ce5e868d..465c2908 100644
--- a/gst/goom/plugin_info.c
+++ b/gst/goom/plugin_info.c
@@ -23,7 +23,7 @@
#include <liboil/liboil.h>
#include <liboil/liboilfunction.h>
#include <liboil/liboilcpu.h>
-#define VERBOSE 1
+/* #define VERBOSE 1 */
static void
setOptimizedMethods (PluginInfo * p)