Fix some 'widen' table entries.
authorMario de Sousa <msousa@fe.up.pt>
Sun, 11 Mar 2012 16:38:05 +0000
changeset 474 85cacf5298fb
parent 473 933d6c204607
child 475 28816126cf8d
Fix some 'widen' table entries.
stage3/datatype_functions.cc
--- a/stage3/datatype_functions.cc	Sat Mar 10 11:27:49 2012 +0000
+++ b/stage3/datatype_functions.cc	Sun Mar 11 16:38:05 2012 +0000
@@ -53,55 +53,100 @@
  */
 
 const struct widen_entry widen_ADD_table[] = {
-    { &search_constant_type_c::time_type_name,          &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name     , widen_entry::ok         },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::tod_type_name,             &search_constant_type_c::tod_type_name      , widen_entry::ok         },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::dt_type_name,              &search_constant_type_c::dt_type_name       , widen_entry::ok         },
-    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetime_type_name , widen_entry::ok         },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetod_type_name,         &search_constant_type_c::safetod_type_name  , widen_entry::ok         },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safedt_type_name,          &search_constant_type_c::safedt_type_name   , widen_entry::ok         },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name      , widen_entry::deprecated },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name      , widen_entry::ok         },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetime_type_name,        &search_constant_type_c::tod_type_name      , widen_entry::ok         },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetod_type_name  , widen_entry::ok         },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name       , widen_entry::deprecated },         
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name       , widen_entry::ok         },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safetime_type_name,        &search_constant_type_c::dt_type_name       , widen_entry::ok         },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safedt_type_name   , widen_entry::ok         },
+    { &search_constant_type_c::time_type_name,          &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name, widen_entry::ok         },
+    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name, widen_entry::deprecated },
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    { &search_constant_type_c::time_type_name,          &search_constant_type_c::tod_type_name,             &search_constant_type_c::tod_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    { &search_constant_type_c::time_type_name,          &search_constant_type_c::dt_type_name,              &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
+
+    /*******************************/
+    /* SAFE version on the left... */
+    /*******************************/
+    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name, widen_entry::ok         },
+    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name, widen_entry::deprecated },
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::tod_type_name,             &search_constant_type_c::tod_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::dt_type_name,              &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
+
+    /********************************/
+    /* SAFE version on the right... */
+    /********************************/
+    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetime_type_name,        &search_constant_type_c::time_type_name, widen_entry::ok         },
+    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetime_type_name,        &search_constant_type_c::tod_type_name, widen_entry::deprecated },
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetod_type_name,         &search_constant_type_c::tod_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safetime_type_name,        &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safedt_type_name,          &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
+
+    /*************************************/
+    /* SAFE version on left and right... */
+    /*************************************/
+    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetime_type_name, widen_entry::ok         },
+    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetod_type_name, widen_entry::deprecated },
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetod_type_name,         &search_constant_type_c::safetod_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safedt_type_name, widen_entry::deprecated },         
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safedt_type_name,          &search_constant_type_c::safedt_type_name, widen_entry::deprecated },
+   
     { NULL, NULL, NULL, widen_entry::ok },
 };
 
 
