help with this ERROR "expected initializer before 'if'"

I'm using a ILI9225 tft screen.
I'm trying to make a scroll down menu.

could you revise the code to see where something is going wrong, please?
your help could really be appreciated.

#include "TFT_22_ILI9225.h"
#include "SPI.h"
#include "Adafruit_GFX.h"

#define TFT_RST         8
#define TFT_RS          9
#define TFT_CS         10  // SS
#define TFT_SDI        11  // MOSI
#define TFT_CLK        13  // SCK
#define TFT_LED         7   // 0 if wired to +5V directly
#define buzzer         A4
#define drawMenu

int menuitem   = 1;
int page        = 1;


volatile boolean button_up     = false;
volatile boolean button_down   = false;
volatile boolean button_select = false;

int downButtonState       = 0;
int upButtonState         = 0;  
int selectButtonState     = 0;          
int lastDownButtonState   = 0;
int lastSelectButtonState = 0;
int lastUpButtonState     = 0;

float count_1   = 0.0;
float count_2   = 0.0;
float count_3   = 0.0;
float count_4   = 0.0;

// Use hardware SPI (faster - on Uno: 13-SCK, 12-MISO, 11-MOSI)
TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_LED);
// Use software SPI (slower)
//TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_SDI, TFT_CLK, TFT_LED);

// Variables and constants
uint16_t x, y;
//boolean flag = false;


// Setup
void setup() {
  Serial.begin(9600);
    tft.begin();
    //tft.setFont(Terminal6x8);
    delay(1000);


  pinMode(TFT_CS, OUTPUT);
  pinMode(TFT_RS, OUTPUT);
  pinMode(TFT_RST, OUTPUT);
  pinMode(button_up, INPUT_PULLUP);
  pinMode(button_down, INPUT_PULLUP);
  pinMode(button_select, INPUT_PULLUP);
  pinMode(TFT_LED ,OUTPUT);
}



void loop()
{      tft.setFont(Terminal6x8);  

  int drawMenu();

  upButtonState =   digitalRead(4);
  downButtonState = digitalRead(3);
  selectButtonState = digitalRead(2);
 
 
  void checkIfDownButtonIsPressed();
  void checkIfUpButtonIsPressed();
  void checkIfSelectButtonIsPressed();

//ITEM1
   if (up && page == 1 ) {
    up = false;
    menuitem--;
    if (menuitem == 0)
    {
      tft.drawRectangle(3, 40, 90, 65,  COLOR_RED);//set cursor
      menuitem = 4;
    } 
   }
  else if (up && page == 2 ) {
    up = false;
    count_1--;
    tft.drawText(119, 56, String(count_1) + "  ", COLOR_GOLD);//$ 
  }
  if (down && page == 1) {
    down = false;
    menuitem++;
    if (menuitem == 4) 
    {
      tft.drawRectangle(3, 40, 90, 65,  COLOR_RED);//set cursor
      menuitem = 1;
    }      
  }else if (down && page == 2 ) {
    down = false;
    count_1++;
    tft.drawText(119, 56, String(count_1) + "  ", COLOR_GOLD);//$
  }


//ITEM2
   if (up && page == 1 ) {
    up = false;
    menuitem--;
    if (menuitem == 1)
    {
      tft.drawRectangle(3, 67, 90, 92,  COLOR_RED);//set cursor
      menuitem = 4;
    } 
   }
  else if (up && page == 2 ) {
    up = false;
    count_2--;
    tft.drawText(119, 83, String(count_2) + "  ", COLOR_GOLD);//$ 
  }
  if (down && page == 1) {
    down = false;
    menuitem++;
    if (menuitem == 4) 
    {
      tft.drawRectangle(3, 67, 90, 92,  COLOR_RED);//set cursor
      menuitem = 2;
    }      
  }else if (down && page == 2 ) {
    down = false;
    count_2++;
    tft.drawText(119, 83, String(count_2) + "  ", COLOR_GOLD);//$
  }


  //ITEM3
  if (up && page == 1 ) {
    up = false;
    menuitem--;
    if (menuitem == 2)
    {
      tft.drawRectangle(3, 94, 90, 119,  COLOR_RED);//set cursor
      menuitem = 4;
    } 
   }
  else if (up && page == 2 ) {
    up = false;
    count_4--;
    tft.drawText(119, 137, String(count_4) + "  ", COLOR_GOLD);//$
  }
  if (down && page == 1) {
    down = false;
    menuitem++;
    if (menuitem == 4) 
    {
      tft.drawRectangle(3, 94, 90, 119,  COLOR_RED);//set cursor
      menuitem = 3;
    }      
  }else if (down && page == 2 ) {
    down = false;
    count_4++;
    tft.drawText(119, 137, String(count_4) + "  ", COLOR_GOLD);//$
  }


  
  //ITEM4
  if (up && page == 1 ) {
    up = false;
    menuitem--;
    if (menuitem == 3)
    {
      tft.drawRectangle(3, 121, 90, 146,  COLOR_RED); //set cursor
      menuitem = 4;
    } 
   }
  else if (up && page == 2 ) {
    up = false;
    count_4--;
    tft.drawText(119, 110, String(count_3) + "  ", COLOR_GOLD);//$ 
  }
  if (down && page == 1) {
    down = false;
    menuitem++;
    if (menuitem == 4) 
    {
      tft.drawRectangle(3, 121, 90, 146,  COLOR_RED);//set cursor
      menuitem = 4;
    }      
  }else if (down && page == 2 ) {
    down = false;
    count_4++;
    tft.drawText(119, 110, String(count_3) + "  ", COLOR_GOLD);//$
  }


else if (page == 1 && menuitem == 1) {
      page = 2;
     }
else if (page == 2) {
      page = 1;
     }
   



void checkIfDownButtonIsPressed()
  
    if (downButtonState != lastDownButtonState) 
  {
    if (downButtonState == 0) 
    {
      down = true;
    }
    delay(50);
  }
   lastDownButtonState = downButtonState;
  }
