Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
d71008ff
Commit
d71008ff
authored
8 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
wasn't directly decrementing loop variable, use better names in swap_loop macro.
parent
9d65b220
No related branches found
No related tags found
1 merge request
!294
Buffered cell_split
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/memswap.h
+10
-9
10 additions, 9 deletions
src/memswap.h
with
10 additions
and
9 deletions
src/memswap.h
+
10
−
9
View file @
d71008ff
...
...
@@ -32,15 +32,16 @@
#include
<altivec.h>
#endif
/* Macro for in-place swap of two values a and b of type t. */
#define swap_loop(t, a, b, c) \
while (c >= sizeof(t)) { \
register t temp = *(t *)a; \
*(t *)a = *(t *)b; \
*(t *)b = temp; \
a += sizeof(t); \
b += sizeof(t); \
bytes -= sizeof(t); \
/* Macro for in-place swap of two values a and b of type t. a and b are
assumed to be of type char* so that the pointer arithmetic works. */
#define swap_loop(type, a, b, count) \
while (count >= sizeof(type)) { \
register type temp = *(type *)a; \
*(type *)a = *(type *)b; \
*(type *)b = temp; \
a += sizeof(type); \
b += sizeof(type); \
count -= sizeof(type); \
}
/**
...
...
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