Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xtc-length
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
James Graham
xtc-length
Commits
a29e816a
Commit
a29e816a
authored
9 years ago
by
James Graham
Browse files
Options
Downloads
Patches
Plain Diff
Changed to fskipo from POSIX - requires gnu extensions with GCC, clang
is fine
parent
b2cc72a3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+2
-2
2 additions, 2 deletions
CMakeLists.txt
xtc-length.c
+2
-2
2 additions, 2 deletions
xtc-length.c
with
4 additions
and
4 deletions
CMakeLists.txt
+
2
−
2
View file @
a29e816a
project
(
xtc-length
)
project
(
xtc-length
)
if
(
CMAKE_
VERSION VERSION_GREATER
"3.1
"
)
if
(
"
${
CMAKE_
C_COMPILER_ID
}
"
STREQUAL
"GNU
"
)
set
(
CMAKE_C_
STANDARD 99
)
set
(
CMAKE_C_
FLAGS
"
${
CMAKE_C_FLAGS
}
-std=gnu90"
)
endif
()
endif
()
add_executable
(
xtc-length xtc-length.c
)
add_executable
(
xtc-length xtc-length.c
)
This diff is collapsed.
Click to expand it.
xtc-length.c
+
2
−
2
View file @
a29e816a
#include
<stdio.h>
#include
<stdio.h>
#include
<int
types
.h>
#include
<
std
int.h>
#include
<locale.h>
#include
<locale.h>
#include
<string.h>
#include
<string.h>
...
@@ -33,7 +33,7 @@ int get_xtc_num_frames(const char *filename, int *nframes, int *natoms, float *p
...
@@ -33,7 +33,7 @@ int get_xtc_num_frames(const char *filename, int *nframes, int *natoms, float *p
*
natoms
=
u4_from_buffer
(
header
+
4
);
*
natoms
=
u4_from_buffer
(
header
+
4
);
uint32_t
frame_size
=
u4_from_buffer
(
header
+
88
);
// Read frame size from header
uint32_t
frame_size
=
u4_from_buffer
(
header
+
88
);
// Read frame size from header
uint32_t
skip
=
(
frame_size
+
3
)
&
~
((
uint32_t
)
3
);
// Round up to 4 bytes
uint32_t
skip
=
(
frame_size
+
3
)
&
~
((
uint32_t
)
3
);
// Round up to 4 bytes
fseek
(
xtc
,
skip
,
SEEK_CUR
);
// Skip to next header
fseek
o
(
xtc
,
skip
,
SEEK_CUR
);
// Skip to next header
}
}
uint32_t
ps_tmp
=
u4_from_buffer
(
header
+
12
);
uint32_t
ps_tmp
=
u4_from_buffer
(
header
+
12
);
memcpy
(
psec
,
&
ps_tmp
,
4
);
memcpy
(
psec
,
&
ps_tmp
,
4
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment