Skip to content

Commit 0438be6

Browse files
authored
Merge pull request #52 from OpenWaterAnalytics/dev-cleanup
SWIG development cleanup
2 parents 8d8d4b0 + a1643f0 commit 0438be6

File tree

10 files changed

+320
-375
lines changed

10 files changed

+320
-375
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
!.git*
66

7+
.vscode
8+
79
.DS_Store
810

911
*.pyc

swmm-toolkit/LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,4 @@ For more information, please see
156156
# Third-Party Libraries
157157

158158

159-
## SWMM
159+
## OWA SWMM

swmm-toolkit/src/swmm/toolkit/output.i

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,16 @@
2929
%delobject SMO_close;
3030

3131

32-
/* TYPEMAPS FOR VOID POINTER */
32+
/* TYPEMAPS FOR HANDLE POINTER */
3333
/* Used for functions that output a new opaque pointer */
34-
%typemap(in, numinputs=0) SMO_Handle *p_handle (void *retval)
35-
{
36-
/* OUTPUT in */
37-
retval = NULL;
38-
$1 = &retval;
34+
%typemap(in,numinputs=0) SMO_Handle *p_handle (SMO_Handle temp) {
35+
$1 = &temp;
3936
}
4037
/* used for functions that take in an opaque pointer (or NULL)
4138
and return a (possibly) different pointer */
42-
%typemap(argout) SMO_Handle *p_handle
43-
{
44-
/* OUTPUT argout */
45-
%append_output(SWIG_NewPointerObj(SWIG_as_voidptr(retval$argnum), $1_descriptor, 0));
46-
}
47-
%typemap(in) SMO_Handle *p_handle_inout (SMO_Handle retval)
48-
{
49-
/* INOUT in */
50-
SWIG_ConvertPtr($input, SWIG_as_voidptrptr(&retval), 0, 0);
51-
$1 = &retval;
39+
%typemap(argout) SMO_Handle *p_handle {
40+
%append_output(SWIG_NewPointerObj(*$1, SWIGTYPE_p_Handle, SWIG_POINTER_NEW));
5241
}
53-
/* No need for special IN typemap for opaque pointers, it works anyway */
5442

5543

5644
/* TYPEMAP FOR IGNORING INT ERROR CODE RETURN VALUE */

0 commit comments

Comments
 (0)