diff --git a/src/main.c b/src/main.c index 26e21ee..edabf60 100644 --- a/src/main.c +++ b/src/main.c @@ -269,14 +269,20 @@ int main(int argc, char *argv[]) { continue; } + // Get the current state of the GPU + gpuState * state = &gpuStates[id]; + // Mark the GPU as managed - &gpuStates[id]->managed = true; + gpuState->managed = true; } } else { // Iterate through each GPU for (unsigned int i = 0; i < deviceCount; i++) { + // Get the current state of the GPU + gpuState * state = &gpuStates[i]; + // Mark the GPU as managed - &gpuStates[i]->managed = true; + gpuState->managed = true; } } @@ -285,8 +291,11 @@ int main(int argc, char *argv[]) { // Iterate through each GPU for (unsigned int i = 0; i < deviceCount; i++) { + // Get the current state of the GPU + gpuState * state = &gpuStates[i]; + // If GPU is managed - if (&gpuStates[i]->managed) { + if (gpuState->managed) { // Update flag hasManagedGpus = true; } diff --git a/src/utils.c b/src/utils.c index cba067c..5f68722 100644 --- a/src/utils.c +++ b/src/utils.c @@ -41,7 +41,7 @@ bool parse_ulong(const char *arg, unsigned long *value) { return true; } -bool parse_ulong_array(const char *arg, const char *delimiter, const size_t max_count, unsigned long *values, size_t *count) { +bool parse_ulong_array(const char *arg, const char *delimiter, const size_t max_count, unsigned long **values, size_t *count) { // Check if the input or output argument is invalid if (arg == NULL || values == NULL || count == NULL) { return false; diff --git a/src/utils.h b/src/utils.h index b0f9a56..687e98b 100644 --- a/src/utils.h +++ b/src/utils.h @@ -48,4 +48,4 @@ /***** ***** ***** ***** ***** FUNCTIONS ***** ***** ***** ***** *****/ bool parse_ulong(const char *arg, unsigned long *value); -bool parse_ulong_array(const char *arg, const char *delimiter, const size_t max_count, unsigned long *values, size_t *count); +bool parse_ulong_array(const char *arg, const char *delimiter, const size_t max_count, unsigned long **values, size_t *count);