MCP4822 DAC test sketch does not compile

This sketch from the adafruit forums throws up errors with the compiler.
It has two functions with the same name. I’m not sure how to deal with this. The code is stated as working well.
So the compiler errors are;-

mcp4822test.ino: In function ‘void loop()’:
mcp4822test.ino:65:39: error: no matching function for call to ‘setOutput(int, uint16_t&)’
mcp4822test.ino:65:39: note: candidates are:
mcp4822test.ino:39:6: note: void setOutput(unsigned int)
mcp4822test.ino:39:6: note: candidate expects 1 argument, 2 provided
mcp4822test.ino:50:6: note: void setOutput(byte, byte, byte, unsigned int)
mcp4822test.ino:50:6: note: candidate expects 4 arguments, 2 provided
mcp4822test.ino:71:39: error: no matching function for call to ‘setOutput(int, uint16_t&)’
mcp4822test.ino:71:39: note: candidates are:
mcp4822test.ino:39:6: note: void setOutput(unsigned int)
mcp4822test.ino:39:6: note: candidate expects 1 argument, 2 provided
mcp4822test.ino:50:6: note: void setOutput(byte, byte, byte, unsigned int)
mcp4822test.ino:50:6: note: candidate expects 4 arguments, 2 provided
Error compiling.

[code]
//from https://forums.adafruit.com/viewtopic.php?f=8&t=105169 //


#include <SPI.h>
 
const int PIN_CS = 10;
const int GAIN_1 = 0x1;
const int GAIN_2 = 0x0;

/*
    PERIOD_A is set for 110 Hz (A) @ 16 samples per cycle
    PERIOD_B is set for 131 Hz (C) @ 16 samples per cycle
*/
#define PERIOD_A    568
#define PERIOD_B    477

uint32_t next_A = 0;
uint32_t next_B = 0;

uint8_t phase_A = 0;
uint8_t phase_B = 0;

uint16_t sine[ 16 ] = {
  2048, 2831, 3495, 3939,
  4095, 3939, 3495, 2831,
  2048, 1264,  600,  156,
     0,  156,  600, 1264,
};
 
void setup()
{
  pinMode(PIN_CS, OUTPUT);
  SPI.begin();  
  SPI.setClockDivider(SPI_CLOCK_DIV2);
  Serial.begin(9600);
}
 
//assuming single channel, gain=2
void setOutput(unsigned int val)
{
  byte lowByte = val & 0xff;
  byte highByte = ((val >> 8) & 0xff) | 0x10;
   
  PORTB &= 0xfb;
  SPI.transfer(highByte);
  SPI.transfer(lowByte);
  PORTB |= 0x4;
}
 
void setOutput(byte channel, byte gain, byte shutdown, unsigned int val)
{
  byte lowByte = val & 0xff;
  byte highByte = ((val >> 8) & 0xff) | channel << 7 | gain << 5 | shutdown << 4;
   
  PORTB &= 0xfb;
  SPI.transfer(highByte);
  SPI.transfer(lowByte);
  PORTB |= 0x4;
}
 
void loop () {
    uint32_t now = micros();
    
    if ( now > next_A ) {
        setOutput( 0, sine[ phase_A ] );
        
        phase_A = ( phase_A + 1 ) % 16;
        next_A += PERIOD_A;
    }
    if ( now > next_B ) {
        setOutput( 1, sine[ phase_B ] );
        
        phase_B = ( phase_B + 1 ) % 16;
        next_B += PERIOD_B;
    }
}

[/code]

setOutput requires either ONE or FOUR parameters and you are giving only TWO

so

setOutput( 0, sine[ phase_A ] );

should be

setOutput( 0, 0, 1, sine[ phase_A ] ); //DACA selected, 2x gain and DACA active

and

setOutput( 1, 0, 1, sine[ phase_B ] );

should be

setOutput( 1, 0, 1, sine[ phase_B ] ); //DACB selected, 2x gain and DACB active. (DACA not deactivated)