void checkIfUpButtonIsPressed()
{
  if (upButtonState != lastUpButtonState) 
  {
    if (upButtonState == 0) {
      up = true;
    }
    delay(50);
  }
   lastUpButtonState = upButtonState;
}
void checkIfSelectButtonIsPressed()
{
   if (selectButtonState != lastSelectButtonState) 
  {
    if (selectButtonState == 0) {
      select = true;
    }
    delay(50);
  }
   lastSelectButtonState = selectButtonState;
}



    if(page == 2)
    {
      tft.fillRectangle(0, 0, tft.maxX() - 1, tft.maxY() - 1, COLOR_WHITE);  //fill whole screen
      tft.setFont(Terminal6x8);
      tft.fillRectangle(1, 1, tft.maxX() - 1, tft.maxY() - 138, COLOR_LIGHTGREY);
      tft.drawText(7, 46, "VALUE");

      if(menuitem == 1 && page == 2)
      {
        tft.setFont(Terminal12x16);
        tft.drawText(65, 2, "ITEM 1 COUNT");
        tft.drawText(30, 100, String(count_1) + "  ", COLOR_GOLD);
      }


      if(menuitem == 2 && page == 2)
      {
        tft.setFont(Terminal12x16);
        tft.drawText(65, 2, "ITEM 2 COUNT");
        tft.drawText(30, 100, String(count_2) + "  ", COLOR_GOLD);
      }



      if(menuitem == 3 && page == 2)
      {
        tft.setFont(Terminal12x16);
        tft.drawText(65, 2, "ITEM 3 COUNT");
        tft.drawText(30, 100, String(count_3) + "  ", COLOR_GOLD);
      }


      if(menuitem == 4 && page == 2)
      {
        tft.setFont(Terminal12x16);
        tft.drawText(65, 2, "ITEM 4 COUNT");
        tft.drawText(30, 100, String(count_4) + "  ", COLOR_GOLD);
      }  
  }

thanks for that.

but the error " expected initializer before 'if'" is for this if statement.

void checkIfDownButtonIsPressed()
  
    if (digitalRead(downButtonState) != lastDownButtonState) 
  {
    if (downButtonState == 0) 
    {
      down = true;
    }
    delay(50);
  }

Hi.

Either void checkIfDownButtonIsPressed() is really short, or did someone perhaps forget the {curly braces} ?

Why are you creating these functions (all three of them) multiple times ?
And why are you creating functions which never get called ?

Now i'm in suspense to find out whether the help in this thread is appreciated, so i'll check back regularly...