Skip to content
Snippets Groups Projects
Commit 72f61b88 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Val: Fixed several warnings.

Fall-out from the operator assignment type checker.

Fixes #10042.
parent a21c775e
No related branches found
No related tags found
No related merge requests found
...@@ -597,9 +597,9 @@ class Interval { ...@@ -597,9 +597,9 @@ class Interval {
protected mixed `*(mixed that) { protected mixed `*(mixed that) {
this_program n = this_program(this); this_program n = this_program(this);
if (intp(that)) { if (intp(that)) {
n->nsecs *= that; n->nsecs *= [int]that;
n->days *= that; n->days *= [int]that;
n->months *= that; n->months *= [int]that;
} else if (floatp(that)) { } else if (floatp(that)) {
n->nsecs = (int)(nsecs * that); n->nsecs = (int)(nsecs * that);
n->days = (int)(days * that); n->days = (int)(days * that);
...@@ -627,9 +627,9 @@ class Interval { ...@@ -627,9 +627,9 @@ class Interval {
if (!objectp(that) || !([object]that)->is_interval) if (!objectp(that) || !([object]that)->is_interval)
error("Cannot add %O\n", that); error("Cannot add %O\n", that);
this_program n = this_program(this); this_program n = this_program(this);
n->nsecs += ([object]that)->nsecs; n->nsecs += ([object(this_program)]that)->nsecs;
n->days += ([object]that)->days; n->days += ([object(this_program)]that)->days;
n->months += ([object]that)->months; n->months += ([object(this_program)]that)->months;
return n; return n;
} }
...@@ -642,9 +642,9 @@ class Interval { ...@@ -642,9 +642,9 @@ class Interval {
} else if (!objectp(that) || !([object]that)->is_interval) } else if (!objectp(that) || !([object]that)->is_interval)
error("Cannot substract %O\n", that); error("Cannot substract %O\n", that);
else { else {
n->nsecs -= ([object]that)->nsecs; n->nsecs -= ([object(this_program)]that)->nsecs;
n->days -= ([object]that)->days; n->days -= ([object(this_program)]that)->days;
n->months -= ([object]that)->months; n->months -= ([object(this_program)]that)->months;
} }
return n; return n;
} }
...@@ -862,14 +862,14 @@ class Date { ...@@ -862,14 +862,14 @@ class Date {
object n = this_program(this); object n = this_program(this);
if (objectp(that)) { if (objectp(that)) {
if (([object]that)->is_interval) { if (([object]that)->is_interval) {
n->days += ([object]that)->days; n->days += ([object(Interval)]that)->days;
if(([object]that)->months) { if(([object]that)->months) {
mapping(string:int) t = [mapping(string:int)]n->tm(); mapping(string:int) t = [mapping(string:int)]n->tm();
t->mon += ([object]that)->months; t->mon += ([object(Interval)]that)->months;
n = this_program(t); n = this_program(t);
} }
if (([object]that)->nsecs) if (([object]that)->nsecs)
(n = Timestamp(n))->nsecs += ([object]that)->nsecs; (n = Timestamp(n))->nsecs += ([object(Interval)]that)->nsecs;
} else if (([object]that)->is_time) { } else if (([object]that)->is_time) {
mapping(string:int) t = [mapping(string:int)]n->tm() mapping(string:int) t = [mapping(string:int)]n->tm()
+ [mapping(string:int)]([object]that)->tm(); + [mapping(string:int)]([object]that)->tm();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment