From 3b7179d49a6a2780cf28b935e27189a31de7e3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Sun, 14 Jun 2020 18:58:36 +0200 Subject: [PATCH] print: minor, add spaces around operators --- lib/print.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/print.c b/lib/print.c index ad30eea..30e5a06 100644 --- a/lib/print.c +++ b/lib/print.c @@ -2,7 +2,7 @@ * @file * @author King Kévin * @copyright SPDX-License-Identifier: GPL-3.0-or-later - * @date 2017-2019 + * @date 2017-2020 */ /* standard libraries */ #include // standard integer types @@ -94,7 +94,7 @@ static size_t print_unsigned(char** str, size_t* size, uint64_t u, uint32_t padd uint8_t digits = 0; // to count the number of digits size_t length = 0; // number of characters printed do { - number[digits++] = '0'+(u % 10); // store digit + number[digits++] = '0' + (u % 10); // store digit u /= 10; // go to next digit } while (u > 0); if (sign) { // print sign @@ -119,9 +119,9 @@ static size_t print_unsigned(char** str, size_t* size, uint64_t u, uint32_t padd **/ static size_t print_signed(char** str, size_t* size, int64_t d, uint32_t padding, bool sign) { size_t length = 0; // number of characters printed - if (d<0) { + if (d < 0) { print_printed(&length, print_char(str, size, '-')); // print sign - print_printed(&length, print_unsigned(str, size, (uint64_t)-d, padding, false)); // print number (casting because there is one more negative value then positive value) + print_printed(&length, print_unsigned(str, size, (uint64_t) - d, padding, false)); // print number (casting because there is one more negative value then positive value) } else { print_printed(&length, print_unsigned(str, size, d, padding, sign)); // print number }