Problem calling a function from another function

Could it be because you turn the latch pin HIGH inside the loop ?

    for ( int bitToSet = 0; bitToSet <= 8; bitToSet++ ) {
                                    ^^^^