@@ -2206,7 +2206,7 @@ Dragon4_PrintFloat_IEEE_binary16(
2206
2206
Dragon4_Scratch * scratch , npy_half * value , Dragon4_Options * opt )
2207
2207
{
2208
2208
char * buffer = scratch -> repr ;
2209
- npy_uint32 bufferSize = sizeof (scratch -> repr );
2209
+ const npy_uint32 bufferSize = sizeof (scratch -> repr );
2210
2210
BigInt * bigints = scratch -> bigints ;
2211
2211
2212
2212
npy_uint16 val = * value ;
@@ -2218,15 +2218,6 @@ Dragon4_PrintFloat_IEEE_binary16(
2218
2218
npy_bool hasUnequalMargins ;
2219
2219
char signbit = '\0' ;
2220
2220
2221
- if (bufferSize == 0 ) {
2222
- return 0 ;
2223
- }
2224
-
2225
- if (bufferSize == 1 ) {
2226
- buffer [0 ] = '\0' ;
2227
- return 0 ;
2228
- }
2229
-
2230
2221
/* deconstruct the floating point value */
2231
2222
floatMantissa = val & bitmask_u32 (10 );
2232
2223
floatExponent = (val >> 10 ) & bitmask_u32 (5 );
@@ -2303,7 +2294,7 @@ Dragon4_PrintFloat_IEEE_binary32(
2303
2294
Dragon4_Options * opt )
2304
2295
{
2305
2296
char * buffer = scratch -> repr ;
2306
- npy_uint32 bufferSize = sizeof (scratch -> repr );
2297
+ const npy_uint32 bufferSize = sizeof (scratch -> repr );
2307
2298
BigInt * bigints = scratch -> bigints ;
2308
2299
2309
2300
union
@@ -2319,15 +2310,6 @@ Dragon4_PrintFloat_IEEE_binary32(
2319
2310
npy_bool hasUnequalMargins ;
2320
2311
char signbit = '\0' ;
2321
2312
2322
- if (bufferSize == 0 ) {
2323
- return 0 ;
2324
- }
2325
-
2326
- if (bufferSize == 1 ) {
2327
- buffer [0 ] = '\0' ;
2328
- return 0 ;
2329
- }
2330
-
2331
2313
/* deconstruct the floating point value */
2332
2314
floatUnion .floatingPoint = * value ;
2333
2315
floatMantissa = floatUnion .integer & bitmask_u32 (23 );
@@ -2404,7 +2386,7 @@ Dragon4_PrintFloat_IEEE_binary64(
2404
2386
Dragon4_Scratch * scratch , npy_float64 * value , Dragon4_Options * opt )
2405
2387
{
2406
2388
char * buffer = scratch -> repr ;
2407
- npy_uint32 bufferSize = sizeof (scratch -> repr );
2389
+ const npy_uint32 bufferSize = sizeof (scratch -> repr );
2408
2390
BigInt * bigints = scratch -> bigints ;
2409
2391
2410
2392
union
@@ -2421,14 +2403,6 @@ Dragon4_PrintFloat_IEEE_binary64(
2421
2403
npy_bool hasUnequalMargins ;
2422
2404
char signbit = '\0' ;
2423
2405
2424
- if (bufferSize == 0 ) {
2425
- return 0 ;
2426
- }
2427
-
2428
- if (bufferSize == 1 ) {
2429
- buffer [0 ] = '\0' ;
2430
- return 0 ;
2431
- }
2432
2406
2433
2407
/* deconstruct the floating point value */
2434
2408
floatUnion .floatingPoint = * value ;
@@ -2527,7 +2501,7 @@ Dragon4_PrintFloat_Intel_extended(
2527
2501
Dragon4_Scratch * scratch , FloatVal128 value , Dragon4_Options * opt )
2528
2502
{
2529
2503
char * buffer = scratch -> repr ;
2530
- npy_uint32 bufferSize = sizeof (scratch -> repr );
2504
+ const npy_uint32 bufferSize = sizeof (scratch -> repr );
2531
2505
BigInt * bigints = scratch -> bigints ;
2532
2506
2533
2507
npy_uint32 floatExponent , floatSign ;
@@ -2539,15 +2513,6 @@ Dragon4_PrintFloat_Intel_extended(
2539
2513
npy_bool hasUnequalMargins ;
2540
2514
char signbit = '\0' ;
2541
2515
2542
- if (bufferSize == 0 ) {
2543
- return 0 ;
2544
- }
2545
-
2546
- if (bufferSize == 1 ) {
2547
- buffer [0 ] = '\0' ;
2548
- return 0 ;
2549
- }
2550
-
2551
2516
/* deconstruct the floating point value (we ignore the intbit) */
2552
2517
floatMantissa = value .lo & bitmask_u64 (63 );
2553
2518
floatExponent = value .hi & bitmask_u32 (15 );
@@ -2748,7 +2713,7 @@ Dragon4_PrintFloat_IEEE_binary128(
2748
2713
Dragon4_Scratch * scratch , FloatVal128 val128 , Dragon4_Options * opt )
2749
2714
{
2750
2715
char * buffer = scratch -> repr ;
2751
- npy_uint32 bufferSize = sizeof (scratch -> repr );
2716
+ const npy_uint32 bufferSize = sizeof (scratch -> repr );
2752
2717
BigInt * bigints = scratch -> bigints ;
2753
2718
2754
2719
npy_uint32 floatExponent , floatSign ;
@@ -2759,15 +2724,6 @@ Dragon4_PrintFloat_IEEE_binary128(
2759
2724
npy_bool hasUnequalMargins ;
2760
2725
char signbit = '\0' ;
2761
2726
2762
- if (bufferSize == 0 ) {
2763
- return 0 ;
2764
- }
2765
-
2766
- if (bufferSize == 1 ) {
2767
- buffer [0 ] = '\0' ;
2768
- return 0 ;
2769
- }
2770
-
2771
2727
mantissa_hi = val128 .hi & bitmask_u64 (48 );
2772
2728
mantissa_lo = val128 .lo ;
2773
2729
floatExponent = (val128 .hi >> 48 ) & bitmask_u32 (15 );
@@ -2917,7 +2873,7 @@ Dragon4_PrintFloat_IBM_double_double(
2917
2873
Dragon4_Scratch * scratch , npy_float128 * value , Dragon4_Options * opt )
2918
2874
{
2919
2875
char * buffer = scratch -> repr ;
2920
- npy_uint32 bufferSize = sizeof (scratch -> repr );
2876
+ const npy_uint32 bufferSize = sizeof (scratch -> repr );
2921
2877
BigInt * bigints = scratch -> bigints ;
2922
2878
2923
2879
FloatVal128 val128 ;
@@ -2934,15 +2890,6 @@ Dragon4_PrintFloat_IBM_double_double(
2934
2890
npy_bool hasUnequalMargins ;
2935
2891
char signbit = '\0' ;
2936
2892
2937
- if (bufferSize == 0 ) {
2938
- return 0 ;
2939
- }
2940
-
2941
- if (bufferSize == 1 ) {
2942
- buffer [0 ] = '\0' ;
2943
- return 0 ;
2944
- }
2945
-
2946
2893
/* The high part always comes before the low part, regardless of the
2947
2894
* endianness of the system. */
2948
2895
buf128 .floatingPoint = * value ;
0 commit comments