Skip to content

Commit 3840a76

Browse files
committed
Remove unused function long_rand
Remove also some old comments. Signed-off-by: Stefan Weil <[email protected]>
1 parent 909af5d commit 3840a76

File tree

2 files changed

+5
-63
lines changed

2 files changed

+5
-63
lines changed

src/cutil/cutil.cpp

+2-42
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* -*-C-*-
2-
********************************************************************************
2+
******************************************************************************
33
*
44
* File: cutil.cpp
55
* Description: General utility functions
@@ -21,21 +21,7 @@
2121
** See the License for the specific language governing permissions and
2222
** limitations under the License.
2323
*
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+
******************************************************************************
3925
**/
4026

4127
#include "cutil.h"
@@ -46,32 +32,6 @@ Import original HP distribution
4632

4733
#define RESET_COUNT 2000
4834

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-
7535
/**********************************************************************
7636
* open_file
7737
*

src/cutil/cutil.h

+3-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* -*-C-*-
2-
********************************************************************************
2+
******************************************************************************
33
*
44
* File: cutil.h
55
* Description: General utility functions
@@ -21,14 +21,8 @@
2121
** See the License for the specific language governing permissions and
2222
** limitations under the License.
2323
*
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-
*/
24+
******************************************************************************
25+
*/
3226

3327
#ifndef CUTILH
3428
#define CUTILH
@@ -62,7 +56,6 @@ Import original HP distribution
6256
# define _ARGS(s) ()
6357
#endif
6458

65-
//typedef int (*int_proc) (void);
6659
typedef void (*void_proc) (...);
6760
typedef void *(*void_star_proc) _ARGS ((...));
6861

@@ -95,21 +88,10 @@ typedef void (*void_dest) (void *);
9588
/*----------------------------------------------------------------------
9689
F u n c t i o n s
9790
----------------------------------------------------------------------*/
98-
long long_rand(long limit);
9991

10092
FILE *open_file(const char *filename, const char *mode);
10193

10294
bool exists_file(const char *filename);
10395

104-
/* util.c
105-
long long_rand
106-
_ARGS ((long limit));
107-
108-
FILE *open_file
109-
_ARGS((char *filename,
110-
char *mode));
111-
112-
#undef _ARGS
113-
*/
11496
#include "cutil_class.h"
11597
#endif

0 commit comments

Comments
 (0)