Changeset 1151


Ignore:
Timestamp:
Aug 11, 2003, 2:02:42 PM (17 years ago)
Author:
luba
Message:
  • milliseconds are represented as in old version;
  • checking of argument od type_int is added
Location:
to-imperative/trunk/library/Dos
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/library/Dos/exit.cc

    r1130 r1151  
    2929    else
    3030    if (p->get_type() == type_int) {
    31       rftype::Integer* num = p->cast_to<rftype::Integer>(type_int);
    32       if (num) {
     31      Integer* num = static_cast<Integer*>(p);
     32      if (num->cmp(0) < 0 || num->cmp(SIZE_MAX) > 0)
     33        RF_LIB_ERROR ("Invalid Argument");
     34      else {
    3335        n = num->to_int();
    3436        if (n < 0 || n > 255) {
     
    3739        else
    3840          exit(n);
     41      }
    3942    }
    4043    else
    4144      RF_LIB_ERROR ("Invalid Argument");
    42     }
    4345  }
    4446  else
  • to-imperative/trunk/library/Dos/time.cc

    r1130 r1151  
    2424  unsigned uu;
    2525
    26   setlocale(LC_TIME, "");
    27 
    2826  gettimeofday(&ttt,NULL);
    2927  lt = localtime (&(ttt.tv_sec));
     
    4341           Char::create_expr(":") +
    4442           Integer::create_expr((*lt).tm_sec) +
    45            Char::create_expr(".");
    46 
    47   if (uu < 10)
    48     e = e + Integer::create_expr(0) +
    49             Integer::create_expr(uu);
    50   else
    51     e = e + Integer::create_expr(uu);
     43           Char::create_expr(".") +
     44           Integer::create_expr(uu);
    5245
    5346  e_String = e;
Note: See TracChangeset for help on using the changeset viewer.