ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/thermalizer/thermalizerCmd.cpp
(Generate patch)

Comparing:
branches/development/src/applications/thermalizer/thermalizerCmd.c (file contents), Revision 1465 by chuckv, Fri Jul 9 23:08:25 2010 UTC vs.
trunk/src/applications/thermalizer/thermalizerCmd.cpp (file contents), Revision 1795 by gezelter, Fri Sep 7 18:13:55 2012 UTC

# Line 1 | Line 1
1   /*
2 <  File autogenerated by gengetopt version 2.22
2 >  File autogenerated by gengetopt version 2.22.4
3    generated with the following command:
4 <  gengetopt -u -F thermalizerCmd
4 >  gengetopt -F thermalizerCmd -u
5  
6    The developers of gengetopt consider the fixed text that goes in all
7    gengetopt output files to be in the public domain:
# Line 17 | Line 17
17   #include <stdlib.h>
18   #include <string.h>
19  
20 < #include "getopt.h"
20 > #ifndef FIX_UNUSED
21 > #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
22 > #endif
23  
24 + #ifdef WIN32
25 + #include "utils/wingetopt.h"
26 + #else
27 + #include <getopt.h>
28 + #endif
29 +
30   #include "thermalizerCmd.h"
31  
32   const char *gengetopt_args_info_purpose = "Resamples the velocities for all the integrable objects in an OpenMD file from \na Maxwell-Boltzmann distribution.";
# Line 46 | Line 54 | static int
54   void clear_args (struct gengetopt_args_info *args_info);
55  
56   static int
57 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
57 > cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
58                          struct cmdline_parser_params *params, const char *additional_error);
59  
60   static int
# Line 67 | Line 75 | void clear_args (struct gengetopt_args_info *args_info
75   static
76   void clear_args (struct gengetopt_args_info *args_info)
77   {
78 +  FIX_UNUSED (args_info);
79    args_info->output_arg = NULL;
80    args_info->output_orig = NULL;
81    args_info->temperature_orig = NULL;
# Line 88 | Line 97 | cmdline_parser_print_version (void)
97   void
98   cmdline_parser_print_version (void)
99   {
100 <  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
100 >  printf ("%s %s\n",
101 >     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
102 >     CMDLINE_PARSER_VERSION);
103   }
104  
105   static void print_help_common(void) {
# Line 103 | Line 114 | static void print_help_common(void) {
114    printf("\n");
115  
116    if (strlen(gengetopt_args_info_description) > 0)
117 <    printf("%s\n", gengetopt_args_info_description);
117 >    printf("%s\n\n", gengetopt_args_info_description);
118   }
119  
120   void
# Line 122 | Line 133 | cmdline_parser_init (struct gengetopt_args_info *args_
133    clear_args (args_info);
134    init_args_info (args_info);
135  
136 <  args_info->inputs = NULL;
136 >  args_info->inputs = 0;
137    args_info->inputs_num = 0;
138   }
139  
# Line 179 | Line 190 | static void
190  
191  
192   static void
193 < write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
193 > write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
194   {
195 +  FIX_UNUSED (values);
196    if (arg) {
197      fprintf(outfile, "%s=\"%s\"\n", opt, arg);
198    } else {
# Line 244 | Line 256 | gengetopt_strdup (const char *s)
256   char *
257   gengetopt_strdup (const char *s)
258   {
259 <  char *result = NULL;
259 >  char *result = 0;
260    if (!s)
261      return result;
262  
# Line 256 | Line 268 | int
268   }
269  
270   int
271 < cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
271 > cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
272   {
273    return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
274   }
275  
276   int
277 < cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
277 > cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
278                     struct cmdline_parser_params *params)
279   {
280    int result;
281 <  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
281 >  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
282  
283    if (result == EXIT_FAILURE)
284      {
# Line 278 | Line 290 | int
290   }
291  
292   int
293 < cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
293 > cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
294   {
295    int result;
296    struct cmdline_parser_params params;
# Line 289 | Line 301 | cmdline_parser2 (int argc, char * const *argv, struct
301    params.check_ambiguity = 0;
302    params.print_errors = 1;
303  
304 <  result = cmdline_parser_internal (argc, argv, args_info, &params, NULL);
304 >  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
305  
306    if (result == EXIT_FAILURE)
307      {
# Line 305 | Line 317 | cmdline_parser_required (struct gengetopt_args_info *a
317   {
318    int result = EXIT_SUCCESS;
319  
320 <  if (cmdline_parser_required2(args_info, prog_name, NULL) > 0)
320 >  if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
321      result = EXIT_FAILURE;
322  
323    if (result == EXIT_FAILURE)
# Line 321 | Line 333 | cmdline_parser_required2 (struct gengetopt_args_info *
333   cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
334   {
335    int error = 0;
336 +  FIX_UNUSED (additional_error);
337  
338    /* checks for required options */
339    if (! args_info->output_given)
# Line 365 | Line 378 | int update_arg(void *field, char **orig_field,
378   static
379   int update_arg(void *field, char **orig_field,
380                 unsigned int *field_given, unsigned int *prev_given,
381 <               char *value, char *possible_values[], const char *default_value,
381 >               char *value, const char *possible_values[],
382 >               const char *default_value,
383                 cmdline_parser_arg_type arg_type,
384                 int check_ambiguity, int override,
385                 int no_free, int multiple_option,
# Line 376 | Line 390 | int update_arg(void *field, char **orig_field,
390    const char *val = value;
391    int found;
392    char **string_field;
393 +  FIX_UNUSED (field);
394  
395    stop_char = 0;
396    found = 0;
# Line 393 | Line 408 | int update_arg(void *field, char **orig_field,
408        return 1; /* failure */
409      }
410  
411 +  FIX_UNUSED (default_value);
412      
413    if (field_given && *field_given && ! override)
414      return 0;
# Line 452 | Line 468 | int
468  
469  
470   int
471 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
471 > cmdline_parser_internal (
472 >  int argc, char **argv, struct gengetopt_args_info *args_info,
473                          struct cmdline_parser_params *params, const char *additional_error)
474   {
475    int c;        /* Character of the parsed option.  */
# Line 491 | Line 508 | cmdline_parser_internal (int argc, char * const *argv,
508          { "version",    0, NULL, 'V' },
509          { "output",     1, NULL, 'o' },
510          { "temperature",        1, NULL, 't' },
511 <        { NULL, 0, NULL, 0 }
511 >        { 0,  0, 0, 0 }
512        };
513  
514        c = getopt_long (argc, argv, "hVo:t:", long_options, &option_index);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines