update: fixed some function leaking into the final binary...

This commit is contained in:
maix0 2024-10-06 15:07:57 +02:00
parent f82a4041a5
commit a905a595d4
7 changed files with 22 additions and 16 deletions

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/30 16:17:17 by rparodi #+# #+# */
/* Updated: 2024/08/05 15:19:17 by maiboyer ### ########.fr */
/* Updated: 2024/10/06 15:05:48 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -82,6 +82,7 @@ t_error write_fd(t_fd *fd, t_u8 *buffer, t_usize size, t_isize *write_count)
return (NO_ERROR);
}
/* TODO: REMOVE THIS COMMENT SURROUNDING THE FUNCTION
t_error stat_fd(t_fd *fd, t_stat *stat)
{
if (fd == NULL || stat == NULL || fd->fd == -1)
@ -90,6 +91,7 @@ t_error stat_fd(t_fd *fd, t_stat *stat)
return (ERROR);
return (NO_ERROR);
}
*/
void close_fd(t_fd *fd)
{

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/30 16:26:32 by rparodi #+# #+# */
/* Updated: 2024/08/05 15:19:21 by maiboyer ### ########.fr */
/* Updated: 2024/10/06 15:05:57 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,6 +21,7 @@
#include <stdio.h>
#include <sys/stat.h>
/* TODO: REMOVE THIS COMMENT SURROUNDING THE FUNCTION
t_error open_file(t_str name, t_mode mode, t_file **file)
{
t_file *out;
@ -82,3 +83,4 @@ void close_file(t_file *file)
mem_set_zero(slot, sizeof(*slot));
slot->ty = SLOT_UNUSED;
}
*/

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/19 15:53:50 by maiboyer #+# #+# */
/* Updated: 2024/08/22 16:23:04 by maiboyer ### ########.fr */
/* Updated: 2024/10/06 15:02:50 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -57,6 +57,9 @@ __attribute__((destructor(201))) void close_all_slots(void)
close_slot(&arr->storage[i++]);
}
// This is to remove the f<name> function from being there...
// else if (slot->ty == SLOT_FILE)
// ;//close_file(&slot->slot.file);
void close_slot(struct s_file_slot *slot)
{
if (slot == NULL)
@ -67,8 +70,6 @@ void close_slot(struct s_file_slot *slot)
close_fd(&slot->slot.fd);
else if (slot->ty == SLOT_DIR)
close_dir(&slot->slot.dir);
else if (slot->ty == SLOT_FILE)
close_file(&slot->slot.file);
else
(void)!write(2, "Unknown SLOT type", 17);
mem_set_zero(slot, sizeof(*slot));

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/16 17:57:04 by maiboyer #+# #+# */
/* Updated: 2024/07/30 16:10:07 by rparodi ### ########.fr */
/* Updated: 2024/10/06 15:04:47 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -35,7 +35,7 @@ bool handle_atoi_stuff(t_const_str fmt, t_usize *c_idx, t_usize *nxt,
advance_atoi(fmt, c_idx);
c_arg->extra.align = (t_u64)atoi_res;
handle_prec_and_align(fmt, c_idx, c_arg);
atoi_res = atoi(&fmt[*c_idx]);
atoi_res = _atoi_printf(&fmt[*c_idx]);
if (atoi_res < 0)
{
*c_idx = *nxt;