Skip to content

Commit

Permalink
chore: merge pull request #37 from ygor-sena/chore/norminette-fix
Browse files Browse the repository at this point in the history
fix: address latest norminette v3.3.55 update incompatibility issue
  • Loading branch information
magalhaesm authored Apr 4, 2024
2 parents 4acd361 + e128e3f commit aa4397a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/miniRT_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 25 additions & 1 deletion include/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
/* By: yde-goes <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 13:28:12 by yde-goes ### ########.fr */
/* */
/* ************************************************************************** */

/// @file parser.h
#ifndef PARSER_H
# define PARSER_H

# include <fcntl.h>
# include <stdlib.h>
Expand Down Expand Up @@ -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/lowest height.
* @param maximum Stores the cone or cylinder maxinum height/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.
*
Expand Down
5 changes: 3 additions & 2 deletions include/shapes.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: yde-goes <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -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;
Expand Down
15 changes: 2 additions & 13 deletions src/parser/parse_shapes_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,15 @@
/* ::: :::::::: */
/* parse_shapes_2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mdias-ma <mdias-ma@student.42sp.org.br> +#+ +:+ +#+ */
/* By: yde-goes <yde-goes@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);

Expand Down

0 comments on commit aa4397a

Please sign in to comment.