From 398ac5f01c6d99c7167c7fafb67d7ea695e08e47 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 18 Dec 2018 18:53:31 +0000 Subject: [PATCH] Remove redundant Python options: -nocastmode -nodirvtable -noextranative -nofastproxy Also remove redundant %module options: nocastmode, noextranative Issue #1340 --- Examples/test-suite/li_implicit.i | 5 ++++- Source/Modules/python.cxx | 28 +++++++++------------------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/Examples/test-suite/li_implicit.i b/Examples/test-suite/li_implicit.i index 0ce10dd6e..9f3ea318b 100644 --- a/Examples/test-suite/li_implicit.i +++ b/Examples/test-suite/li_implicit.i @@ -1,4 +1,7 @@ -%module("nocastmode") li_implicit +%module li_implicit + +// Tests nocastmode + #pragma SWIG nowarn=SWIGWARN_PP_CPP_WARNING %include implicit.i diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 6b3c9ef40..4aeb388b8 100755 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -119,11 +119,7 @@ Python Options (available with -python)\n\ -keyword - Use keyword arguments\n"; static const char *usage2 = "\ -newvwm - New value wrapper mode, use only when everything else fails\n\ - -nocastmode - Disable the casting mode (default)\n\ - -nodirvtable - Don't use the virtual table feature, resolve the python method each time (default)\n\ - -noextranative - Don't use extra native C++ wraps for std containers when possible (default)\n\ - -nofastproxy - Use traditional proxy mechanism for member methods (default)\n\ - -nofastunpack - Use traditional UnpackTuple method to parse the argument functions (default)\n\ + -nofastunpack - Use traditional UnpackTuple method to parse the argument functions\n\ -noh - Don't generate the output header file\n"; static const char *usage3 = "\ -noproxy - Don't generate proxy classes\n\ @@ -350,9 +346,6 @@ public: } else if (strcmp(argv[i], "-dirvtable") == 0) { dirvtable = 1; Swig_mark_arg(i); - } else if (strcmp(argv[i], "-nodirvtable") == 0) { - dirvtable = 0; - Swig_mark_arg(i); } else if (strcmp(argv[i], "-doxygen") == 0) { doxygen = 1; scan_doxygen_comments = 1; @@ -369,24 +362,15 @@ public: } else if (strcmp(argv[i], "-fastproxy") == 0) { fastproxy = 1; Swig_mark_arg(i); - } else if (strcmp(argv[i], "-nofastproxy") == 0) { - fastproxy = 0; - Swig_mark_arg(i); } else if (strcmp(argv[i], "-olddefs") == 0) { olddefs = 1; Swig_mark_arg(i); } else if (strcmp(argv[i], "-castmode") == 0) { castmode = 1; Swig_mark_arg(i); - } else if (strcmp(argv[i], "-nocastmode") == 0) { - castmode = 0; - Swig_mark_arg(i); } else if (strcmp(argv[i], "-extranative") == 0) { extranative = 1; Swig_mark_arg(i); - } else if (strcmp(argv[i], "-noextranative") == 0) { - extranative = 0; - Swig_mark_arg(i); } else if (strcmp(argv[i], "-noh") == 0) { no_header_file = 1; Swig_mark_arg(i); @@ -434,8 +418,12 @@ public: strcmp(argv[i], "-newrepr") == 0 || strcmp(argv[i], "-noaliasobj0") == 0 || strcmp(argv[i], "-nobuildnone") == 0 || + strcmp(argv[i], "-nocastmode") == 0 || strcmp(argv[i], "-nocppcast") == 0 || + strcmp(argv[i], "-nodirvtable") == 0 || + strcmp(argv[i], "-noextranative") == 0 || strcmp(argv[i], "-nofastinit") == 0 || + strcmp(argv[i], "-nofastproxy") == 0 || strcmp(argv[i], "-nofastquery") == 0 || strcmp(argv[i], "-nomodern") == 0 || strcmp(argv[i], "-nomodernargs") == 0 || @@ -506,13 +494,15 @@ public: castmode = 1; } if (Getattr(options, "nocastmode")) { - castmode = 0; + Printf(stderr, "Deprecated module option: %s. This option is no longer supported.\n", "nocastmode"); + SWIG_exit(EXIT_FAILURE); } if (Getattr(options, "extranative")) { extranative = 1; } if (Getattr(options, "noextranative")) { - extranative = 0; + Printf(stderr, "Deprecated module option: %s. This option is no longer supported.\n", "noextranative"); + SWIG_exit(EXIT_FAILURE); } if (Getattr(options, "outputtuple")) { Printf(stderr, "Deprecated module option: %s. This option is no longer supported.\n", "outputtuple");