SN74HC165N - What does BYTES_VAL_T represent

I have been trying to convert the shiftin program from Arduino to eclipse Java using the core processing library but I cannot seem to figure out what this BYTES_VAL_T represents. The original code comes from Playground arduino and is used for shifting in data towards the serial. Please see the code below:

#define BYTES_VAL_T unsigned int

int ploadPin        = 7;  // Connects to Parallel load pin the 165
int clockEnablePin  = 4;  // Connects to Clock Enable pin the 165
int dataPin         = 3; // Connects to the Q7 pin the 165
int clockPin        = 6; // Connects to the Clock pin the 165

BYTES_VAL_T pinValues;
BYTES_VAL_T oldPinValues;

/* This function is essentially a "shift-in" routine reading the
 * serial Data from the shift register chips and representing
 * the state of those pins in an unsigned integer (or long).
*/
BYTES_VAL_T read_shift_regs()
{
    long bitVal;
    BYTES_VAL_T bytesVal = 0;

    /* Trigger a parallel Load to latch the state of the data lines,
    */
    digitalWrite(clockEnablePin, HIGH);
    digitalWrite(ploadPin, LOW);
    delayMicroseconds(PULSE_WIDTH_USEC);
    digitalWrite(ploadPin, HIGH);
    digitalWrite(clockEnablePin, LOW);

    /* Loop to read each bit value from the serial out line
     * of the SN74HC165N.
    */
    for(int i = 0; i < DATA_WIDTH; i++)
    {
        bitVal = digitalRead(dataPin);

        /* Set the corresponding bit in bytesVal.
        */
        bytesVal |= (bitVal << ((DATA_WIDTH-1) - i));

        /* Pulse the Clock (rising edge shifts the next bit).
        */
        digitalWrite(clockPin, HIGH);
        delayMicroseconds(PULSE_WIDTH_USEC);
        digitalWrite(clockPin, LOW);
    }

    return(bytesVal);
}

At first glance I thought it was a simple int variable until I saw it being applied to pinValues and oldpinValues. Can someone please explain to me how this works? How can this "BYTES_VAL_T" be intepreted in java?

If anyone understand this that would be good to know. Everything works but I'm really confused about this segment.

#define BYTES_VAL_T unsigned int
...
BYTES_VAL_T pinValues;

What does it represent?
A waste of RAM, unless you've got more than 256 pins.

AWOL:

#define BYTES_VAL_T unsigned int

...
BYTES_VAL_T pinValues;



What does it represent? 
A waste of RAM, unless you've got more than 256 pins.

I don't think I'm following? Can you please elaborate more on that?

Neenja117:
I have been trying to convert the shiftin program from Arduino to eclipse Java using the core processing library but I cannot seem to figure out what this BYTES_VAL_T represents. The original code comes from Playground arduino and is used for shifting in data towards the serial. Please see the code below:

#define BYTES_VAL_T unsigned int

int ploadPin        = 7;  // Connects to Parallel load pin the 165
int clockEnablePin  = 4;  // Connects to Clock Enable pin the 165
int dataPin         = 3; // Connects to the Q7 pin the 165
int clockPin        = 6; // Connects to the Clock pin the 165

BYTES_VAL_T pinValues;
BYTES_VAL_T oldPinValues;

/* This function is essentially a "shift-in" routine reading the

  • serial Data from the shift register chips and representing
  • the state of those pins in an unsigned integer (or long).
    */
    BYTES_VAL_T read_shift_regs()
    {
       long bitVal;
       BYTES_VAL_T bytesVal = 0;

/* Trigger a parallel Load to latch the state of the data lines,
   */
   digitalWrite(clockEnablePin, HIGH);
   digitalWrite(ploadPin, LOW);
   delayMicroseconds(PULSE_WIDTH_USEC);
   digitalWrite(ploadPin, HIGH);
   digitalWrite(clockEnablePin, LOW);

/* Loop to read each bit value from the serial out line
    * of the SN74HC165N.
   */
   for(int i = 0; i < DATA_WIDTH; i++)
   {
       bitVal = digitalRead(dataPin);

/* Set the corresponding bit in bytesVal.
       */
       bytesVal |= (bitVal << ((DATA_WIDTH-1) - i));

/* Pulse the Clock (rising edge shifts the next bit).
       */
       digitalWrite(clockPin, HIGH);
       delayMicroseconds(PULSE_WIDTH_USEC);
       digitalWrite(clockPin, LOW);
   }

return(bytesVal);
}




At first glance I thought it was a simple int variable until I saw it being applied to pinValues and oldpinValues. Can someone please explain to me how this works? How can this "BYTES_VAL_T" be intepreted in java? 

If anyone understand this that would be good to know. Everything works but I'm really confused about this segment.

Its a macro. Macros are textual substitututed at compile time. So it means "unsigned int". There is also
a proper language facility for declaring/naming types called 'typedef', which is normally used for naming
types.

Because macros are textual they know nothing about the meaning of the program, for instance if you go

#define A 10+7

Serial.print (6*A) ;

You'd print 67, because 6*10+7 = 67

Whereas:

int a = 10+7;

Serial.print (6*a) ;

Would print 102 which is 6*a