* library_init::library_init(): It suffices to static_cast<> the flyweights
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 12 Apr 2004 01:42:18 +0000 (01:42 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 12 Apr 2004 01:42:18 +0000 (01:42 +0000)
  at initialization -- reinterpret_cast<> is overkill.

ginac/utils.cpp

index 7964825858b64b98f4a760f471fb9188aed4c9a3..390036c5d495cfb0e4940a044cf933940ca336d3 100644 (file)
@@ -313,56 +313,56 @@ const ex _ex120 = _num120;
 library_init::library_init()
 {
        if (count++==0) {
-               _num_120_p= reinterpret_cast<const numeric*>(&((new numeric(-120))->setflag(status_flags::dynallocated)));
-               _num_60_p = reinterpret_cast<const numeric*>(&((new numeric(-60))->setflag(status_flags::dynallocated)));
-               _num_48_p = reinterpret_cast<const numeric*>(&((new numeric(-48))->setflag(status_flags::dynallocated)));
-               _num_30_p = reinterpret_cast<const numeric*>(&((new numeric(-30))->setflag(status_flags::dynallocated)));
-               _num_25_p = reinterpret_cast<const numeric*>(&((new numeric(-25))->setflag(status_flags::dynallocated)));
-               _num_24_p = reinterpret_cast<const numeric*>(&((new numeric(-24))->setflag(status_flags::dynallocated)));
-               _num_20_p = reinterpret_cast<const numeric*>(&((new numeric(-20))->setflag(status_flags::dynallocated)));
-               _num_18_p = reinterpret_cast<const numeric*>(&((new numeric(-18))->setflag(status_flags::dynallocated)));
-               _num_15_p = reinterpret_cast<const numeric*>(&((new numeric(-15))->setflag(status_flags::dynallocated)));
-               _num_12_p = reinterpret_cast<const numeric*>(&((new numeric(-12))->setflag(status_flags::dynallocated)));
-               _num_11_p = reinterpret_cast<const numeric*>(&((new numeric(-11))->setflag(status_flags::dynallocated)));
-               _num_10_p = reinterpret_cast<const numeric*>(&((new numeric(-10))->setflag(status_flags::dynallocated)));
-               _num_9_p  = reinterpret_cast<const numeric*>(&((new numeric(-9))->setflag(status_flags::dynallocated)));
-               _num_8_p  = reinterpret_cast<const numeric*>(&((new numeric(-8))->setflag(status_flags::dynallocated)));
-               _num_7_p  = reinterpret_cast<const numeric*>(&((new numeric(-7))->setflag(status_flags::dynallocated)));
-               _num_6_p  = reinterpret_cast<const numeric*>(&((new numeric(-6))->setflag(status_flags::dynallocated)));
-               _num_5_p  = reinterpret_cast<const numeric*>(&((new numeric(-5))->setflag(status_flags::dynallocated)));
-               _num_4_p  = reinterpret_cast<const numeric*>(&((new numeric(-4))->setflag(status_flags::dynallocated)));
-               _num_3_p  = reinterpret_cast<const numeric*>(&((new numeric(-3))->setflag(status_flags::dynallocated)));
-               _num_2_p  = reinterpret_cast<const numeric*>(&((new numeric(-2))->setflag(status_flags::dynallocated)));
-               _num_1_p  = reinterpret_cast<const numeric*>(&((new numeric(-1))->setflag(status_flags::dynallocated)));
-               _num_1_2_p= reinterpret_cast<const numeric*>(&((new numeric(-1,2))->setflag(status_flags::dynallocated)));
-               _num_1_3_p= reinterpret_cast<const numeric*>(&((new numeric(-1,3))->setflag(status_flags::dynallocated)));
-               _num_1_4_p= reinterpret_cast<const numeric*>(&((new numeric(-1,4))->setflag(status_flags::dynallocated)));
-               _num0_p   = reinterpret_cast<const numeric*>(&((new numeric(0))->setflag(status_flags::dynallocated)));
-               _num0_bp  = _num0_p;
-               _num1_4_p = reinterpret_cast<const numeric*>(&((new numeric(1,4))->setflag(status_flags::dynallocated)));
-               _num1_3_p = reinterpret_cast<const numeric*>(&((new numeric(1,3))->setflag(status_flags::dynallocated)));
-               _num1_2_p = reinterpret_cast<const numeric*>(&((new numeric(1,2))->setflag(status_flags::dynallocated)));
-               _num1_p   = reinterpret_cast<const numeric*>(&((new numeric(1))->setflag(status_flags::dynallocated)));
-               _num2_p   = reinterpret_cast<const numeric*>(&((new numeric(2))->setflag(status_flags::dynallocated)));
-               _num3_p   = reinterpret_cast<const numeric*>(&((new numeric(3))->setflag(status_flags::dynallocated)));
-               _num4_p   = reinterpret_cast<const numeric*>(&((new numeric(4))->setflag(status_flags::dynallocated)));
-               _num5_p   = reinterpret_cast<const numeric*>(&((new numeric(5))->setflag(status_flags::dynallocated)));
-               _num6_p   = reinterpret_cast<const numeric*>(&((new numeric(6))->setflag(status_flags::dynallocated)));
-               _num7_p   = reinterpret_cast<const numeric*>(&((new numeric(7))->setflag(status_flags::dynallocated)));
-               _num8_p   = reinterpret_cast<const numeric*>(&((new numeric(8))->setflag(status_flags::dynallocated)));
-               _num9_p   = reinterpret_cast<const numeric*>(&((new numeric(9))->setflag(status_flags::dynallocated)));
-               _num10_p  = reinterpret_cast<const numeric*>(&((new numeric(10))->setflag(status_flags::dynallocated)));
-               _num11_p  = reinterpret_cast<const numeric*>(&((new numeric(11))->setflag(status_flags::dynallocated)));
-               _num12_p  = reinterpret_cast<const numeric*>(&((new numeric(12))->setflag(status_flags::dynallocated)));
-               _num15_p  = reinterpret_cast<const numeric*>(&((new numeric(15))->setflag(status_flags::dynallocated)));
-               _num18_p  = reinterpret_cast<const numeric*>(&((new numeric(18))->setflag(status_flags::dynallocated)));
-               _num20_p  = reinterpret_cast<const numeric*>(&((new numeric(20))->setflag(status_flags::dynallocated)));
-               _num24_p  = reinterpret_cast<const numeric*>(&((new numeric(24))->setflag(status_flags::dynallocated)));
-               _num25_p  = reinterpret_cast<const numeric*>(&((new numeric(25))->setflag(status_flags::dynallocated)));
-               _num30_p  = reinterpret_cast<const numeric*>(&((new numeric(30))->setflag(status_flags::dynallocated)));
-               _num48_p  = reinterpret_cast<const numeric*>(&((new numeric(48))->setflag(status_flags::dynallocated)));
-               _num60_p  = reinterpret_cast<const numeric*>(&((new numeric(60))->setflag(status_flags::dynallocated)));
-               _num120_p = reinterpret_cast<const numeric*>(&((new numeric(120))->setflag(status_flags::dynallocated)));
+               _num_120_p= static_cast<const numeric*>(&((new numeric(-120))->setflag(status_flags::dynallocated)));
+               _num_60_p = static_cast<const numeric*>(&((new numeric(-60))->setflag(status_flags::dynallocated)));
+               _num_48_p = static_cast<const numeric*>(&((new numeric(-48))->setflag(status_flags::dynallocated)));
+               _num_30_p = static_cast<const numeric*>(&((new numeric(-30))->setflag(status_flags::dynallocated)));
+               _num_25_p = static_cast<const numeric*>(&((new numeric(-25))->setflag(status_flags::dynallocated)));
+               _num_24_p = static_cast<const numeric*>(&((new numeric(-24))->setflag(status_flags::dynallocated)));
+               _num_20_p = static_cast<const numeric*>(&((new numeric(-20))->setflag(status_flags::dynallocated)));
+               _num_18_p = static_cast<const numeric*>(&((new numeric(-18))->setflag(status_flags::dynallocated)));
+               _num_15_p = static_cast<const numeric*>(&((new numeric(-15))->setflag(status_flags::dynallocated)));
+               _num_12_p = static_cast<const numeric*>(&((new numeric(-12))->setflag(status_flags::dynallocated)));
+               _num_11_p = static_cast<const numeric*>(&((new numeric(-11))->setflag(status_flags::dynallocated)));
+               _num_10_p = static_cast<const numeric*>(&((new numeric(-10))->setflag(status_flags::dynallocated)));
+               _num_9_p  = static_cast<const numeric*>(&((new numeric(-9))->setflag(status_flags::dynallocated)));
+               _num_8_p  = static_cast<const numeric*>(&((new numeric(-8))->setflag(status_flags::dynallocated)));
+               _num_7_p  = static_cast<const numeric*>(&((new numeric(-7))->setflag(status_flags::dynallocated)));
+               _num_6_p  = static_cast<const numeric*>(&((new numeric(-6))->setflag(status_flags::dynallocated)));
+               _num_5_p  = static_cast<const numeric*>(&((new numeric(-5))->setflag(status_flags::dynallocated)));
+               _num_4_p  = static_cast<const numeric*>(&((new numeric(-4))->setflag(status_flags::dynallocated)));
+               _num_3_p  = static_cast<const numeric*>(&((new numeric(-3))->setflag(status_flags::dynallocated)));
+               _num_2_p  = static_cast<const numeric*>(&((new numeric(-2))->setflag(status_flags::dynallocated)));
+               _num_1_p  = static_cast<const numeric*>(&((new numeric(-1))->setflag(status_flags::dynallocated)));
+               _num_1_2_p= static_cast<const numeric*>(&((new numeric(-1,2))->setflag(status_flags::dynallocated)));
+               _num_1_3_p= static_cast<const numeric*>(&((new numeric(-1,3))->setflag(status_flags::dynallocated)));
+               _num_1_4_p= static_cast<const numeric*>(&((new numeric(-1,4))->setflag(status_flags::dynallocated)));
+               _num0_p   = static_cast<const numeric*>(&((new numeric(0))->setflag(status_flags::dynallocated)));
+               _num0_bp  = _num0_p;  // Cf. class ex default ctor.
+               _num1_4_p = static_cast<const numeric*>(&((new numeric(1,4))->setflag(status_flags::dynallocated)));
+               _num1_3_p = static_cast<const numeric*>(&((new numeric(1,3))->setflag(status_flags::dynallocated)));
+               _num1_2_p = static_cast<const numeric*>(&((new numeric(1,2))->setflag(status_flags::dynallocated)));
+               _num1_p   = static_cast<const numeric*>(&((new numeric(1))->setflag(status_flags::dynallocated)));
+               _num2_p   = static_cast<const numeric*>(&((new numeric(2))->setflag(status_flags::dynallocated)));
+               _num3_p   = static_cast<const numeric*>(&((new numeric(3))->setflag(status_flags::dynallocated)));
+               _num4_p   = static_cast<const numeric*>(&((new numeric(4))->setflag(status_flags::dynallocated)));
+               _num5_p   = static_cast<const numeric*>(&((new numeric(5))->setflag(status_flags::dynallocated)));
+               _num6_p   = static_cast<const numeric*>(&((new numeric(6))->setflag(status_flags::dynallocated)));
+               _num7_p   = static_cast<const numeric*>(&((new numeric(7))->setflag(status_flags::dynallocated)));
+               _num8_p   = static_cast<const numeric*>(&((new numeric(8))->setflag(status_flags::dynallocated)));
+               _num9_p   = static_cast<const numeric*>(&((new numeric(9))->setflag(status_flags::dynallocated)));
+               _num10_p  = static_cast<const numeric*>(&((new numeric(10))->setflag(status_flags::dynallocated)));
+               _num11_p  = static_cast<const numeric*>(&((new numeric(11))->setflag(status_flags::dynallocated)));
+               _num12_p  = static_cast<const numeric*>(&((new numeric(12))->setflag(status_flags::dynallocated)));
+               _num15_p  = static_cast<const numeric*>(&((new numeric(15))->setflag(status_flags::dynallocated)));
+               _num18_p  = static_cast<const numeric*>(&((new numeric(18))->setflag(status_flags::dynallocated)));
+               _num20_p  = static_cast<const numeric*>(&((new numeric(20))->setflag(status_flags::dynallocated)));
+               _num24_p  = static_cast<const numeric*>(&((new numeric(24))->setflag(status_flags::dynallocated)));
+               _num25_p  = static_cast<const numeric*>(&((new numeric(25))->setflag(status_flags::dynallocated)));
+               _num30_p  = static_cast<const numeric*>(&((new numeric(30))->setflag(status_flags::dynallocated)));
+               _num48_p  = static_cast<const numeric*>(&((new numeric(48))->setflag(status_flags::dynallocated)));
+               _num60_p  = static_cast<const numeric*>(&((new numeric(60))->setflag(status_flags::dynallocated)));
+               _num120_p = static_cast<const numeric*>(&((new numeric(120))->setflag(status_flags::dynallocated)));
 
                // Initialize print context class info (this is not strictly necessary
                // but we do it anyway to make print_context_class_info::dump_hierarchy()