Skip to content

Commit

Permalink
Uprev to v4.4.0 (#446)
Browse files Browse the repository at this point in the history
* Update GNOLL.ini

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update setup.cfg

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update Project.toml

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update GNOLL.ini

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update test_language_bindings.yml

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update test_language_bindings.yml

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update test_language_bindings.yml

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update test_language_bindings.yml

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update test_language_bindings.yml

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update test_language_bindings.yml

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update test_language_bindings.yml

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update test_language_bindings.yml

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update test_language_bindings.yml

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update test_language_bindings.yml

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update mocking.h

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update safe_functions.h

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update mocking.h

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update mocking.c

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update safe_functions.c

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update randomness.h

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update randomness.c

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update macros.c

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update macros.h

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update pcg_basic.c

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update dice.yacc

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

* Update dice.yacc

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>

---------

Signed-off-by: Ian Hunter <ianfhunter@gmail.com>
  • Loading branch information
ianfhunter authored Nov 25, 2023
1 parent 370021d commit 8ff47ec
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 30 deletions.
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 = ianfhunter@gmail.com
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

0 comments on commit 8ff47ec

Please sign in to comment.