fixed a bug in qse_gettime().
fixed wrong declaraations in alg.h
This commit is contained in:
		| @ -201,7 +201,8 @@ protected: | ||||
| 	flt_t sqrt (flt_t x); | ||||
|  | ||||
| protected: | ||||
| 	unsigned int seed;  | ||||
| 	qse_long_t seed;  | ||||
| 	qse_ulong_t prand; | ||||
| 	qse_htb_t cmgrtab; | ||||
| 	bool cmgrtab_inited; | ||||
|  | ||||
|  | ||||
| @ -49,6 +49,10 @@ typedef int (*qse_search_comper_t) ( | ||||
|  */ | ||||
| typedef qse_search_comper_t qse_sort_comper_t; | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
|  | ||||
| /** | ||||
|  * The qse_bsearch() function performs binary search over a sorted array. | ||||
|  * It looks for an item matching @a key in an array @a base containing  | ||||
| @ -128,4 +132,46 @@ qse_uint32_t qse_rand31 ( | ||||
| 	qse_uint32_t seed | ||||
| ); | ||||
|  | ||||
|  | ||||
| #if (QSE_SIZEOF_UINT32_T > 0) | ||||
| /** | ||||
|  * The qse_randxs32() function implements the xorshift random number generator | ||||
|  * by George Marsaglia.  | ||||
|  */ | ||||
| qse_uint32_t qse_randxs32 ( | ||||
| 	qse_uint32_t seed | ||||
| ); | ||||
| #endif | ||||
|  | ||||
| #if (QSE_SIZEOF_UINT64_T > 0) | ||||
| /** | ||||
|  * The qse_randxs64() function implements the xorshift random number generator | ||||
|  * by George Marsaglia.  | ||||
|  */ | ||||
| qse_uint64_t qse_randxs64 ( | ||||
| 	qse_uint64_t seed | ||||
| ); | ||||
| #endif | ||||
|  | ||||
| #if (QSE_SIZEOF_ULONG_T == QSE_SIZEOF_UINT64_T) | ||||
| #	define qse_randxsulong(seed) qse_randxs64(seed) | ||||
| #elif (QSE_SIZEOF_ULONG_T == QSE_SIZEOF_UINT32_T) | ||||
| #	define qse_randxsulong(seed) qse_randxs32(seed) | ||||
| #else | ||||
| #	error Unsupported | ||||
| #endif | ||||
|  | ||||
| #if (QSE_SIZEOF_UINT_T == QSE_SIZEOF_UINT64_T) | ||||
| #	define qse_randxsuint(seed) qse_randxs64(seed) | ||||
| #elif (QSE_SIZEOF_UINT_T == QSE_SIZEOF_UINT32_T) | ||||
| #	define qse_randxsuint(seed) qse_randxs32(seed) | ||||
| #else | ||||
| #	error Unsupported | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| } | ||||
| #endif | ||||
|  | ||||
| #endif | ||||
|  | ||||
| @ -476,7 +476,7 @@ int qse_timelocal (const qse_btime_t* bt, qse_ntime_t* nt) | ||||
| 	return 0; | ||||
| #else | ||||
| 	*nt = ((qse_ntime_t)mktime(&tm)*QSE_MSECS_PER_SEC) + bt->msec; | ||||
| 	return -1; | ||||
| 	return 0; | ||||
| #endif | ||||
| } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user