From 8b9d48e4d88d534b72a16ada51d142e7a0e63bc9 Mon Sep 17 00:00:00 2001 From: zenon Date: Thu, 7 Jun 2018 17:00:25 +0200 Subject: [PATCH] Not necessary to modify array of caller function main() --- supervisor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/supervisor.c b/supervisor.c index d20bef6..8b548b9 100644 --- a/supervisor.c +++ b/supervisor.c @@ -38,8 +38,9 @@ void initCircBuf() return; } -void getSolution(sem_t sUsedSpace, sem_t sFreeSpace, int *solution) +void getSolution(sem_t sUsedSpace, sem_t sFreeSpace) { + int solution[MAX_ITEMS]; for (int i = 0; i < MAX_ITEMS; i++) { solution[i] = -1; } @@ -133,8 +134,7 @@ int main(int argc, char *argv[]) initCircBuf(); while (quit == 0) { - int solution[MAX_ITEMS]; - getSolution(*sUsedSpace, *sFreeSpace, solution); + getSolution(*sUsedSpace, *sFreeSpace); }