Writing flash on ATmega328
I searched the datasheet, there is nothing about endian-ness. The issue might just be how you write to the flash memory. It seems to write to flash memory the 'words' are two bytes long, but the address itself is per byte. The original programmer was obviously a good kid, and read this part of the AVR-libc reference:
"Note
The address is a byte address. The data is a word. The AVR writes data to the buffer a word at a time, but addresses the buffer per byte! So, increment your address by 2 between calls, and send 2 data bytes in a word format! The LSB of the data is written to the lower address; the MSB of the data is written to the higher address."

source

The first half (byte) of 'w' is the byte pointed at by the dereferenced pointer 'buf' which is then incremented by 1 (by the ++). The second half of the word 'w' is done by this line " w += (*buf++) &lt;&lt; 8"  and what this does is adds the upper half (which is the contents of the address pointed to by 'buf' at the next byte) by shifting the byte left 8 bits. This puts it in the upper half, as I said. 

You now have 'w' which contains two bytes of data, as a 'word' ready to be written with boot_page_fill function, a function from the AVR-Libc library. 

If you ever do not understand the inputs to functions you should always try to look up the reference and see the comments that I found and showed above.