Skip to content

Commit f3dd317

Browse files
fix: fix seed type in C header and example
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: passed - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 16f62aa commit f3dd317

File tree

2 files changed

+5
-5
lines changed
  • lib/node_modules/@stdlib/random/base/pcg32

2 files changed

+5
-5
lines changed

lib/node_modules/@stdlib/random/base/pcg32/examples/c/example.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424

2525
int main( void ) {
2626
int8_t status;
27-
int32_t seed;
27+
uint64_t seed;
2828
uint64_t v;
2929
int32_t i;
3030
double d;
3131

3232
// Create a PRNG...
33-
struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( 12345 );
33+
struct BasePRNGObject *obj = stdlib_base_random_pcg32_allocate( 1234 );
3434
if ( obj == NULL ) {
3535
fprintf( stderr, "Error allocating memory.\n" );
3636
exit( 1 );
@@ -41,7 +41,7 @@ int main( void ) {
4141
printf( "Unable to retrieve the PRNG seed.\n" );
4242
exit( 1 );
4343
}
44-
printf( "seed = %d\n", seed );
44+
printf( "seed = %"PRIu64"\n", seed );
4545

4646
printf( "name = %s\n", obj->prng->name );
4747
printf( "min = %"PRIu64"\n", obj->prng->min );

lib/node_modules/@stdlib/random/base/pcg32/include/stdlib/random/base/pcg32.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ typedef struct {
4040
/**
4141
* Returns a pointer to a dynamically allocated PRNG.
4242
*/
43-
struct BasePRNGObject * stdlib_base_random_pcg32_allocate( const int64_t seed );
43+
struct BasePRNGObject * stdlib_base_random_pcg32_allocate( const uint64_t seed );
4444

4545
/**
4646
* Frees a PRNG's allocated memory.
@@ -50,7 +50,7 @@ void stdlib_base_random_pcg32_free( struct BasePRNGObject *obj );
5050
/**
5151
* Returns a PRNG seed.
5252
*/
53-
int8_t stdlib_base_random_pcg32_seed( const struct BasePRNGObject *obj, int64_t *out );
53+
int8_t stdlib_base_random_pcg32_seed( const struct BasePRNGObject *obj, uint64_t *out );
5454

5555
/**
5656
* Returns a copy of the current PRNG state.

0 commit comments

Comments
 (0)