Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uprev to v4.4.0 #446

Merged
merged 27 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f8db6dc
Update GNOLL.ini
ianfhunter Nov 17, 2023
0031f34
Update setup.cfg
ianfhunter Nov 17, 2023
b328971
Update Project.toml
ianfhunter Nov 17, 2023
a8d0989
Update GNOLL.ini
ianfhunter Nov 25, 2023
7c6bd6b
Merge branch 'main' into uprev
ianfhunter Nov 25, 2023
f429a8c
Update test_language_bindings.yml
ianfhunter Nov 25, 2023
ce35993
Update test_language_bindings.yml
ianfhunter Nov 25, 2023
d386819
Update test_language_bindings.yml
ianfhunter Nov 25, 2023
c56c98e
Update test_language_bindings.yml
ianfhunter Nov 25, 2023
047d85e
Update test_language_bindings.yml
ianfhunter Nov 25, 2023
f9e0dcc
Update test_language_bindings.yml
ianfhunter Nov 25, 2023
d01e85d
Update test_language_bindings.yml
ianfhunter Nov 25, 2023
eb06ae7
Update test_language_bindings.yml
ianfhunter Nov 25, 2023
12819f8
Update test_language_bindings.yml
ianfhunter Nov 25, 2023
a2a26ed
Update test_language_bindings.yml
ianfhunter Nov 25, 2023
4dfea7f
Update mocking.h
ianfhunter Nov 25, 2023
01e5aa5
Update safe_functions.h
ianfhunter Nov 25, 2023
8e6e729
Update mocking.h
ianfhunter Nov 25, 2023
30fe5ff
Update mocking.c
ianfhunter Nov 25, 2023
c2703e7
Update safe_functions.c
ianfhunter Nov 25, 2023
570f51c
Update randomness.h
ianfhunter Nov 25, 2023
a8b2c3b
Update randomness.c
ianfhunter Nov 25, 2023
7906c51
Update macros.c
ianfhunter Nov 25, 2023
0430832
Update macros.h
ianfhunter Nov 25, 2023
2765bdb
Update pcg_basic.c
ianfhunter Nov 25, 2023
6043e43
Update dice.yacc
ianfhunter Nov 25, 2023
cab7000
Update dice.yacc
ianfhunter Nov 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions .github/workflows/test_language_bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,8 @@ jobs:
run: |
sudo apt update
sudo apt install cabal-install haskell-stack ghc
# curl -O https://downloads.haskell.org/~ghc/8.10.7/ghc-8.10.7-x86_64-deb10-linux.tar.xz
# tar xvf ghc-8.10.7-x86_64-deb10-linux.tar.xz
# cd ghc-8.10.7 && ./configure
# cd ghc-8.10.7 && make install
ghc --version
cabal update
# stack init
# stack --resolver lts-18 build
- name: make haskell
run: |
make haskell
Expand Down Expand Up @@ -123,14 +117,26 @@ jobs:
version: "10.0"
- name: python deps
run: python3 -m pip install -r reqs/requirements.txt
- name: apt prerequisites
run: |
sudo apt install clang-14 lld-14 llvm-14 libjs-d3 python3-numpy
sudo apt install llvm -y
- name: javascript prerequisites
run: |
sudo apt install clang-14 lld-14 llvm-14 nodejs libjs-d3 python3-numpy
sudo apt install nodejs llvm -y
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/e/emscripten/emscripten_3.1.6~dfsg-5_all.deb
sudo apt install ./emscripten_3.1.6~dfsg-5_all.deb
# NodeJS
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Acorn-Node
git clone https://github.com/acornjs/acorn.git
cd acorn ; npm install ; cd -
# Emscripten
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk ; ./emsdk install latest ; cd -
# wget --no-verbose -c http://archive.ubuntu.com/ubuntu/pool/universe/e/emscripten/emscripten_3.1.6~dfsg-5_all.deb
# sudo apt install -f ./emscripten_3.1.6~dfsg-5_all.deb nodejs- node-acorn- # ignore nodejs acorn max version
- name: make js
run: |
cd emsdk ; ./emsdk activate latest ; source ./emsdk_env.sh ; cd -
emcc -v
make js
node ./build/js/a.out.js 1d20
Expand Down
2 changes: 1 addition & 1 deletion GNOLL.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Placeholder file for future configuration setting. Currently unused
[Meta Information]
version = v3.2.0
version = v4.4.0
ttrpg_compatibility_rate = 98.66
11 changes: 5 additions & 6 deletions src/grammar/dice.yacc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

int yylex(void);
int yyerror(const char* s);
int yywrap();
int yywrap(void);

//TODO: move to external file

Expand All @@ -50,10 +50,10 @@ extern struct macro_struct *macros;
pcg32_random_t rng;

