From 3a5a66de8f847a0ff11fdcf6c1644e19aa54c0f7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 12 Aug 2009 10:57:03 +0200 Subject: [PATCH] generator.ml: factor out "pr_args n" function --- src/generator.ml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index b43b3bf..9d96170 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -4757,18 +4757,21 @@ and generate_daemon_actions () = pr " reply_with_error (\"%%s: daemon failed to decode procedure arguments\", \"%s\");\n" name; pr " return;\n"; pr " }\n"; + let pr_args n = + pr " char *%s = args.%s;\n" n n + in List.iter ( function | Pathname n -> - pr " char *%s = args.%s;\n" n n; + pr_args n; pr " ABS_PATH (%s, goto done);\n" n; | Device n -> - pr " char *%s = args.%s;\n" n n; + pr_args n; pr " RESOLVE_DEVICE (%s, goto done);" n; | Dev_or_Path n -> - pr " char *%s = args.%s;\n" n n; + pr_args n; pr " REQUIRE_ROOT_OR_RESOLVE_DEVICE (%s, goto done);" n; - | String n -> pr " char *%s = args.%s;\n" n n + | String n -> pr_args n | OptString n -> pr " %s = args.%s ? *args.%s : NULL;\n" n n n | StringList n -> pr " %s = realloc (args.%s.%s_val,\n" n n n; -- 1.8.3.1