mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-08 10:42:50 -06:00
an API to create unique function names
This commit is contained in:
@@ -64,6 +64,7 @@ private:
|
||||
const char *filepath;
|
||||
malloc_state* ms;
|
||||
unsigned char* base;
|
||||
unsigned long int seed;
|
||||
|
||||
// The following four fields are normally equal to
|
||||
// the corresponding fields in the malloc_state.
|
||||
@@ -133,6 +134,11 @@ public:
|
||||
|
||||
PGF_INTERNAL_DECL bool is_transient_object(object o);
|
||||
|
||||
PGF_INTERNAL_DECL static int rand() {
|
||||
current_db->seed = current_db->seed * 1103515245 + 12345;
|
||||
return (unsigned int)(current_db->seed/65536) % 32768;
|
||||
}
|
||||
|
||||
private:
|
||||
PGF_INTERNAL_DECL int init_state();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user