// Function Signatures for this file
int initialize();
int initialize(void);

// Functions
int initialize(){
int initialize(void){
if (!seeded){
unsigned long int tick = (unsigned long)time(0)+(unsigned long)clock();
pcg32_srandom_r(
Expand Down Expand Up @@ -1794,8 +1794,7 @@ int main(int argc, char **str){
free(macros);
}

int yyerror(s)
const char *s;
int yyerror(const char *s)
{
fprintf(stderr, "%s\n", s);

Expand All @@ -1809,7 +1808,7 @@ const char *s;

}

int yywrap(){
int yywrap(void){
return (1);
}

2 changes: 1 addition & 1 deletion src/grammar/external/pcg_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ uint32_t pcg32_random_r(pcg32_random_t* rng) {
return (xorshifted >> rot) | (xorshifted << ((-rot) & 31));
}

uint32_t pcg32_random() { return pcg32_random_r(&pcg32_global); }
uint32_t pcg32_random(void) { return pcg32_random_r(&pcg32_global); }

// pcg32_boundedrand(bound):
// pcg32_boundedrand_r(rng, bound):
Expand Down
2 changes: 1 addition & 1 deletion src/grammar/operations/macros.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ unsigned long hash_function(unsigned char *str) {
return hash;
}

void delete_all_macros() {
void delete_all_macros(void) {
struct macro_struct *current_macro, *tmp;

HASH_ITER(hh, macros, current_macro, tmp) {
Expand Down
2 changes: 1 addition & 1 deletion src/grammar/operations/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct macro_struct {
UT_hash_handle hh; /* makes this structure hashable */
};

void delete_all_macros();
void delete_all_macros(void);

void register_macro(vec *macro_name, roll_params *to_store);

Expand Down
2 changes: 1 addition & 1 deletion src/grammar/rolls/randomness.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

extern pcg32_random_t rng;

int get_random_uniformly(){
int get_random_uniformly(void){
int value;
#if USE_SECURE_RANDOM == 1
value = (int)arc4random_uniform(INT_MAX);
Expand Down
2 changes: 1 addition & 1 deletion src/grammar/rolls/randomness.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __RANDOMNESS_H__
#define __RANDOMNESS_H__

int get_random_uniformly();
int get_random_uniformly(void);
double get_random_normally(double mean, double std);

#endif
4 changes: 2 additions & 2 deletions src/grammar/util/mocking.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int secondary_mock_value = 0;
MOCK_METHOD global_mock_style = NO_MOCK;


void reset_mocking() {
void reset_mocking(void) {
/**
* @brief Resets various globals for test mocking
*/
Expand All @@ -26,7 +26,7 @@ void init_mocking(MOCK_METHOD mock_style, int starting_value) {
global_mock_style = mock_style;
}

void mocking_tick() {
void mocking_tick(void) {
/**
* @brief Every time a dice is rolled, this function is called so that the
* mocking logic can update
Expand Down
8 changes: 6 additions & 2 deletions src/grammar/util/mocking.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef __MOCKING_H__
#define __MOCKING_H__

#include "constructs/dice_enums.h"
#include "shared_header.h"
Expand All @@ -12,6 +14,8 @@ typedef enum {
} MOCK_METHOD;

// Mocking Util
void reset_mocking();
void reset_mocking(void);
void init_mocking(MOCK_METHOD mock_style, int starting_value);
void mocking_tick();
void mocking_tick(void);

#endif
2 changes: 1 addition & 1 deletion src/grammar/util/safe_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern int verbose;
#define ANSI_COLOR_RESET "\x1b[0m"


void print_gnoll_errors(){
void print_gnoll_errors(void){
/**
* @brief A human-readable translation of the gnoll error codes
*
Expand Down
2 changes: 1 addition & 1 deletion src/grammar/util/safe_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ typedef enum {
UNDEFINED_MACRO = 12
} ERROR_CODES;

void print_gnoll_errors();
void print_gnoll_errors(void);
void *safe_malloc(size_t size);
void *safe_calloc(size_t nitems, size_t size);
FILE *safe_fopen(const char *filename, const char *mode);
Expand Down
2 changes: 1 addition & 1 deletion src/julia/GNOLL/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GnollDiceNotation"
uuid = "6d20aa67-345f-4b27-9ab4-1a86910b1003"
authors = ["Ian-Hunter"]
version = "4.3.0"
version = "4.4.0"

[deps]
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Expand Down
2 changes: 1 addition & 1 deletion src/python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = gnoll
author = Ian Frederick Vigogne Goodbody Hunter
author_email = [email protected]
version = 4.3.4
version = 4.4.0
description = An efficient dice notation parser with extended notation
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
Loading