Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
aac28a18
Commit
aac28a18
authored
Aug 19, 2009
by
Michael Sherman
Browse files
Move static methods outside extern "C" so they can use C++ types.
parent
576751ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
wrappers/FortranWrapper_Source.xslt
wrappers/FortranWrapper_Source.xslt
+16
-14
No files found.
wrappers/FortranWrapper_Source.xslt
View file @
aac28a18
...
...
@@ -44,6 +44,22 @@
using namespace OpenMM;
using namespace std;
/* Utilities for dealing with Fortran's blank-padded strings. */
static void copyAndPadString(char* dest, const char* source, int length) {
bool reachedEnd = false;
for (int i = 0; i
<
length; i++) {
if (source[i] == 0)
reachedEnd = true;
dest[i] = (reachedEnd ? ' ' : source[i]);
}
}
static string makeString(const char* fsrc, int length) {
while (length
&&
fsrc[length-1]==' ')
--length;
return string(fsrc, length);
}
extern "C" {
/* OpenMM_Vec3 */
...
...
@@ -101,20 +117,6 @@ OPENMM_EXPORT void OPENMM_VEC3ARRAY_GET(const OpenMM_Vec3Array* const& array
}
/* OpenMM_StringArray */
static void copyAndPadString(char* dest, const char* source, int length) {
bool reachedEnd = false;
for (int i = 0; i
<
length; i++) {
if (source[i] == 0)
reachedEnd = true;
dest[i] = (reachedEnd ? ' ' : source[i]);
}
}
/* copy blank-trimmed Fortran string into an std::string */
static string makeString(const char* fsrc, int length) {
while (length
&&
fsrc[length-1]==' ')
--length;
return string(fsrc, length);
}
OPENMM_EXPORT void openmm_stringarray_create_(OpenMM_StringArray*
&
result, const int
&
size) {
result = OpenMM_StringArray_create(size);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment