Make int types test case use aop_finish() for writing its header.
authorJustin Seyster <jseyster@cs.sunysb.edu>
Tue, 7 Sep 2010 22:20:16 +0000 (18:20 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Tue, 7 Sep 2010 22:20:16 +0000 (18:20 -0400)
test/plugin-int-types.c

index 9f32e7641eba3c1e09558f0211641469a72ea11a..f5bec2a27903dd0c8acf5b2d00bde9232df34c4f 100644 (file)
@@ -17,7 +17,6 @@ static void plugin_join_on_call(struct aop_joinpoint *jp, void *data)
 
 static unsigned int plugin_int()
 {
-  const char *header;
   struct aop_pointcut *pc;
 
   pc = aop_match_function_call();
@@ -68,15 +67,20 @@ static unsigned int plugin_int()
   aop_filter_call_pc_by_param(pc, 0, aop_t_unsigned128());
   aop_join_on(pc, plugin_join_on_call, "_advice_unsigned128");
 
+  return 0;
+}
+
+void aop_finish()
+{
+  const char *header;
   header = aop_get_arg_value("header");
+
   if (header != NULL) {
     int res;
     res = aop_write_c_header(header, "_INT_HEADER_", NULL, NULL);
     if (res != 0)
       perror(header);
   }
-
-  return 0;
 }
 
 AOP_MAIN_PROTO aop_main()