aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMax Horn2009-09-25 13:01:35 +0000
committerMax Horn2009-09-25 13:01:35 +0000
commit4221773f6a5f470cdd1df5b9224c442a458f5047 (patch)
treed1aee0c010d4ebe3ac18f056ea0188e3872b122c /engines/sci
parentd374d7d5f42f83b2509fd6288ee7f768101714e9 (diff)
downloadscummvm-rg350-4221773f6a5f470cdd1df5b9224c442a458f5047.tar.gz
scummvm-rg350-4221773f6a5f470cdd1df5b9224c442a458f5047.tar.bz2
scummvm-rg350-4221773f6a5f470cdd1df5b9224c442a458f5047.zip
SCI: Pedantic cleanup
svn-id: r44356
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kmath.cpp4
-rw-r--r--engines/sci/engine/kmisc.cpp18
2 files changed, 11 insertions, 11 deletions
diff --git a/engines/sci/engine/kmath.cpp b/engines/sci/engine/kmath.cpp
index 180271bb78..97f3ca4382 100644
--- a/engines/sci/engine/kmath.cpp
+++ b/engines/sci/engine/kmath.cpp
@@ -113,14 +113,14 @@ reg_t kTimesSin(EngineState *s, int, int argc, reg_t *argv) {
int angle = argv[0].toSint16();
int factor = argv[1].toSint16();
- return make_reg(0, (int)(factor * 1.0 * sin(angle * PI / 180.0)));
+ return make_reg(0, (int)(factor * sin(angle * PI / 180.0)));
}
reg_t kTimesCos(EngineState *s, int, int argc, reg_t *argv) {
int angle = argv[0].toSint16();
int factor = argv[1].toSint16();
- return make_reg(0, (int)(factor * 1.0 * cos(angle * PI / 180.0)));
+ return make_reg(0, (int)(factor * cos(angle * PI / 180.0)));
}
reg_t kCosDiv(EngineState *s, int, int argc, reg_t *argv) {
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 550fd789a2..1ec2ffee1c 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -72,7 +72,7 @@ enum kMemoryInfoFunc {
};
reg_t kMemoryInfo(EngineState *s, int, int argc, reg_t *argv) {
- uint16 size = 0x7fff; // Must not be 0xffff, or some memory calculations will overflow
+ const uint16 size = 0x7fff; // Must not be 0xffff, or some memory calculations will overflow
switch (argv[0].offset) {
case K_MEMORYINFO_LARGEST_HEAP_BLOCK:
@@ -107,10 +107,10 @@ reg_t kSetDebug(EngineState *s, int, int argc, reg_t *argv) {
}
enum {
- _K_NEW_GETTIME_TICKS = 0,
- _K_NEW_GETTIME_TIME_12HOUR = 1,
- _K_NEW_GETTIME_TIME_24HOUR = 2,
- _K_NEW_GETTIME_DATE = 3
+ K_NEW_GETTIME_TICKS = 0,
+ K_NEW_GETTIME_TIME_12HOUR = 1,
+ K_NEW_GETTIME_TIME_24HOUR = 2,
+ K_NEW_GETTIME_DATE = 3
};
reg_t kGetTime(EngineState *s, int, int argc, reg_t *argv) {
@@ -130,19 +130,19 @@ reg_t kGetTime(EngineState *s, int, int argc, reg_t *argv) {
int mode = (argc > 0) ? argv[0].toUint16() : 0;
switch (mode) {
- case _K_NEW_GETTIME_TICKS :
+ case K_NEW_GETTIME_TICKS :
retval = start_time * 60 / 1000;
debugC(2, kDebugLevelTime, "GetTime(elapsed) returns %d", retval);
break;
- case _K_NEW_GETTIME_TIME_12HOUR :
+ case K_NEW_GETTIME_TIME_12HOUR :
retval = ((loc_time.tm_hour % 12) << 12) | (loc_time.tm_min << 6) | (loc_time.tm_sec);
debugC(2, kDebugLevelTime, "GetTime(12h) returns %d", retval);
break;
- case _K_NEW_GETTIME_TIME_24HOUR :
+ case K_NEW_GETTIME_TIME_24HOUR :
retval = (loc_time.tm_hour << 11) | (loc_time.tm_min << 5) | (loc_time.tm_sec >> 1);
debugC(2, kDebugLevelTime, "GetTime(24h) returns %d", retval);
break;
- case _K_NEW_GETTIME_DATE :
+ case K_NEW_GETTIME_DATE :
retval = loc_time.tm_mday | ((loc_time.tm_mon + 1) << 5) | (((loc_time.tm_year + 1900) & 0x7f) << 9);
debugC(2, kDebugLevelTime, "GetTime(date) returns %d", retval);
break;