+
+
 const struct widen_entry widen_SUB_table[] = {
-    { &search_constant_type_c::time_type_name,          &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name     , widen_entry::ok         },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::tod_type_name,             &search_constant_type_c::tod_type_name      , widen_entry::ok         },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::dt_type_name,              &search_constant_type_c::dt_type_name       , widen_entry::deprecated },        
-    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetime_type_name , widen_entry::ok         },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetod_type_name,         &search_constant_type_c::safetod_type_name  , widen_entry::ok         },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safedt_type_name,          &search_constant_type_c::safedt_type_name   , widen_entry::ok         },
-
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name      , widen_entry::deprecated },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name      , widen_entry::ok         },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetime_type_name,        &search_constant_type_c::tod_type_name      , widen_entry::ok         },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetod_type_name  , widen_entry::ok         },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name       , widen_entry::deprecated },         
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name       , widen_entry::ok         },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safetime_type_name,        &search_constant_type_c::dt_type_name       , widen_entry::ok         },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safedt_type_name   , widen_entry::ok         },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::tod_type_name,             &search_constant_type_c::time_type_name     , widen_entry::ok         },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::tod_type_name,             &search_constant_type_c::time_type_name     , widen_entry::ok         },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetod_type_name,         &search_constant_type_c::time_type_name     , widen_entry::ok         },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetod_type_name,         &search_constant_type_c::safetime_type_name , widen_entry::ok         },
-    { &search_constant_type_c::date_type_name,          &search_constant_type_c::date_type_name,            &search_constant_type_c::time_type_name     , widen_entry::ok         },
-    { &search_constant_type_c::safedate_type_name,      &search_constant_type_c::date_type_name,            &search_constant_type_c::time_type_name     , widen_entry::ok         },
-    { &search_constant_type_c::date_type_name,          &search_constant_type_c::safedate_type_name,        &search_constant_type_c::time_type_name     , widen_entry::ok         },
-    { &search_constant_type_c::safedate_type_name,      &search_constant_type_c::safedate_type_name,        &search_constant_type_c::safetime_type_name , widen_entry::ok         },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::dt_type_name,              &search_constant_type_c::time_type_name     , widen_entry::ok         },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::dt_type_name,              &search_constant_type_c::time_type_name     , widen_entry::ok         },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safedt_type_name,          &search_constant_type_c::time_type_name     , widen_entry::ok         },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safedt_type_name,          &search_constant_type_c::safetime_type_name , widen_entry::ok         },
+    { &search_constant_type_c::time_type_name,          &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name, widen_entry::ok         },
+    { &search_constant_type_c::date_type_name,          &search_constant_type_c::date_type_name,            &search_constant_type_c::time_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::tod_type_name,             &search_constant_type_c::time_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::dt_type_name,              &search_constant_type_c::time_type_name, widen_entry::deprecated },        
+
+    /*******************************/
+    /* SAFE version on the left... */
+    /*******************************/
+    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name, widen_entry::ok         },
+    { &search_constant_type_c::safedate_type_name,      &search_constant_type_c::date_type_name,            &search_constant_type_c::time_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::tod_type_name,             &search_constant_type_c::time_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::dt_type_name,              &search_constant_type_c::time_type_name, widen_entry::deprecated },        
+
+    /********************************/
+    /* SAFE version on the right... */
+    /********************************/
+    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetime_type_name,            &search_constant_type_c::time_type_name, widen_entry::ok         },
+    { &search_constant_type_c::date_type_name,          &search_constant_type_c::safedate_type_name,            &search_constant_type_c::time_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetime_type_name,            &search_constant_type_c::tod_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetod_type_name,             &search_constant_type_c::time_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safetime_type_name,            &search_constant_type_c::dt_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safedt_type_name,              &search_constant_type_c::time_type_name, widen_entry::deprecated },        
+
+    /*************************************/
+    /* SAFE version on left and right... */
+    /*************************************/
+    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetime_type_name,            &search_constant_type_c::safetime_type_name, widen_entry::ok         },
+    { &search_constant_type_c::safedate_type_name,      &search_constant_type_c::safedate_type_name,            &search_constant_type_c::safetime_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetime_type_name,            &search_constant_type_c::safetod_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetod_type_name,             &search_constant_type_c::safetime_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safetime_type_name,            &search_constant_type_c::safedt_type_name, widen_entry::deprecated },
+    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safedt_type_name,              &search_constant_type_c::safetime_type_name, widen_entry::deprecated },        
+
     { NULL, NULL, NULL, widen_entry::ok },
 };
 
+
+
+
+
+
+
 const struct widen_entry widen_MUL_table[] = {
     { &search_constant_type_c::time_type_name,          &search_constant_type_c::lreal_type_name,           &search_constant_type_c::time_type_name     , widen_entry::deprecated },
     { &search_constant_type_c::time_type_name,          &search_constant_type_c::real_type_name,            &search_constant_type_c::time_type_name     , widen_entry::deprecated },