@@ -762,22 +762,23 @@ temp_nmbrString *nmbrTempAlloc(long size)
762
762
/* Make string have temporary allocation to be released by next nmbrLet() */
763
763
/* Warning: after nmbrMakeTempAlloc() is called, the nmbrString may NOT be
764
764
assigned again with nmbrLet() */
765
- void nmbrMakeTempAlloc (nmbrString * s )
765
+ temp_nmbrString * nmbrMakeTempAlloc (nmbrString * s )
766
766
{
767
- if (g_nmbrTempAllocStackTop >=(M_MAX_ALLOC_STACK - 1 )) {
768
- printf (
769
- "*** FATAL ERROR *** Temporary nmbrString stack overflow in nmbrMakeTempAlloc()\n" );
767
+ if (g_nmbrTempAllocStackTop >=(M_MAX_ALLOC_STACK - 1 )) {
768
+ printf (
769
+ "*** FATAL ERROR *** Temporary nmbrString stack overflow in nmbrMakeTempAlloc()\n" );
770
770
#if __STDC__
771
- fflush (stdout );
771
+ fflush (stdout );
772
772
#endif
773
- bug (1368 );
774
- }
775
- if (s [0 ] != -1 ) { /* End of string */
776
- /* Do it only if nmbrString is not empty */
777
- nmbrTempAllocStack [g_nmbrTempAllocStackTop ++ ] = s ;
778
- }
773
+ bug (1368 );
774
+ }
775
+ if (s [0 ] != -1 ) { /* End of string */
776
+ /* Do it only if nmbrString is not empty */
777
+ nmbrTempAllocStack [g_nmbrTempAllocStackTop ++ ] = s ;
778
+ }
779
779
/*E*/ db2 = db2 + (nmbrLen (s )+ 1 )* (long )(sizeof (nmbrString ));
780
780
/*E*/ db3 = db3 - (nmbrLen (s )+ 1 )* (long )(sizeof (nmbrString ));
781
+ return s ;
781
782
}
782
783
783
784
@@ -1145,8 +1146,7 @@ temp_vstring nmbrCvtMToVString(const nmbrString *s) {
1145
1146
}
1146
1147
1147
1148
g_startTempAllocStack = saveTempAllocStack ;
1148
- if (tmpStr [0 ]) makeTempAlloc (tmpStr ); /* Flag it for deallocation */
1149
- return (tmpStr );
1149
+ return makeTempAlloc (tmpStr ); /* Flag it for deallocation */
1150
1150
}
1151
1151
1152
1152
@@ -1305,8 +1305,7 @@ temp_vstring nmbrCvtRToVString(const nmbrString *proof,
1305
1305
1306
1306
g_startTempAllocStack = saveTempAllocStack ;
1307
1307
g_nmbrStartTempAllocStack = nmbrSaveTempAllocStack ;
1308
- if (proofStr [0 ]) makeTempAlloc (proofStr ); /* Flag it for deallocation */
1309
- return (proofStr );
1308
+ return makeTempAlloc (proofStr ); /* Flag it for deallocation */
1310
1309
}
1311
1310
1312
1311
@@ -1369,8 +1368,7 @@ temp_vstring nmbrCvtAnyToVString(const nmbrString *s) {
1369
1368
}
1370
1369
1371
1370
g_startTempAllocStack = saveTempAllocStack ;
1372
- if (tmpStr [0 ]) makeTempAlloc (tmpStr ); /* Flag it for deallocation */
1373
- return (tmpStr );
1371
+ return makeTempAlloc (tmpStr ); /* Flag it for deallocation */
1374
1372
}
1375
1373
1376
1374
@@ -1567,8 +1565,7 @@ temp_nmbrString *nmbrSquishProof(const nmbrString *proof) {
1567
1565
} /* Next step */
1568
1566
nmbrLet (& subProof , NULL_NMBRSTRING );
1569
1567
nmbrLet (& dummyProof , NULL_NMBRSTRING );
1570
- nmbrMakeTempAlloc (newProof ); /* Flag it for deallocation */
1571
- return (newProof );
1568
+ return nmbrMakeTempAlloc (newProof ); /* Flag it for deallocation */
1572
1569
}
1573
1570
1574
1571
@@ -1593,8 +1590,7 @@ temp_nmbrString *nmbrUnsquishProof(const nmbrString *proof) {
1593
1590
step = step + subPrfLen - 1 ;
1594
1591
}
1595
1592
nmbrLet (& subProof , NULL_NMBRSTRING );
1596
- nmbrMakeTempAlloc (newProof ); /* Flag it for deallocation */
1597
- return (newProof );
1593
+ return nmbrMakeTempAlloc (newProof ); /* Flag it for deallocation */
1598
1594
}
1599
1595
1600
1596
@@ -1617,14 +1613,12 @@ temp_nmbrString *nmbrGetIndentation(const nmbrString *proof, long startingLevel)
1617
1613
indentationLevel [plen - 1 ] = startingLevel ;
1618
1614
if (stmt < 0 ) { /* A local label reference or unknown */
1619
1615
if (plen != 1 ) bug (1330 );
1620
- nmbrMakeTempAlloc (indentationLevel ); /* Flag it for deallocation */
1621
- return (indentationLevel );
1616
+ return nmbrMakeTempAlloc (indentationLevel ); /* Flag it for deallocation */
1622
1617
}
1623
1618
type = g_Statement [stmt ].type ;
1624
1619
if (type == f_ || type == e_ ) { /* A hypothesis */
1625
1620
if (plen != 1 ) bug (1331 );
1626
- nmbrMakeTempAlloc (indentationLevel ); /* Flag it for deallocation */
1627
- return (indentationLevel );
1621
+ return nmbrMakeTempAlloc (indentationLevel ); /* Flag it for deallocation */
1628
1622
}
1629
1623
/* An assertion */
1630
1624
if (type != a_ && type != p_ ) bug (1332 );
@@ -1643,8 +1637,7 @@ temp_nmbrString *nmbrGetIndentation(const nmbrString *proof, long startingLevel)
1643
1637
1644
1638
nmbrLet (& subProof ,NULL_NMBRSTRING ); /* Deallocate */
1645
1639
nmbrLet (& nmbrTmp , NULL_NMBRSTRING ); /* Deallocate */
1646
- nmbrMakeTempAlloc (indentationLevel ); /* Flag it for deallocation */
1647
- return (indentationLevel );
1640
+ return nmbrMakeTempAlloc (indentationLevel ); /* Flag it for deallocation */
1648
1641
} /* nmbrGetIndentation */
1649
1642
1650
1643
@@ -1670,16 +1663,14 @@ nmbrString *nmbrGetEssential(const nmbrString *proof) {
1670
1663
/* The only time it should get here is if the original proof has only one
1671
1664
step, which would be an unknown step */
1672
1665
if (stmt != - (long )'?' && stmt > -1000 ) bug (1335 );
1673
- nmbrMakeTempAlloc (essentialFlags ); /* Flag it for deallocation */
1674
- return (essentialFlags );
1666
+ return nmbrMakeTempAlloc (essentialFlags ); /* Flag it for deallocation */
1675
1667
}
1676
1668
type = g_Statement [stmt ].type ;
1677
1669
if (type == f_ || type == e_ ) { /* A hypothesis */
1678
1670
/* The only time it should get here is if the original proof has only one
1679
1671
step */
1680
1672
if (plen != 1 ) bug (1336 );
1681
- nmbrMakeTempAlloc (essentialFlags ); /* Flag it for deallocation */
1682
- return (essentialFlags );
1673
+ return nmbrMakeTempAlloc (essentialFlags ); /* Flag it for deallocation */
1683
1674
}
1684
1675
/* An assertion */
1685
1676
if (type != a_ && type != p_ ) bug (1337 );
@@ -1701,8 +1692,7 @@ nmbrString *nmbrGetEssential(const nmbrString *proof) {
1701
1692
1702
1693
nmbrLet (& subProof ,NULL_NMBRSTRING ); /* Deallocate */
1703
1694
nmbrLet (& nmbrTmp , NULL_NMBRSTRING ); /* Deallocate */
1704
- nmbrMakeTempAlloc (essentialFlags ); /* Flag it for deallocation */
1705
- return (essentialFlags );
1695
+ return nmbrMakeTempAlloc (essentialFlags ); /* Flag it for deallocation */
1706
1696
} /* nmbrGetEssential */
1707
1697
1708
1698
@@ -1730,16 +1720,14 @@ temp_nmbrString *nmbrGetTargetHyp(const nmbrString *proof, long statemNum) {
1730
1720
/* The only time it should get here is if the original proof has only one
1731
1721
step, which would be an unknown step */
1732
1722
if (stmt != - (long )'?' ) bug (1340 );
1733
- nmbrMakeTempAlloc (targetHyp ); /* Flag it for deallocation */
1734
- return (targetHyp );
1723
+ return nmbrMakeTempAlloc (targetHyp ); /* Flag it for deallocation */
1735
1724
}
1736
1725
type = g_Statement [stmt ].type ;
1737
1726
if (type == f_ || type == e_ ) { /* A hypothesis */
1738
1727
/* The only time it should get here is if the original proof has only one
1739
1728
step */
1740
1729
if (plen != 1 ) bug (1341 );
1741
- nmbrMakeTempAlloc (targetHyp ); /* Flag it for deallocation */
1742
- return (targetHyp );
1730
+ return nmbrMakeTempAlloc (targetHyp ); /* Flag it for deallocation */
1743
1731
}
1744
1732
/* An assertion */
1745
1733
if (type != a_ && type != p_ ) bug (1342 );
@@ -1764,8 +1752,7 @@ temp_nmbrString *nmbrGetTargetHyp(const nmbrString *proof, long statemNum) {
1764
1752
1765
1753
nmbrLet (& subProof ,NULL_NMBRSTRING ); /* Deallocate */
1766
1754
nmbrLet (& nmbrTmp , NULL_NMBRSTRING ); /* Deallocate */
1767
- nmbrMakeTempAlloc (targetHyp ); /* Flag it for deallocation */
1768
- return (targetHyp );
1755
+ return nmbrMakeTempAlloc (targetHyp ); /* Flag it for deallocation */
1769
1756
} /* nmbrGetTargetHyp */
1770
1757
1771
1758
@@ -2197,8 +2184,7 @@ temp_vstring compressProof(const nmbrString *proof, long statemNum,
2197
2184
nmbrLet (& explWorth , NULL_NMBRSTRING );
2198
2185
let (& explIncluded , "" );
2199
2186
2200
- makeTempAlloc (output ); /* Flag it for deallocation */
2201
- return (output );
2187
+ return makeTempAlloc (output ); /* Flag it for deallocation */
2202
2188
} /* compressProof */
2203
2189
2204
2190
@@ -2262,20 +2248,21 @@ temp_pntrString *pntrTempAlloc(long size) {
2262
2248
/* Make string have temporary allocation to be released by next pntrLet() */
2263
2249
/* Warning: after pntrMakeTempAlloc() is called, the pntrString may NOT be
2264
2250
assigned again with pntrLet() */
2265
- void pntrMakeTempAlloc (pntrString * s ) {
2266
- if (g_pntrTempAllocStackTop >=(M_MAX_ALLOC_STACK - 1 )) {
2267
- printf (
2268
- "*** FATAL ERROR *** Temporary pntrString stack overflow in pntrMakeTempAlloc()\n" );
2251
+ temp_pntrString * pntrMakeTempAlloc (pntrString * s ) {
2252
+ if (g_pntrTempAllocStackTop >=(M_MAX_ALLOC_STACK - 1 )) {
2253
+ printf (
2254
+ "*** FATAL ERROR *** Temporary pntrString stack overflow in pntrMakeTempAlloc()\n" );
2269
2255
#if __STDC__
2270
- fflush (stdout );
2256
+ fflush (stdout );
2271
2257
#endif
2272
- bug (1370 );
2273
- }
2274
- if (s [0 ] != NULL ) { /* Don't do it if pntrString is empty */
2275
- pntrTempAllocStack [g_pntrTempAllocStackTop ++ ] = s ;
2276
- }
2258
+ bug (1370 );
2259
+ }
2260
+ if (s [0 ] != NULL ) { /* Don't do it if pntrString is empty */
2261
+ pntrTempAllocStack [g_pntrTempAllocStackTop ++ ] = s ;
2262
+ }
2277
2263
/*E*/ db2 = db2 + (pntrLen (s )+ 1 )* (long )(sizeof (pntrString ));
2278
2264
/*E*/ db3 = db3 - (pntrLen (s )+ 1 )* (long )(sizeof (pntrString ));
2265
+ return s ;
2279
2266
}
2280
2267
2281
2268
0 commit comments