Browse Source

Always make sure that the initilaization of the cpu_funcs field is NULL-terminated

Cyril Roelandt 13 years ago
parent
commit
9aa04863c2
1 changed files with 17 additions and 1 deletions
  1. 17 1
      tools/dev/experimental/cpu_func_to_cpu_funcs.cocci

+ 17 - 1
tools/dev/experimental/cpu_func_to_cpu_funcs.cocci

@@ -9,7 +9,23 @@ identifier cl;
 @@
 @@
 struct starpu_codelet cl = {
 struct starpu_codelet cl = {
 -	.cpu_func = STARPU_MULTIPLE_CPU_IMPLEMENTATIONS,
 -	.cpu_func = STARPU_MULTIPLE_CPU_IMPLEMENTATIONS,
-	.cpu_funcs = { ... }
+	.cpu_funcs = { ...
+- }
++ ,NULL}
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// The previous rule may have added "NULL" twice in the initialization of the //
+// cpu_funcs field. Let's take care of that.                                  //
+////////////////////////////////////////////////////////////////////////////////
+@@
+identifier cl;
+@@
+struct starpu_codelet cl = {
+	.cpu_funcs = { ..., NULL
+- ,NULL
+}
 };
 };