Removed main_rand
main_rand was unnecessary, so it is now removed. Using g_random_* instead of g_rand_* now. Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
		| @@ -54,11 +54,6 @@ struct { | |||||||
| } debug_context_loc = {NULL, 0}; | } debug_context_loc = {NULL, 0}; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * main_rand: |  | ||||||
|  * |  | ||||||
|  * the main random generator |  | ||||||
|  */ |  | ||||||
| GRand *main_rand = NULL; |  | ||||||
|  * wmud_random_string: |  * wmud_random_string: | ||||||
|  * @len: the desired length of the generated random string |  * @len: the desired length of the generated random string | ||||||
|  * |  * | ||||||
| @@ -148,10 +143,6 @@ main(int argc, char **argv) | |||||||
| 	wmud_type_init(); | 	wmud_type_init(); | ||||||
|  |  | ||||||
| 	/* TODO: Command line parsing */ | 	/* TODO: Command line parsing */ | ||||||
|  |  | ||||||
| 	/* Initialize random number generator */ |  | ||||||
| 	main_rand = g_rand_new(); |  | ||||||
|  |  | ||||||
| 	/* TODO: Create signal handlers! */ | 	/* TODO: Create signal handlers! */ | ||||||
|  |  | ||||||
| 	if (!wmud_config_init(&active_config, &err)) | 	if (!wmud_config_init(&active_config, &err)) | ||||||
|   | |||||||
| @@ -5,7 +5,6 @@ | |||||||
|  |  | ||||||
| extern GMainContext *game_context; | extern GMainContext *game_context; | ||||||
| extern guint32 elapsed_seconds; | extern guint32 elapsed_seconds; | ||||||
| extern GRand *main_rand; |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * random_number: |  * random_number: | ||||||
| @@ -14,7 +13,7 @@ extern GRand *main_rand; | |||||||
|  * |  * | ||||||
|  * Generates a random number between min and max |  * Generates a random number between min and max | ||||||
|  */ |  */ | ||||||
| #define random_number(min, max) g_rand_int_range(main_rand, (min), (max) + 1) | #define random_number(min, max) g_random_int_range((min), (max) + 1) | ||||||
|  |  | ||||||
| gchar *wmud_random_string(gint len); | gchar *wmud_random_string(gint len); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user