diff --git a/client/src/main.c b/client/src/main.c index dbf692fc..44b4c285 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -38,6 +38,7 @@ #include #include +#include "common/array.h" #include "common/debug.h" #include "common/crash.h" #include "common/KVMFR.h" @@ -631,7 +632,7 @@ int main_frameThread(void * unused) if (g_state.useDMA) { /* find the existing dma buffer if it exists */ - for(int i = 0; i < sizeof(dmaInfo) / sizeof(struct DMAFrameInfo); ++i) + for(int i = 0; i < ARRAY_LENGTH(dmaInfo); ++i) { if (dmaInfo[i].frame == frame) { @@ -648,7 +649,7 @@ int main_frameThread(void * unused) /* otherwise find a free buffer for use */ if (!dma) - for(int i = 0; i < sizeof(dmaInfo) / sizeof(struct DMAFrameInfo); ++i) + for(int i = 0; i < ARRAY_LENGTH(dmaInfo); ++i) { if (!dmaInfo[i].frame) { @@ -721,7 +722,7 @@ int main_frameThread(void * unused) if (g_state.useDMA) { - for(int i = 0; i < sizeof(dmaInfo) / sizeof(struct DMAFrameInfo); ++i) + for(int i = 0; i < ARRAY_LENGTH(dmaInfo); ++i) if (dmaInfo[i].fd >= 0) close(dmaInfo[i].fd); }