summaryrefslogtreecommitdiff
path: root/saa.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-10 09:35:26 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-10 09:35:26 -0700
commit51997d3d44a9279508b16e9f3d5e2de173ece7c2 (patch)
treedfd4e490aa051890565126e945daa4618a4464e4 /saa.c
parent8cc5aa78291843c10931ed3c738290df0b643279 (diff)
downloadnasm-51997d3d44a9279508b16e9f3d5e2de173ece7c2.tar.gz
nasm-51997d3d44a9279508b16e9f3d5e2de173ece7c2.tar.bz2
nasm-51997d3d44a9279508b16e9f3d5e2de173ece7c2.zip
Introduce likely/unlikely macros, use them in saa.c
Introduce the likely() and unlikely() macros, as used in Linux. They are compiler-dependent hints that a particular boolean expression is likely to be true or false, respectively. Currently only implemented for gcc.
Diffstat (limited to 'saa.c')
-rw-r--r--saa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/saa.c b/saa.c
index 51123da..1704b7d 100644
--- a/saa.c
+++ b/saa.c
@@ -211,7 +211,7 @@ void saa_fread(struct SAA *s, size_t posn, void *data, size_t len)
return;
}
- if (s->blk_len == SAA_BLKLEN) {
+ if (likely(s->blk_len == SAA_BLKLEN)) {
ix = posn >> SAA_BLKSHIFT;
s->rpos = posn & (SAA_BLKLEN-1);
} else {
@@ -235,7 +235,7 @@ void saa_fwrite(struct SAA *s, size_t posn, const void *data, size_t len)
return;
}
- if (s->blk_len == SAA_BLKLEN) {
+ if (likely(s->blk_len == SAA_BLKLEN)) {
ix = posn >> SAA_BLKSHIFT;
s->wpos = posn & (SAA_BLKLEN-1);
} else {