From c668bef9d5cd87582bcf83c08e48ff6583159a44 Mon Sep 17 00:00:00 2001 From: Cosmin Popa Date: Mon, 11 Mar 2024 19:03:53 +0200 Subject: [PATCH] Add parentheses to lab-02 get pixel macro Signed-off-by: Cosmin Popa --- laborator/content/operatii-memorie-gdb/README.md | 2 +- .../content/operatii-memorie-gdb/solution/3-pixels/pixels.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/laborator/content/operatii-memorie-gdb/README.md b/laborator/content/operatii-memorie-gdb/README.md index 19a2545b..9c7f947a 100644 --- a/laborator/content/operatii-memorie-gdb/README.md +++ b/laborator/content/operatii-memorie-gdb/README.md @@ -460,7 +460,7 @@ p.b = 0.11 * p.b; > Accesarea elementelor matricei de pixeli se va face folosind operații cu pointeri. > **Hint:** Pentru simplificare, vă puteți folosi de urmatorul macro: > ```c -> #define GET_PIXEL(a, i ,j) (*(*(a + i) + j)) +> #define GET_PIXEL(a, i ,j) (*(*((a) + (i)) + (j))) > ``` ### **4. Find-Max** diff --git a/laborator/content/operatii-memorie-gdb/solution/3-pixels/pixels.c b/laborator/content/operatii-memorie-gdb/solution/3-pixels/pixels.c index d921174e..14ed4f2c 100644 --- a/laborator/content/operatii-memorie-gdb/solution/3-pixels/pixels.c +++ b/laborator/content/operatii-memorie-gdb/solution/3-pixels/pixels.c @@ -7,7 +7,7 @@ #include #include "pixel.h" -#define GET_PIXEL(a, i, j) (*(*(a + i) + j)) +#define GET_PIXEL(a, i, j) (*(*((a) + (i)) + (j))) void colorToGray(Picture *pic) {