From d9385975210ffe8d2b80969e0d6ae105974d7827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=CC=81o?= Date: Sat, 10 Jun 2023 13:39:20 +0200 Subject: [PATCH] style: add Norme format --- client_bonus.c | 10 +++++----- server.c | 6 +++--- server_bonus.c | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/client_bonus.c b/client_bonus.c index d6c4ac1..c23f565 100644 --- a/client_bonus.c +++ b/client_bonus.c @@ -6,7 +6,7 @@ /* By: lgaudin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/09 15:02:14 by lgaudin #+# #+# */ -/* Updated: 2023/06/10 13:30:49 by lgaudin ### ########.fr */ +/* Updated: 2023/06/10 13:38:56 by lgaudin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -44,12 +44,12 @@ void send_signal(int pid, unsigned char character) } } -void handle_read_receipt(int signal) +void handle_read_receipt(int signal) { if (signal == SIGUSR1) - ft_printf("Received bit 1\n"); + ft_printf("Received bit 1\n"); else if (signal == SIGUSR2) - ft_printf("Received bit 0\n"); + ft_printf("Received bit 0\n"); } /** @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) const char *message; int i; - signal(SIGUSR1, handle_read_receipt); + signal(SIGUSR1, handle_read_receipt); signal(SIGUSR2, handle_read_receipt); if (argc != 3) { diff --git a/server.c b/server.c index 65939c9..a526833 100644 --- a/server.c +++ b/server.c @@ -6,7 +6,7 @@ /* By: lgaudin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/09 15:02:13 by lgaudin #+# #+# */ -/* Updated: 2023/06/09 16:49:47 by lgaudin ### ########.fr */ +/* Updated: 2023/06/10 13:38:51 by lgaudin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -39,8 +39,8 @@ */ void handle_signal(int signal) { - static unsigned char current_char; - static int bit_index; + static unsigned char current_char; + static int bit_index; current_char |= (signal == SIGUSR1); bit_index++; diff --git a/server_bonus.c b/server_bonus.c index 4fcf25d..0bb4ca5 100644 --- a/server_bonus.c +++ b/server_bonus.c @@ -6,7 +6,7 @@ /* By: lgaudin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/09 15:02:13 by lgaudin #+# #+# */ -/* Updated: 2023/06/10 13:12:52 by lgaudin ### ########.fr */ +/* Updated: 2023/06/10 13:38:49 by lgaudin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -38,10 +38,10 @@ */ void handle_signal(int signal, siginfo_t *info, void *context) { - static unsigned char current_char; - static int bit_index; + static unsigned char current_char; + static int bit_index; - (void)context; + (void)context; current_char |= (signal == SIGUSR1); bit_index++; if (bit_index == 8) @@ -53,9 +53,9 @@ void handle_signal(int signal, siginfo_t *info, void *context) else current_char <<= 1; if (signal == SIGUSR1) - kill(info->si_pid, SIGUSR1); + kill(info->si_pid, SIGUSR1); else if (signal == SIGUSR2) - kill(info->si_pid, SIGUSR2); + kill(info->si_pid, SIGUSR2); } /** @@ -63,7 +63,7 @@ void handle_signal(int signal, siginfo_t *info, void *context) */ int main(void) { - struct sigaction sa; + struct sigaction sa; sa.sa_sigaction = &handle_signal; sa.sa_flags = SA_SIGINFO;