Mercurial > ~dholland > hg > tradcpp > index.cgi
comparison main.c @ 37:70902cac4170
Sort the option lists to match the comparison used to search them. duh.
Also don't assert on the incpaths during shutdown.
author | David A. Holland |
---|---|
date | Sat, 30 Mar 2013 20:52:59 -0400 |
parents | 76c114899f63 |
children | b156910b59b2 |
comparison
equal
deleted
inserted
replaced
36:a489cc223483 | 37:70902cac4170 |
---|---|
313 | 313 |
314 static | 314 static |
315 void | 315 void |
316 incpath_cleanup(void) | 316 incpath_cleanup(void) |
317 { | 317 { |
318 stringarray_setsize(&incpath_quote, 0); | |
319 stringarray_setsize(&incpath_user, 0); | |
320 stringarray_setsize(&incpath_system, 0); | |
321 stringarray_setsize(&incpath_late, 0); | |
322 | |
318 stringarray_cleanup(&incpath_quote); | 323 stringarray_cleanup(&incpath_quote); |
319 stringarray_cleanup(&incpath_user); | 324 stringarray_cleanup(&incpath_user); |
320 stringarray_cleanup(&incpath_system); | 325 stringarray_cleanup(&incpath_system); |
321 stringarray_cleanup(&incpath_late); | 326 stringarray_cleanup(&incpath_late); |
322 } | 327 } |
710 }; | 715 }; |
711 | 716 |
712 static const struct flag_option flag_options[] = { | 717 static const struct flag_option flag_options[] = { |
713 { "C", &mode.output_retain_comments, true }, | 718 { "C", &mode.output_retain_comments, true }, |
714 { "CC", &mode.output_retain_comments, true }, | 719 { "CC", &mode.output_retain_comments, true }, |
715 { "fdollars-in-identifiers", &mode.input_allow_dollars, true }, | |
716 { "fno-dollars-in-identifiers", &mode.input_allow_dollars, false }, | |
717 { "MG", &mode.depend_assume_generated, true }, | 720 { "MG", &mode.depend_assume_generated, true }, |
718 { "MP", &mode.depend_issue_fakerules, true }, | 721 { "MP", &mode.depend_issue_fakerules, true }, |
719 { "nostdinc", &mode.do_stdinc, false }, | |
720 { "P", &mode.output_linenumbers, false }, | 722 { "P", &mode.output_linenumbers, false }, |
721 { "undef", &mode.do_stddef, false }, | |
722 { "Wcomment", &warns.nestcomment, true }, | 723 { "Wcomment", &warns.nestcomment, true }, |
723 { "Wendif-labels", &warns.endiflabels, true }, | 724 { "Wendif-labels", &warns.endiflabels, true }, |
724 { "Werror", &mode.werror, true }, | 725 { "Werror", &mode.werror, true }, |
725 { "Wno-comment", &warns.nestcomment, false }, | 726 { "Wno-comment", &warns.nestcomment, false }, |
726 { "Wno-endif-labels", &warns.endiflabels, false }, | 727 { "Wno-endif-labels", &warns.endiflabels, false }, |
727 { "Wno-error", &mode.werror, false }, | 728 { "Wno-error", &mode.werror, false }, |
728 { "Wno-undef", &warns.undef, false }, | 729 { "Wno-undef", &warns.undef, false }, |
729 { "Wno-unused-macros", &warns.unused, false }, | 730 { "Wno-unused-macros", &warns.unused, false }, |
730 { "Wundef", &warns.undef, true }, | 731 { "Wundef", &warns.undef, true }, |
731 { "Wunused-macros", &warns.unused, true }, | 732 { "Wunused-macros", &warns.unused, true }, |
733 { "fdollars-in-identifiers", &mode.input_allow_dollars, true }, | |
734 { "fno-dollars-in-identifiers", &mode.input_allow_dollars, false }, | |
735 { "nostdinc", &mode.do_stdinc, false }, | |
736 { "undef", &mode.do_stddef, false }, | |
732 }; | 737 }; |
733 static const unsigned num_flag_options = HOWMANY(flag_options); | 738 static const unsigned num_flag_options = HOWMANY(flag_options); |
734 | 739 |
735 static const struct act_option act_options[] = { | 740 static const struct act_option act_options[] = { |
736 { "dD", commandline_dD }, | |
737 { "dI", commandline_dI }, | |
738 { "dM", commandline_dM }, | |
739 { "dN", commandline_dN }, | |
740 { "H", commandline_H }, | 741 { "H", commandline_H }, |
741 { "M", commandline_M }, | 742 { "M", commandline_M }, |
742 { "MD", commandline_MD }, | 743 { "MD", commandline_MD }, |
743 { "MM", commandline_MM }, | 744 { "MM", commandline_MM }, |
744 { "MMD", commandline_MMD }, | 745 { "MMD", commandline_MMD }, |
745 { "Wall", commandline_wall }, | 746 { "Wall", commandline_wall }, |
746 { "Wno-all", commandline_wnoall }, | 747 { "Wno-all", commandline_wnoall }, |
748 { "dD", commandline_dD }, | |
749 { "dI", commandline_dI }, | |
750 { "dM", commandline_dM }, | |
751 { "dN", commandline_dN }, | |
747 { "w", commandline_wnone }, | 752 { "w", commandline_wnone }, |
748 }; | 753 }; |
749 static const unsigned num_act_options = HOWMANY(act_options); | 754 static const unsigned num_act_options = HOWMANY(act_options); |
750 | 755 |
751 static const struct prefix_option prefix_options[] = { | 756 static const struct prefix_option prefix_options[] = { |
752 { "D", commandline_def }, | 757 { "D", commandline_def }, |
758 { "I", commandline_addincpath_user }, | |
759 { "U", commandline_undef }, | |
753 { "ftabstop=", commandline_tabstop }, | 760 { "ftabstop=", commandline_tabstop }, |
754 { "I", commandline_addincpath_user }, | |
755 { "std=", commandline_setstd }, | 761 { "std=", commandline_setstd }, |
756 { "U", commandline_undef }, | |
757 }; | 762 }; |
758 static const unsigned num_prefix_options = HOWMANY(prefix_options); | 763 static const unsigned num_prefix_options = HOWMANY(prefix_options); |
759 | 764 |
760 static const struct arg_option arg_options[] = { | 765 static const struct arg_option arg_options[] = { |
766 { "MF", commandline_setdependoutput }, | |
767 { "MQ", commandline_setdependtarget_quoted }, | |
768 { "MT", commandline_setdependtarget }, | |
761 { "idirafter", commandline_addincpath_late }, | 769 { "idirafter", commandline_addincpath_late }, |
762 { "imacros", commandline_addfile_nooutput }, | 770 { "imacros", commandline_addfile_nooutput }, |
763 { "include", commandline_addfile_output }, | 771 { "include", commandline_addfile_output }, |
764 { "iprefix", commandline_setprefix }, | 772 { "iprefix", commandline_setprefix }, |
765 { "iquote", commandline_addincpath_quote }, | 773 { "iquote", commandline_addincpath_quote }, |
766 { "iremap", commandline_iremap }, | 774 { "iremap", commandline_iremap }, |
767 { "isysroot", commandline_isysroot }, | 775 { "isysroot", commandline_isysroot }, |
768 { "isystem", commandline_addincpath_system }, | 776 { "isystem", commandline_addincpath_system }, |
769 { "iwithprefix", commandline_addincpath_late_withprefix }, | 777 { "iwithprefix", commandline_addincpath_late_withprefix }, |
770 { "iwithprefixbefore", commandline_addincpath_user_withprefix }, | 778 { "iwithprefixbefore", commandline_addincpath_user_withprefix }, |
771 { "MF", commandline_setdependoutput }, | |
772 { "MT", commandline_setdependtarget }, | |
773 { "MQ", commandline_setdependtarget_quoted }, | |
774 { "x", commandline_setlang }, | 779 { "x", commandline_setlang }, |
775 }; | 780 }; |
776 static const unsigned num_arg_options = HOWMANY(arg_options); | 781 static const unsigned num_arg_options = HOWMANY(arg_options); |
777 | 782 |
778 static | 783 static |