summaryrefslogtreecommitdiff
path: root/src/sar.h
diff options
context:
space:
mode:
authoraliaspider2015-11-09 19:55:28 +0100
committeraliaspider2015-11-09 19:55:28 +0100
commit7a7857f47b33f1b63fb585d2dc6c60d87c3e928f (patch)
treea4c271ae26c4b5ec9566f37062168e6d2c8c1bbc /src/sar.h
parent5339c79ebd36afa759541d0c2fbdadac6dd26ed2 (diff)
downloadsnes9x2002-7a7857f47b33f1b63fb585d2dc6c60d87c3e928f.tar.gz
snes9x2002-7a7857f47b33f1b63fb585d2dc6c60d87c3e928f.tar.bz2
snes9x2002-7a7857f47b33f1b63fb585d2dc6c60d87c3e928f.zip
C++ --> C99
Diffstat (limited to 'src/sar.h')
-rw-r--r--src/sar.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/sar.h b/src/sar.h
index 1c62aa0..390114b 100644
--- a/src/sar.h
+++ b/src/sar.h
@@ -96,31 +96,34 @@ typedef int int32;
#endif
#ifdef RIGHTSHIFT_IS_SAR
-#define SAR(b, n) ((b)>>(n))
+#define SAR8(b, n) ((b)>>(n))
+#define SAR16(b, n) ((b)>>(n))
+#define SAR32(b, n) ((b)>>(n))
+#define SAR64(b, n) ((b)>>(n))
#else
-static inline int8 SAR(const int8 b, const int n){
+static inline int8 SAR8(const int8 b, const int n){
#ifndef RIGHTSHIFT_INT8_IS_SAR
if(b<0) return (b>>n)|(-1<<(8-n));
#endif
return b>>n;
}
-static inline int16 SAR(const int16 b, const int n){
+static inline int16 SAR16(const int16 b, const int n){
#ifndef RIGHTSHIFT_INT16_IS_SAR
if(b<0) return (b>>n)|(-1<<(16-n));
#endif
return b>>n;
}
-static inline int32 SAR(const int32 b, const int n){
+static inline int32 SAR32(const int32 b, const int n){
#ifndef RIGHTSHIFT_INT32_IS_SAR
if(b<0) return (b>>n)|(-1<<(32-n));
#endif
return b>>n;
}
-static inline int64 SAR(const int64 b, const int n){
+static inline int64 SAR64(const int64 b, const int n){
#ifndef RIGHTSHIFT_INT64_IS_SAR
if(b<0) return (b>>n)|(-1<<(64-n));
#endif