mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-05-17 12:01:18 +00:00
[client] main: use ARRAY_LENGTH macro
This commit is contained in:
parent
074341e421
commit
a76b274e1a
@ -38,6 +38,7 @@
|
|||||||
#include <stdatomic.h>
|
#include <stdatomic.h>
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
|
||||||
|
#include "common/array.h"
|
||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
#include "common/crash.h"
|
#include "common/crash.h"
|
||||||
#include "common/KVMFR.h"
|
#include "common/KVMFR.h"
|
||||||
@ -631,7 +632,7 @@ int main_frameThread(void * unused)
|
|||||||
if (g_state.useDMA)
|
if (g_state.useDMA)
|
||||||
{
|
{
|
||||||
/* find the existing dma buffer if it exists */
|
/* 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)
|
if (dmaInfo[i].frame == frame)
|
||||||
{
|
{
|
||||||
@ -648,7 +649,7 @@ int main_frameThread(void * unused)
|
|||||||
|
|
||||||
/* otherwise find a free buffer for use */
|
/* otherwise find a free buffer for use */
|
||||||
if (!dma)
|
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)
|
if (!dmaInfo[i].frame)
|
||||||
{
|
{
|
||||||
@ -721,7 +722,7 @@ int main_frameThread(void * unused)
|
|||||||
|
|
||||||
if (g_state.useDMA)
|
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)
|
if (dmaInfo[i].fd >= 0)
|
||||||
close(dmaInfo[i].fd);
|
close(dmaInfo[i].fd);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user