How do I use variables in functions/procedures

This repeats the bit value five times, instead of four zeroes and the bit value once through the loop. Try

          shiftOut(dataPin, clockPin, MSBFIRST, f.chip == c ? bit : 0);