From ef75d439a7dd22f19705b83b2c3a74b067f32a19 Mon Sep 17 00:00:00 2001 From: ygor-sena Date: Thu, 4 Apr 2024 13:17:31 -0300 Subject: [PATCH 1/3] ci: pin workflow to norminette v3.3.55 --- .github/workflows/miniRT_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/miniRT_test.yml b/.github/workflows/miniRT_test.yml index a2fea66..4ef3ec7 100644 --- a/.github/workflows/miniRT_test.yml +++ b/.github/workflows/miniRT_test.yml @@ -26,11 +26,11 @@ jobs: - uses: actions/checkout@v3 # Runs a set of commands using the runners shell - - name: Set up Criterion framework on Ubuntu 22.04 + - name: Set up Criterion framework and norminette on Ubuntu 22.04 run: | sudo apt-get install libcriterion-dev libbsd-dev -y python3 -m pip install --upgrade pip setuptools - python3 -m pip install norminette + python3 -m pip install norminette==3.3.55 # Runs a single command using the runners shell - name: Run norminette validation run: norminette include src From f4cb23e30c9a1c1059a6f7121347664cb9a025cc Mon Sep 17 00:00:00 2001 From: ygor-sena Date: Thu, 4 Apr 2024 13:18:18 -0300 Subject: [PATCH 2/3] chore: standardize code formatting to norminette v3.3.55 --- include/parser.h | 26 +++++++++++++++++++++++++- include/shapes.h | 5 +++-- src/parser/parse_shapes_2.c | 15 ++------------- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/include/parser.h b/include/parser.h index 46db6c9..4838183 100644 --- a/include/parser.h +++ b/include/parser.h @@ -6,12 +6,13 @@ /* By: yde-goes +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/05/10 12:11:15 by mdias-ma #+# #+# */ -/* Updated: 2023/06/16 13:40:10 by yde-goes ### ########.fr */ +/* Updated: 2024/04/04 09:50:05 by yde-goes ### ########.fr */ /* */ /* ************************************************************************** */ /// @file parser.h #ifndef PARSER_H +# define PARSER_H # include # include @@ -54,6 +55,29 @@ typedef enum e_token TOKEN_COUNT } t_token; +/** + * @brief Stores the parameters of the shapes cone and cylinder from configuration + * file after they have been verified by the scanner. + * + * @param origin Stores the origin of the cone or cylinder. + * @param direction Stores the direction of the cone or cylinder. + * @param diameter Stores the diameter of the cone or cylinder. + * @param height Stores the height of the cone or cylinder. + * @param radius Stores the radius of the cone or cylinder. + * @param minimum Stores the cone or cylinder minimum height, i.e, lowest height. + * @param maximum Stores the cone or cylinder maxinum height, i.e, highest height. + */ +typedef struct s_param +{ + t_point origin; + t_vector direction; + double diameter; + double height; + float radius; + float minimum; + float maximum; +} t_param; + /** * @brief Represents a scanner. * diff --git a/include/shapes.h b/include/shapes.h index caeadb6..071b89a 100644 --- a/include/shapes.h +++ b/include/shapes.h @@ -6,7 +6,7 @@ /* By: yde-goes +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/03/28 18:05:41 by mdias-ma #+# #+# */ -/* Updated: 2023/06/16 13:40:21 by yde-goes ### ########.fr */ +/* Updated: 2024/04/04 09:30:35 by yde-goes ### ########.fr */ /* */ /* ************************************************************************** */ @@ -105,7 +105,8 @@ typedef t_tuple (*t_normal_at)(t_shape *, t_tuple); */ typedef struct s_shape { - union { + union + { t_sphere sphere; t_plane plane; t_cylinder cylinder; diff --git a/src/parser/parse_shapes_2.c b/src/parser/parse_shapes_2.c index 4440e8a..063cfe2 100644 --- a/src/parser/parse_shapes_2.c +++ b/src/parser/parse_shapes_2.c @@ -3,26 +3,15 @@ /* ::: :::::::: */ /* parse_shapes_2.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: mdias-ma +#+ +:+ +#+ */ +/* By: yde-goes +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/05/30 15:27:09 by mdias-ma #+# #+# */ -/* Updated: 2023/06/11 10:27:33 by mdias-ma ### ########.fr */ +/* Updated: 2024/04/04 09:33:36 by yde-goes ### ########.fr */ /* */ /* ************************************************************************** */ #include "parser.h" -typedef struct s_param -{ - t_point origin; - t_vector direction; - double diameter; - double height; - float radius; - float minimum; - float maximum; -} t_param; - static void set_cone_attributes(t_shape *shape, t_param param); static void set_cylinder_attributes(t_shape *shape, t_param param); From e128e3fd9844000e869fa20911bbf7caa2d515f3 Mon Sep 17 00:00:00 2001 From: ygor-sena Date: Thu, 4 Apr 2024 13:28:45 -0300 Subject: [PATCH 3/3] chore: standardize parser.h to norminette v3.3.55 --- include/parser.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/parser.h b/include/parser.h index 4838183..d18d3ba 100644 --- a/include/parser.h +++ b/include/parser.h @@ -6,7 +6,7 @@ /* By: yde-goes +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/05/10 12:11:15 by mdias-ma #+# #+# */ -/* Updated: 2024/04/04 09:50:05 by yde-goes ### ########.fr */ +/* Updated: 2024/04/04 13:28:12 by yde-goes ### ########.fr */ /* */ /* ************************************************************************** */ @@ -56,16 +56,16 @@ typedef enum e_token } t_token; /** - * @brief Stores the parameters of the shapes cone and cylinder from configuration - * file after they have been verified by the scanner. + * @brief Stores the parameters of the shapes cone and cylinder from + * configuration file after they have been verified by the scanner. * * @param origin Stores the origin of the cone or cylinder. * @param direction Stores the direction of the cone or cylinder. * @param diameter Stores the diameter of the cone or cylinder. * @param height Stores the height of the cone or cylinder. * @param radius Stores the radius of the cone or cylinder. - * @param minimum Stores the cone or cylinder minimum height, i.e, lowest height. - * @param maximum Stores the cone or cylinder maxinum height, i.e, highest height. + * @param minimum Stores the cone or cylinder minimum height/lowest height. + * @param maximum Stores the cone or cylinder maxinum height/highest height. */ typedef struct s_param {