linuxchip
linuxchip

Reputation: 316

What is the value returned by following macro

What is the value returned by following macro if SNDRV_CARDS is equal to 8

#define SNDRV_DEFAULT_IDX  { [0 ... (SNDRV_CARDS-1)] = -1 }

I found this in a driver code.

Upvotes: 0

Views: 94

Answers (1)

unwind
unwind

Reputation: 399833

That's a GNU extended designated initializer.

The code the macro expands to is:

{ [0 ... (8-1)] = -1 }

which in turn is an array of 8 integers, all set to -1.

Upvotes: 2

Related Questions