1
1
/* -*-C-*-
2
- ********************************************************************************
2
+ ******************************************************************************
3
3
*
4
4
* File: cutil.cpp
5
5
* Description: General utility functions
21
21
** See the License for the specific language governing permissions and
22
22
** limitations under the License.
23
23
*
24
- ********************************************************************************
25
- Revision 1.1 2007/02/02 23:39:07 theraysmith
26
- Fixed portability issues
27
-
28
- Revision 1.1.1.1 2004/02/20 19:39:06 slumos
29
- Import original HP distribution
30
-
31
- * Revision 1.3 90/03/06 15:39:10 15:39:10 marks (Mark Seaman)
32
- * Look for correct file of <malloc.h> or <stdlib.h>
33
- *
34
- * Revision 1.2 90/01/15 13:02:13 13:02:13 marks (Mark Seaman)
35
- * Added memory allocator (*allocate) and (*deallocate)
36
- *
37
- * Revision 1.1 89/10/09 14:58:29 14:58:29 marks (Mark Seaman)
38
- * Initial revision
24
+ ******************************************************************************
39
25
**/
40
26
41
27
#include "cutil.h"
@@ -46,32 +32,6 @@ Import original HP distribution
46
32
47
33
#define RESET_COUNT 2000
48
34
49
- /**********************************************************************
50
- * long_rand
51
- *
52
- * Return a long random number whose value is less than limit. Do this
53
- * by calling the standard cheepo random number generator and resetting
54
- * it pretty often.
55
- **********************************************************************/
56
- long long_rand (long limit ) {
57
- #if RAND_MAX < 0x1000000
58
- static long seed ;
59
-
60
- long num ;
61
- num = (long ) rand () << 16 ;
62
- num |= rand () & 0xffff ;
63
- seed ^= num ;
64
- long result = num % limit ;
65
- while (result < 0 ) {
66
- result += limit ;
67
- }
68
- return result ;
69
- #else
70
- return (long )((double )limit * rand ()/(RAND_MAX + 1.0 ));
71
- #endif
72
- }
73
-
74
-
75
35
/**********************************************************************
76
36
* open_file
77
37
*
0 commit comments