[Tinyos-commits]
CVS: tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime
FNseqM.nc, 1.8, 1.9
David Gay
idgay at users.sourceforge.net
Sat Oct 29 10:25:44 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31172/mate/runtime
Modified Files:
FNseqM.nc
Log Message:
length for lists
Index: FNseqM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime/FNseqM.nc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** FNseqM.nc 28 Oct 2005 03:21:21 -0000 1.8
--- FNseqM.nc 29 Oct 2005 17:25:42 -0000 1.9
***************
*** 194,200 ****
}
! //FN length: x -> n. Return length of vector or string
command result_t Length.execute(uint8_t instr, MateContext* context) {
mvalue x = call S.pop(context, 1);
if (call T.vectorp(x))
--- 194,201 ----
}
! //FN length: x -> n. Return length of list, vector or string
command result_t Length.execute(uint8_t instr, MateContext* context) {
mvalue x = call S.pop(context, 1);
+ msize len;
if (call T.vectorp(x))
***************
*** 202,207 ****
else if (call T.stringp(x))
call S.qpush(context, call T.make_int(call T.string_length(call T.string(x))));
! else
! call E.error(context, MOTLLE_ERROR_BAD_TYPE);
return SUCCESS;
}
--- 203,208 ----
else if (call T.stringp(x))
call S.qpush(context, call T.make_int(call T.string_length(call T.string(x))));
! else if (valid_list(context, l, &len))
! call S.qpush(context, call T.make_int(len));
return SUCCESS;
}
More information about the Tinyos-commits
mailing list